Changeset 32380 in osm for applications/editors/josm/plugins/seachart/src/s57
- Timestamp:
- 2016-06-23T14:17:55+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/seachart/src/s57
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/s57/S57dat.java
r31846 r32380 224 224 } else { 225 225 int f = Math.abs(conv.bin); 226 if (f < 8) {226 if (f < 5) { 227 227 long val = buffer[offset + --f]; 228 228 if (conv.bin > 0) … … 253 253 return val; 254 254 } else { 255 f /= 8; 256 long val = 0; 257 for (int i = 0; i < f; i++) { 255 if (f == 5) { 256 long val = buffer[offset++] & 0xff; 257 f--; 258 while (f > 0) { 259 val = (val << 8) + (buffer[offset + --f] & 0xff); 260 } 261 offset += 4; 262 return val; 263 } else { 264 long val = buffer[offset++] & 0xff; 258 265 val = (val << 8) + (buffer[offset++] & 0xff); 259 } 260 return val; 266 f = 4; 267 while (f > 0) { 268 val = (val << 8) + (buffer[offset + --f] & 0xff); 269 } 270 offset += 4; 271 f = 2; 272 while (f > 0) { 273 val = (val << 8) + (buffer[offset + --f] & 0xff); 274 } 275 offset += 2; 276 return val; 277 } 261 278 } 262 279 } -
applications/editors/josm/plugins/seachart/src/s57/S57dec.java
r31722 r32380 21 21 S57dat.rnum = 0; 22 22 byte[] leader = new byte[24]; 23 byte[] record = new byte[0]; 23 24 boolean ddr = false; 24 25 int length = 0; … … 40 41 try { 41 42 length = Integer.parseInt(new String(leader, 0, 5)) - 24; 43 record = new byte[length]; 42 44 ddr = (leader[6] == 'L'); 43 45 fields = Integer.parseInt(new String(leader, 12, 5)) - 24; … … 50 52 mapts = leader[23] - '0'; 51 53 entry = mapfl + mapfp + mapts; 52 byte[] record = new byte[length];53 54 if (in.read(record) != length) 54 55 break; … … 61 62 case "0001": 62 63 int i8rn = ((Long) S57dat.decSubf(record, fields + pos, S57field.I8RI, S57subf.I8RN)).intValue(); 63 if (i8rn != ++S57dat.rnum) { 64 System.err.println("Out of order record ID"); 65 in.close(); 66 System.exit(-1); 67 } 64 // if (i8rn != ++S57dat.rnum) { 65 // System.err.println("Out of order record ID"); 66 // in.close(); 67 // System.exit(-1); 68 // } 68 69 break; 69 70 case "DSSI": … … 93 94 break; 94 95 case "FOID": 95 name = ( Long) S57dat.decSubf(record, fields + pos, S57field.LNAM, S57subf.LNAM);96 name = (long) S57dat.decSubf(record, fields + pos, S57field.LNAM, S57subf.LNAM); 96 97 map.newFeature(name, pflag, objl); 97 98 break; … … 109 110 S57dat.setField(record, fields + pos, S57field.FFPT, len); 110 111 do { 111 name = ( Long) S57dat.decSubf(S57subf.LNAM);112 name = (long) S57dat.decSubf(S57subf.LNAM); 112 113 int rind = ((Long) S57dat.decSubf(S57subf.RIND)).intValue(); 113 114 S57dat.decSubf(S57subf.COMT); 114 map. newObj(name, rind);115 map.refObj(name, rind); 115 116 } while (S57dat.more()); 116 117 break; … … 118 119 S57dat.setField(record, fields + pos, S57field.FSPT, len); 119 120 do { 120 name = ( Long) S57dat.decSubf(S57subf.NAME) << 16;121 name = (long) S57dat.decSubf(S57subf.NAME) << 16; 121 122 map.newPrim(name, (Long) S57dat.decSubf(S57subf.ORNT), (Long) S57dat.decSubf(S57subf.USAG)); 122 123 S57dat.decSubf(S57subf.MASK); … … 138 139 } 139 140 name <<= 32; 140 name += ( Long) S57dat.decSubf(S57subf.RCID);141 name += (long) S57dat.decSubf(S57subf.RCID); 141 142 name <<= 16; 142 143 if (nflag == Nflag.ANON) { -
applications/editors/josm/plugins/seachart/src/s57/S57map.java
r32090 r32380 273 273 } 274 274 275 public void newObj(long id, int rind) {275 public void refObj(long id, int rind) { 276 276 Rflag r = Rflag.UNKN; 277 277 switch (rind) { -
applications/editors/josm/plugins/seachart/src/s57/S57val.java
r32101 r32380 812 812 Catnmk.put(CatNMK.NMK_WEIR, new S57enum(52, "weir")); Catnmk.put(CatNMK.NMK_FERN, new S57enum(53, "ferry_non_independent")); Catnmk.put(CatNMK.NMK_FERI, new S57enum(54, "ferry_independent")); 813 813 Catnmk.put(CatNMK.NMK_BRTP, new S57enum(55, "berthing_permitted")); Catnmk.put(CatNMK.NMK_BTLL, new S57enum(56, "berthing_lateral_limit")); Catnmk.put(CatNMK.NMK_BTLS, new S57enum(57, "berthing_lateral_limits")); 814 Catnmk.put(CatNMK.NMK_BTRL, new S57enum(58, "berth ing_rafting_limit")); Catnmk.put(CatNMK.NMK_BTUP, new S57enum(59, "berthing_unmarked_pushing"));814 Catnmk.put(CatNMK.NMK_BTRL, new S57enum(58, "berth_rafting_limit")); Catnmk.put(CatNMK.NMK_BTUP, new S57enum(59, "berthing_unmarked_pushing")); 815 815 Catnmk.put(CatNMK.NMK_BTP1, new S57enum(60, "berthing_marked_pushing_1")); Catnmk.put(CatNMK.NMK_BTP2, new S57enum(61, "berthing_marked_pushing_2")); 816 816 Catnmk.put(CatNMK.NMK_BTP3, new S57enum(62, "berthing_marked_pushing_3")); Catnmk.put(CatNMK.NMK_BTUN, new S57enum(63, "berthing_unmarked_non-pushing"));
Note:
See TracChangeset
for help on using the changeset viewer.