Changeset 31731 in osm for applications/editors/josm/plugins/seachart/src/s57/S57map.java
- Timestamp:
- 2015-11-05T13:43:10+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/s57/S57map.java
r31722 r31731 47 47 public double lon; // Longitude in radians 48 48 public Nflag flg; // Role of node 49 public double val; // Optional value 49 50 50 51 public Snode() { … … 52 53 lat = 0; 53 54 lon = 0; 55 val = 0; 54 56 } 55 57 public Snode(double ilat, double ilon) { … … 57 59 lat = ilat; 58 60 lon = ilon; 61 val = 0; 59 62 } 60 63 public Snode(double ilat, double ilon, Nflag iflg) { … … 62 65 lon = ilon; 63 66 flg = iflg; 64 }65 }66 67 public class Dnode extends Snode { // All depth soundings68 public double val; // Sounding value69 70 public Dnode() {71 flg = Nflag.DPTH;72 lat = 0;73 lon = 0;74 67 val = 0; 75 68 } 76 public Dnode(double ilat, double ilon, double ival) {69 public Snode(double ilat, double ilon, double ival) { 77 70 flg = Nflag.DPTH; 78 71 lat = ilat; … … 81 74 } 82 75 } 83 76 84 77 public class Edge { // A polyline segment 85 78 public long first; // First CONN node … … 207 200 208 201 public class Feature { 202 public long id; // Ref for this feature 209 203 public Rflag reln; // Relationship status 210 204 public Geom geom; // Geometry data … … 215 209 216 210 Feature() { 211 id = 0; 217 212 reln = Rflag.UNKN; 218 213 geom = new Geom(Pflag.NOSP); … … 261 256 262 257 public void newNode(long id, double lat, double lon, double depth) { 263 nodes.put(id, new Dnode(Math.toRadians(lat), Math.toRadians(lon), depth));258 nodes.put(id, new Snode(Math.toRadians(lat), Math.toRadians(lon), depth)); 264 259 } 265 260 … … 271 266 if (obj == Obj.BOYWTW) 272 267 obj = Obj.BOYLAT; 273 if (obj == Obj.C_AGGR)274 feature.reln = Rflag.UNKN;275 268 feature.geom = new Geom(p); 276 269 feature.type = obj; 277 270 if (obj != Obj.UNKOBJ) { 278 271 index.put(id, feature); 272 feature.id = id; 279 273 } 280 274 } … … 378 372 nodes.put(id, node); 379 373 feature = new Feature(); 374 feature.id = id; 380 375 feature.reln = Rflag.UNKN; 381 376 feature.geom.prim = Pflag.POINT; … … 387 382 public void addEdge(long id) { 388 383 feature = new Feature(); 384 feature.id = id; 389 385 feature.reln = Rflag.UNKN; 390 386 feature.geom.prim = Pflag.LINE; … … 408 404 public void addArea(long id) { 409 405 feature = new Feature(); 406 feature.id = id; 410 407 feature.reln = Rflag.UNKN; 411 408 feature.geom.prim = Pflag.AREA; … … 445 442 } 446 443 AttVal<?> attval = S57val.convertValue(val, att); 447 if (attval.val != null) 444 if (attval.val != null) { 445 if (att == Att.VALSOU) { 446 Snode node = nodes.get(feature.geom.elems.get(0).id); 447 node.val = (double) attval.val; 448 } 448 449 atts.put(att, attval); 450 } 449 451 } else { 450 452 if (subkeys[1].equals("type")) { … … 461 463 objs.put(0, atts); 462 464 } 465 if ((obj == Obj.SOUNDG) && (feature.geom.prim == Pflag.POINT)) { 466 Snode node = nodes.get(feature.geom.elems.get(0).id); 467 node.flg = Nflag.DPTH; 468 } 463 469 } else { 464 470 Att att = S57att.enumAttribute(subkeys[1], Obj.UNKOBJ); … … 485 491 case POINT: 486 492 Snode node = nodes.get(id); 487 if (node.flg != Nflag.CONN) { 493 if ((node.flg != Nflag.CONN) && (node.flg != Nflag.DPTH) && (!feature.objs.isEmpty())) { 488 494 node.flg = Nflag.ISOL; 489 495 }
Note:
See TracChangeset
for help on using the changeset viewer.
