Ignore:
Timestamp:
2016-06-23T14:17:55+02:00 (10 years ago)
Author:
malcolmh
Message:

updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/src/s57/S57dec.java

    r31722 r32380  
    2121                S57dat.rnum = 0;
    2222                byte[] leader = new byte[24];
     23                byte[] record = new byte[0];
    2324                boolean ddr = false;
    2425                int length = 0;
     
    4041                        try {
    4142                        length = Integer.parseInt(new String(leader, 0, 5)) - 24;
     43                        record = new byte[length];
    4244                        ddr = (leader[6] == 'L');
    4345                        fields = Integer.parseInt(new String(leader, 12, 5)) - 24;
     
    5052                        mapts = leader[23] - '0';
    5153                        entry = mapfl + mapfp + mapts;
    52                         byte[] record = new byte[length];
    5354                        if (in.read(record) != length)
    5455                                break;
     
    6162                                        case "0001":
    6263                                                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//                                              }
    6869                                                break;
    6970                                        case "DSSI":
     
    9394                                                break;
    9495                                        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);
    9697                                                map.newFeature(name, pflag, objl);
    9798                                                break;
     
    109110                                                S57dat.setField(record, fields + pos, S57field.FFPT, len);
    110111                                                do {
    111                                                         name = (Long) S57dat.decSubf(S57subf.LNAM);
     112                                                        name = (long) S57dat.decSubf(S57subf.LNAM);
    112113                                                        int rind = ((Long) S57dat.decSubf(S57subf.RIND)).intValue();
    113114                                                        S57dat.decSubf(S57subf.COMT);
    114                                                         map.newObj(name, rind);
     115                                                        map.refObj(name, rind);
    115116                                                } while (S57dat.more());
    116117                                                break;
     
    118119                                                S57dat.setField(record, fields + pos, S57field.FSPT, len);
    119120                                                do {
    120                                                         name = (Long) S57dat.decSubf(S57subf.NAME) << 16;
     121                                                        name = (long) S57dat.decSubf(S57subf.NAME) << 16;
    121122                                                        map.newPrim(name, (Long) S57dat.decSubf(S57subf.ORNT), (Long) S57dat.decSubf(S57subf.USAG));
    122123                                                        S57dat.decSubf(S57subf.MASK);
     
    138139                                                }
    139140                                                name <<= 32;
    140                                                 name += (Long) S57dat.decSubf(S57subf.RCID);
     141                                                name += (long) S57dat.decSubf(S57subf.RCID);
    141142                                                name <<= 16;
    142143                                                if (nflag == Nflag.ANON) {
Note: See TracChangeset for help on using the changeset viewer.