Ignore:
Timestamp:
2013-01-05T16:09:17+01:00 (12 years ago)
Author:
malcolmh
Message:

save

File:
1 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java

    r29156 r29172  
    2121import s57.S57val.*;
    2222
    23 public class Map {
     23public class SeaMap {
    2424
    2525        public enum Fflag {
     
    6666        public HashMap<Long, ArrayList<Long>> ways;
    6767        public HashMap<Long, ArrayList<Long>> mpolys;
    68         public HashMap<Long, Feature> features;
     68        public EnumMap<Obj, ArrayList<Feature>> features;
     69        public double minlat;
     70        public double minlon;
     71        public double maxlat;
     72        public double maxlon;
    6973
    7074        private Feature feature;
    7175        private ArrayList<Long> list;
    7276
    73         public Map() {
     77        public SeaMap() {
    7478                nodes = new HashMap<Long, Coord>();
    7579                ways = new HashMap<Long, ArrayList<Long>>();
    7680                mpolys = new HashMap<Long, ArrayList<Long>>();
    7781                feature = new Feature();
    78                 features = new HashMap<Long, Feature>();
     82                features = new EnumMap<Obj, ArrayList<Feature>>(Obj.class);
    7983        }
    8084
     
    115119                                feature.flag = Fflag.AREA;
    116120                        }
    117                         features.put(feature.refs, feature);
     121                        if (features.get(feature.type) == null) {
     122                                features.put(feature.type, new ArrayList<Feature>());
     123                        }
     124                        features.get(feature.type).add(feature);
    118125                }
    119126        }
     
    144151                                }
    145152                                AttVal attval = S57val.convertValue(val, att);
    146                                 atts.put(att, new AttItem(attval.conv, attval.val));
     153                                if (attval.val != null) atts.put(att, new AttItem(attval.conv, attval.val));
    147154                        } else {
    148155                                if (subkeys[1].equals("type")) {
     
    152159                                        if (att != Att.UNKATT) {
    153160                                                AttVal attval = S57val.convertValue(val, att);
    154                                                 feature.atts.put(att, new AttItem(attval.conv, attval.val));
     161                                                if (attval.val != null) feature.atts.put(att, new AttItem(attval.conv, attval.val));
    155162                                        }
    156163                                }
Note: See TracChangeset for help on using the changeset viewer.