Changeset 29198 in osm for applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
- Timestamp:
- 2013-01-14T19:11:27+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r29189 r29198 18 18 import s57.S57att.Att; 19 19 import s57.S57obj.Obj; 20 import s57.S57val.ColCOL;21 20 import s57.S57val.*; 22 21 import s57.S57val; … … 66 65 ArrayList<Long> way = map.ways.get(feature.refs); 67 66 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; 70 69 double sigma = 0.0; 71 70 for (long node : way) { 72 71 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; 75 74 sigma += (lon * Math.sin(llat)) - (llon * Math.sin(lat)); 76 75 llon = lon; 77 76 llat = lat; 78 77 } 79 return Math.abs(sigma) / 2.0* 3444 * 3444;78 return Math.abs(sigma) * 3444 * 3444 / 2.0; 80 79 } 81 80 return 0.0; … … 83 82 84 83 public static Coord findCentroid(Feature feature) { 85 double tst = calcArea(feature);86 84 Coord coord; 87 85 ArrayList<Long> way = map.ways.get(feature.refs); … … 105 103 double lon = coord.lon; 106 104 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))); 108 106 slat += (lat * arc); 109 107 slon += (lon * arc); … … 122 120 } 123 121 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 } 124 143 }
Note:
See TracChangeset
for help on using the changeset viewer.
