Ignore:
Timestamp:
2013-01-14T19:11:27+01:00 (13 years ago)
Author:
malcolmh
Message:

save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/seamap/Renderer.java

    r29189 r29198  
    1818import s57.S57att.Att;
    1919import s57.S57obj.Obj;
    20 import s57.S57val.ColCOL;
    2120import s57.S57val.*;
    2221import s57.S57val;
     
    6665                        ArrayList<Long> way = map.ways.get(feature.refs);
    6766                        Coord coord = map.nodes.get(way.get(0));
    68             double llon = Math.toRadians(coord.lon);
    69             double llat = Math.toRadians(coord.lat);
     67            double llon = coord.lon;
     68            double llat = coord.lat;
    7069            double sigma = 0.0;
    7170                        for (long node : way) {
    7271                                coord = map.nodes.get(node);
    73                                 double lat = Math.toRadians(coord.lat);
    74                                 double lon = Math.toRadians(coord.lon);
     72                                double lat = coord.lat;
     73                                double lon = coord.lon;
    7574                                sigma += (lon * Math.sin(llat)) - (llon * Math.sin(lat));
    7675                                llon = lon;
    7776                                llat = lat;
    7877            }
    79             return Math.abs(sigma) / 2.0 * 3444 * 3444;
     78            return Math.abs(sigma) * 3444 * 3444 / 2.0;
    8079          }
    8180          return 0.0;
     
    8382
    8483        public static Coord findCentroid(Feature feature) {
    85                 double tst = calcArea(feature);
    8684                Coord coord;
    8785                ArrayList<Long> way = map.ways.get(feature.refs);
     
    105103      double lon = coord.lon;
    106104      double lat = coord.lat;
    107       double arc = (Math.acos(Math.cos(Math.toRadians(lon-llon)) * Math.cos(Math.toRadians(lat-llat))));
     105      double arc = (Math.acos(Math.cos(lon-llon) * Math.cos(lat-llat)));
    108106      slat += (lat * arc);
    109107      slon += (lon * arc);
     
    122120        }
    123121       
     122        public static void lineSymbols(Feature feature, Symbol prisymb, double space, Symbol secsymb, int ratio) {
     123                if (feature.flag != Fflag.NODE) {
     124                        ArrayList<Long> way = map.ways.get(feature.refs);
     125                        for (long node : way) {
     126                                Point2D point = helper.getPoint(map.nodes.get(node));
     127                               
     128                        }
     129                }
     130        }
     131       
     132        public static void lineVector (Feature feature, LineStyle style) {
     133               
     134        }
     135       
     136        public static void labelText (Feature feature, String str, TextStyle style, Delta delta) {
     137               
     138        }
     139       
     140        public static void lineText (Feature feature, String str, TextStyle style, double offset, Delta delta) {
     141               
     142        }
    124143}
Note: See TracChangeset for help on using the changeset viewer.