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

save

Location:
applications/editors/josm/plugins/smed2/src/seamap
Files:
1 edited
1 moved

Legend:

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

    r29157 r29172  
    1010package seamap;
    1111
     12import s57.S57obj.Obj;
     13import seamap.SeaMap.Feature;
     14
    1215public class Rules {
    1316
     17        public static void MainRules (SeaMap map) {
     18                for (Feature feature : map.features.get(Obj.SLCONS)) shoreline(feature);
     19                for (Feature feature : map.features.get(Obj.PIPSOL)) pipelines(feature);
     20                for (Feature feature : map.features.get(Obj.CBLSUB)) cables(feature);
     21                for (Feature feature : map.features.get(Obj.PIPOHD)) pipelines(feature);
     22                for (Feature feature : map.features.get(Obj.CBLOHD)) cables(feature);
     23                for (Feature feature : map.features.get(Obj.TSEZNE)) separation(feature);
     24                for (Feature feature : map.features.get(Obj.TSSCRS)) separation(feature);
     25                for (Feature feature : map.features.get(Obj.TSSRON)) separation(feature);
     26                for (Feature feature : map.features.get(Obj.TSELNE)) separation(feature);
     27                for (Feature feature : map.features.get(Obj.TSSLPT)) separation(feature);
     28                for (Feature feature : map.features.get(Obj.TSSBND)) separation(feature);
     29                for (Feature feature : map.features.get(Obj.SNDWAV)) areas(feature);
     30                for (Feature feature : map.features.get(Obj.OSPARE)) areas(feature);
     31                for (Feature feature : map.features.get(Obj.FAIRWY)) areas(feature);
     32                for (Feature feature : map.features.get(Obj.DRGARE)) areas(feature);
     33                for (Feature feature : map.features.get(Obj.RESARE)) areas(feature);
     34                for (Feature feature : map.features.get(Obj.SPLARE)) areas(feature);
     35                for (Feature feature : map.features.get(Obj.SEAARE)) areas(feature);
     36                for (Feature feature : map.features.get(Obj.OBSTRN)) obstructions(feature);
     37                for (Feature feature : map.features.get(Obj.UWTROC)) obstructions(feature);
     38                for (Feature feature : map.features.get(Obj.MARCUL)) areas(feature);
     39                for (Feature feature : map.features.get(Obj.WTWAXS)) waterways(feature);
     40                for (Feature feature : map.features.get(Obj.RECTRC)) transits(feature);
     41                for (Feature feature : map.features.get(Obj.NAVLNE)) transits(feature);
     42                for (Feature feature : map.features.get(Obj.HRBFAC)) harbours(feature);
     43                for (Feature feature : map.features.get(Obj.ACHARE)) harbours(feature);
     44                for (Feature feature : map.features.get(Obj.ACHBRT)) harbours(feature);
     45                for (Feature feature : map.features.get(Obj.LOKBSN)) locks(feature);
     46                for (Feature feature : map.features.get(Obj.LKBSPT)) locks(feature);
     47                for (Feature feature : map.features.get(Obj.GATCON)) locks(feature);
     48                for (Feature feature : map.features.get(Obj.DISMAR)) distances(feature);
     49                for (Feature feature : map.features.get(Obj.HULKES)) ports(feature);
     50                for (Feature feature : map.features.get(Obj.CRANES)) ports(feature);
     51                for (Feature feature : map.features.get(Obj.LNDMRK)) landmarks(feature);
     52                for (Feature feature : map.features.get(Obj.MORFAC)) moorings(feature);
     53                for (Feature feature : map.features.get(Obj.NOTMRK)) notices(feature);
     54                for (Feature feature : map.features.get(Obj.SMCFAC)) marinas(feature);
     55                for (Feature feature : map.features.get(Obj.BRIDGE)) bridges(feature);
     56                for (Feature feature : map.features.get(Obj.LITMAJ)) lights(feature);
     57                for (Feature feature : map.features.get(Obj.LITMIN)) lights(feature);
     58                for (Feature feature : map.features.get(Obj.LIGHTS)) lights(feature);
     59                for (Feature feature : map.features.get(Obj.SISTAT)) signals(feature);
     60                for (Feature feature : map.features.get(Obj.SISTAW)) signals(feature);
     61                for (Feature feature : map.features.get(Obj.CGUSTA)) signals(feature);
     62                for (Feature feature : map.features.get(Obj.RDOSTA)) signals(feature);
     63                for (Feature feature : map.features.get(Obj.RADSTA)) signals(feature);
     64                for (Feature feature : map.features.get(Obj.RSCSTA)) signals(feature);
     65                for (Feature feature : map.features.get(Obj.PILBOP)) signals(feature);
     66                for (Feature feature : map.features.get(Obj.WTWGAG)) gauges(feature);
     67                for (Feature feature : map.features.get(Obj.OFSPLF)) platforms(feature);
     68                for (Feature feature : map.features.get(Obj.WRECKS)) wrecks(feature);
     69                for (Feature feature : map.features.get(Obj.LITVES)) floats(feature);
     70                for (Feature feature : map.features.get(Obj.LITFLT)) floats(feature);
     71                for (Feature feature : map.features.get(Obj.BOYINB)) floats(feature);
     72                for (Feature feature : map.features.get(Obj.BOYLAT)) buoys(feature);
     73                for (Feature feature : map.features.get(Obj.BOYCAR)) buoys(feature);
     74                for (Feature feature : map.features.get(Obj.BOYISD)) buoys(feature);
     75                for (Feature feature : map.features.get(Obj.BOYSAW)) buoys(feature);
     76                for (Feature feature : map.features.get(Obj.BOYSPP)) buoys(feature);
     77                for (Feature feature : map.features.get(Obj.BOYWTW)) buoys(feature);
     78                for (Feature feature : map.features.get(Obj.BCNLAT)) beacons(feature);
     79                for (Feature feature : map.features.get(Obj.BCNCAR)) beacons(feature);
     80                for (Feature feature : map.features.get(Obj.BCNISD)) beacons(feature);
     81                for (Feature feature : map.features.get(Obj.BCNSAW)) beacons(feature);
     82                for (Feature feature : map.features.get(Obj.BCNSPP)) beacons(feature);
     83                for (Feature feature : map.features.get(Obj.BCNWTW)) beacons(feature);
     84        }
     85       
     86        private static void shoreline(Feature feature) {}
     87        private static void pipelines(Feature feature) {}
     88        private static void cables(Feature feature) {}
     89        private static void separation(Feature feature) {}
     90        private static void areas(Feature feature) {}
     91        private static void obstructions(Feature feature) {}
     92        private static void waterways(Feature feature) {}
     93        private static void transits(Feature feature) {}
     94        private static void harbours(Feature feature) {}
     95        private static void locks(Feature feature) {}
     96        private static void distances(Feature feature) {}
     97        private static void ports(Feature feature) {}
     98        private static void landmarks(Feature feature) {}
     99        private static void moorings(Feature feature) {}
     100        private static void notices(Feature feature) {}
     101        private static void marinas(Feature feature) {}
     102        private static void bridges(Feature feature) {}
     103        private static void lights(Feature feature) {}
     104        private static void floats(Feature feature) {}
     105        private static void signals(Feature feature) {}
     106        private static void wrecks(Feature feature) {}
     107        private static void gauges(Feature feature) {}
     108        private static void platforms(Feature feature) {}
     109        private static void buoys(Feature feature) {}
     110        private static void beacons(Feature feature) {}
     111
    14112}
  • 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.