Changeset 30183 in osm for applications/editors/josm/plugins/smed2/src/s57/S57map.java
- Timestamp:
- 2014-01-05T14:28:30+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/s57/S57map.java
r30157 r30183 13 13 14 14 import s57.S57att; 15 import s57.S57val.AttVal;16 15 import s57.S57att.*; 17 16 import s57.S57obj; … … 25 24 ANON, // Edge inner nodes 26 25 ISOL, // Node not part of Edge 27 CONN // Edge first and last nodes 26 CONN, // Edge first and last nodes 27 DPTH // Sounding nodes 28 28 } 29 29 … … 50 50 } 51 51 52 public class Dnode extends Snode { // All depth soundings 53 public double val; // Sounding value 54 55 public Dnode() { 56 flg = Nflag.DPTH; 57 lat = 0; 58 lon = 0; 59 val = 0; 60 } 61 public Dnode(double ilat, double ilon, double ival) { 62 flg = Nflag.DPTH; 63 lat = ilat; 64 lon = ilon; 65 val = ival; 66 } 67 } 68 52 69 public class Edge { // A polyline segment 53 70 public long first; // First CONN node … … 157 174 public class Feature { 158 175 public Fflag flag; 159 public long refs;176 public long id; 160 177 public Obj type; 161 178 public AttMap atts; … … 167 184 Feature() { 168 185 flag = Fflag.UNKN; 169 refs= 0;186 id = 0; 170 187 type = Obj.UNKOBJ; 171 188 atts = new AttMap(); … … 287 304 nodes.put(id, new Snode(Math.toRadians(lat), Math.toRadians(lon))); 288 305 feature = new Feature(); 289 feature. refs= id;306 feature.id = id; 290 307 feature.flag = Fflag.POINT; 291 308 edge = null; 292 309 } 293 310 311 public void addNode(long id, double lat, double lon, double depth) { 312 nodes.put(id, new Dnode(Math.toRadians(lat), Math.toRadians(lon), depth)); 313 feature = new Feature(); 314 feature.id = id; 315 feature.flag = Fflag.POINT; 316 edge = null; 317 } 318 294 319 public void addEdge(long id) { 295 320 feature = new Feature(); 296 feature. refs= id;321 feature.id = id; 297 322 feature.flag = Fflag.LINE; 298 323 edge = new Edge(); … … 312 337 public void addArea(long id) { 313 338 feature = new Feature(); 314 feature. refs= id;339 feature.id = id; 315 340 feature.flag = Fflag.AREA; 316 341 outers = new ArrayList<Long>(); … … 505 530 switch (feature.flag) { 506 531 case POINT: 507 return nodes.get(feature. refs);532 return nodes.get(feature.id); 508 533 case LINE: 509 Edge edge = edges.get(feature. refs);534 Edge edge = edges.get(feature.id); 510 535 EdgeIterator eit = new EdgeIterator(edge, true); 511 536 while (eit.hasNext()) { … … 542 567 return new Snode(llat + ((lat - llat) * harc / sarc), llon + ((lon - llon) * harc / sarc)); 543 568 case AREA: 544 Bound bound = areas.get(feature. refs).get(0);569 Bound bound = areas.get(feature.id).get(0); 545 570 BoundIterator bit = new BoundIterator(bound); 546 571 while (bit.hasNext()) {
Note:
See TracChangeset
for help on using the changeset viewer.
