Changeset 30186 in osm for applications/editors/josm/plugins/smed2/src/s57/S57map.java
- Timestamp:
- 2014-01-06T16:26:41+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/s57/S57map.java
r30183 r30186 174 174 public class Feature { 175 175 public Fflag flag; 176 public long id;176 public long refs; 177 177 public Obj type; 178 178 public AttMap atts; … … 184 184 Feature() { 185 185 flag = Fflag.UNKN; 186 id= 0;186 refs = 0; 187 187 type = Obj.UNKOBJ; 188 188 atts = new AttMap(); … … 304 304 nodes.put(id, new Snode(Math.toRadians(lat), Math.toRadians(lon))); 305 305 feature = new Feature(); 306 feature. id= id;306 feature.refs = id; 307 307 feature.flag = Fflag.POINT; 308 308 edge = null; 309 309 } 310 310 311 public void addNode(long id, double lat, double lon, double depth) { 311 public void newNode(long id, double lat, double lon, Nflag flag) { 312 nodes.put(id, new Snode(Math.toRadians(lat), Math.toRadians(lon), flag)); 313 if (flag == Nflag.ANON) { 314 edge.nodes.add(id); 315 } 316 } 317 318 public void newNode(long id, double lat, double lon, double depth) { 312 319 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; 320 } 321 322 public void newEdge(long id) { 323 edge = new Edge(); 324 edges.put(id, edge); 325 } 326 327 public void addConn(long id, int topi) { 328 if (topi == 1) { 329 edge.first = id; 330 } else { 331 edge.last = id; 332 } 317 333 } 318 334 319 335 public void addEdge(long id) { 320 336 feature = new Feature(); 321 feature. id= id;337 feature.refs = id; 322 338 feature.flag = Fflag.LINE; 323 339 edge = new Edge(); … … 337 353 public void addArea(long id) { 338 354 feature = new Feature(); 339 feature. id= id;355 feature.refs = id; 340 356 feature.flag = Fflag.AREA; 341 357 outers = new ArrayList<Long>(); … … 530 546 switch (feature.flag) { 531 547 case POINT: 532 return nodes.get(feature. id);548 return nodes.get(feature.refs); 533 549 case LINE: 534 Edge edge = edges.get(feature. id);550 Edge edge = edges.get(feature.refs); 535 551 EdgeIterator eit = new EdgeIterator(edge, true); 536 552 while (eit.hasNext()) { … … 567 583 return new Snode(llat + ((lat - llat) * harc / sarc), llon + ((lon - llon) * harc / sarc)); 568 584 case AREA: 569 Bound bound = areas.get(feature. id).get(0);585 Bound bound = areas.get(feature.refs).get(0); 570 586 BoundIterator bit = new BoundIterator(bound); 571 587 while (bit.hasNext()) {
Note:
See TracChangeset
for help on using the changeset viewer.
