Ignore:
Timestamp:
2015-02-19T21:52:40+01:00 (10 years ago)
Author:
malcolmh
Message:

add base map rendering

Location:
applications/editors/josm/plugins/seachart
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/jrender/src/jrender/Jrender.java

    r30894 r31027  
    3333import render.ChartContext;
    3434import render.Renderer;
     35import render.Rules;
    3536import s57.S57map;
    3637import s57.S57map.Feature;
     
    154155                                        }
    155156                                } else if (ln.contains("</osm")) {
     157                                        map.mapDone();
    156158                                        inOsm = false;
    157159                                        break;
     
    167169                                                                type = (token.split("[\"\']")[1]);
    168170                                                        } else if (token.matches("^role=.+")) {
    169                                                                 role = (token.split("[\"\']")[1]);
     171                                                                String str[] = token.split("[\"\']");
     172                                                                if (str.length > 1) {
     173                                                                        role = (token.split("[\"\']")[1]);
     174                                                                }
    170175                                                        }
    171176                                                }
     
    193198                                inOsm = true;
    194199                                map = new S57map();
     200                                map.addNode(1, maxlat, minlon);
     201                                map.addNode(2, minlat, minlon);
     202                                map.addNode(3, minlat, maxlon);
     203                                map.addNode(4, maxlat, maxlon);
     204                                map.bounds.minlat = Math.toRadians(minlat);
     205                                map.bounds.maxlat = Math.toRadians(maxlat);
     206                                map.bounds.minlon = Math.toRadians(minlon);
     207                                map.bounds.maxlon = Math.toRadians(maxlon);
    195208                        }
    196209                }
    197210               
    198                 img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
     211/*              img = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
    199212                Renderer.reRender(img.createGraphics(), 12, 1, map, context);
    200213                ByteArrayOutputStream bos = new ByteArrayOutputStream();
     
    202215                empty = bos.size();
    203216                tile(zoom, 1, 0, 0);
    204 
    205                 for (int z = 12; z <= 18; z++) {
     217*/
     218//              for (int z = 12; z <= 18; z++) {
     219int z = 9;
    206220                        DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
    207221                        Document document = domImpl.createDocument("http://www.w3.org/2000/svg", "svg", null);
    208222                        SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
    209                         svgGenerator.setSVGCanvasSize(new Dimension(256, 256));
    210                         svgGenerator.setClip(0, 0, 256, 256);
    211                         svgGenerator.translate(-256, -256);
    212                         Renderer.reRender(svgGenerator, z, 1, map, context);
     223                        svgGenerator.setBackground(Rules.Bwater);
     224                        svgGenerator.clearRect(0, 0, 2048, 2048);
     225                        svgGenerator.setSVGCanvasSize(new Dimension(2048, 2048));
     226                        svgGenerator.setClip(0, 0, 2048, 2048);
     227//                      svgGenerator.translate(-2048, -2048);
     228                        Renderer.reRender(svgGenerator, z, 0.05, map, context);
    213229                        svgGenerator.stream(dstdir + "tst_" + z + ".svg");
    214                 }
     230//              }
    215231        }
    216232       
     
    281297                send = new ArrayList<String>();
    282298                deletes = new HashMap<String, Boolean>();
    283                 BufferedReader in = new BufferedReader(new FileReader(srcdir + xtile + "-" + ytile + "-" + zoom + ".osm"));
     299                BufferedReader in = new BufferedReader(new FileReader(srcdir + zoom + "-" + xtile + "-" + ytile + ".osm"));
    284300                String ln;
    285301                while ((ln = in.readLine()) != null) {
  • applications/editors/josm/plugins/seachart/src/render/Renderer.java

    r31014 r31027  
    1616import java.util.*;
    1717
     18import render.Rules.*;
    1819import s57.S57val.*;
    1920import s57.S57map;
     21import s57.S57obj.Obj;
    2022import s57.S57map.*;
    2123import symbols.Areas;
     
    4547                        g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
    4648                        g2.setStroke(new BasicStroke(0, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER));
    47                         Rules.rules();
     49                        Rules.rules(RuleSet.BASE);
    4850                }
    4951        }
     
    267269                        }
    268270                }
     271                if ((style.fill != null) && (feature.geom.prim == Pflag.AREA)) {
     272                        g2.setPaint(style.fill);
     273                        g2.fill(p);
     274                }
    269275                if (style.line != null) {
    270276                        if (style.dash != null) {
     
    276282                                g2.setStroke(new BasicStroke((float) (style.width * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1, dash, 0));
    277283                        } else {
    278                                 g2.setStroke(new BasicStroke((float) (style.width * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND));
     284                                g2.setStroke(new BasicStroke((float) (style.width * sScale), BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
    279285                        }
    280286                        g2.setPaint(style.line);
    281287                        g2.draw(p);
    282                 }
    283                 if (style.fill != null) {
    284                         g2.setPaint(style.fill);
    285                         g2.fill(p);
    286288                }
    287289        }
  • applications/editors/josm/plugins/seachart/src/render/Rules.java

    r31014 r31027  
    2727
    2828public class Rules {
     29       
     30        public enum RuleSet { ALL, BASE, SEAMARK }
    2931
    3032        public static final Color Yland = new Color(0xdcb820);
     
    6567        }
    6668       
    67         static String getName(Feature feature) {
     69        static String getName() {
    6870                AttVal<?> name = feature.atts.get(Att.OBJNAM);
    6971                if (name == null) {
     
    8789        public static void addName(Feature feature, int z, Font font, Color colour, Delta delta) {
    8890                if (Renderer.zoom >= z) {
    89                         String name = getName(feature);
     91                        String name = getName();
    9092                        if (name != null) {
    9193                                Renderer.labelText(feature, name, font,  colour, delta);
     
    175177        }
    176178       
    177         public static void rules () {
    178                 ArrayList<Feature> objects;
    179                 if ((objects = Renderer.map.features.get(Obj.LNDARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    180                 if ((objects = Renderer.map.features.get(Obj.LAKARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    181                 if ((objects = Renderer.map.features.get(Obj.RIVBNK)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    182                 if ((objects = Renderer.map.features.get(Obj.RIVERS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) waterways(feature);
    183                 if ((objects = Renderer.map.features.get(Obj.CANALS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) waterways(feature);
    184                 if ((objects = Renderer.map.features.get(Obj.DOCARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    185                 if ((objects = Renderer.map.features.get(Obj.DEPARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    186                 if ((objects = Renderer.map.features.get(Obj.COALNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    187                 if ((objects = Renderer.map.features.get(Obj.SLCONS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) shoreline(feature);
    188                 if ((objects = Renderer.map.features.get(Obj.PIPSOL)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) pipelines(feature);
    189                 if ((objects = Renderer.map.features.get(Obj.CBLSUB)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) cables(feature);
    190                 if ((objects = Renderer.map.features.get(Obj.PIPOHD)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) pipelines(feature);
    191                 if ((objects = Renderer.map.features.get(Obj.CBLOHD)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) cables(feature);
    192                 if ((objects = Renderer.map.features.get(Obj.TSEZNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
    193                 if ((objects = Renderer.map.features.get(Obj.TSSCRS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
    194                 if ((objects = Renderer.map.features.get(Obj.TSSRON)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
    195                 if ((objects = Renderer.map.features.get(Obj.TSELNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
    196                 if ((objects = Renderer.map.features.get(Obj.TSSLPT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
    197                 if ((objects = Renderer.map.features.get(Obj.TSSBND)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
    198                 if ((objects = Renderer.map.features.get(Obj.ISTZNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) separation(feature);
    199                 if ((objects = Renderer.map.features.get(Obj.SNDWAV)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    200                 if ((objects = Renderer.map.features.get(Obj.OSPARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    201                 if ((objects = Renderer.map.features.get(Obj.FAIRWY)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    202                 if ((objects = Renderer.map.features.get(Obj.DRGARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    203                 if ((objects = Renderer.map.features.get(Obj.RESARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    204                 if ((objects = Renderer.map.features.get(Obj.SPLARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    205                 if ((objects = Renderer.map.features.get(Obj.SEAARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    206                 if ((objects = Renderer.map.features.get(Obj.OBSTRN)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) obstructions(feature);
    207                 if ((objects = Renderer.map.features.get(Obj.UWTROC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) obstructions(feature);
    208                 if ((objects = Renderer.map.features.get(Obj.MARCUL)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) areas(feature);
    209                 if ((objects = Renderer.map.features.get(Obj.RECTRC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) transits(feature);
    210                 if ((objects = Renderer.map.features.get(Obj.NAVLNE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) transits(feature);
    211                 if ((objects = Renderer.map.features.get(Obj.HRBFAC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) harbours(feature);
    212                 if ((objects = Renderer.map.features.get(Obj.ACHARE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) harbours(feature);
    213                 if ((objects = Renderer.map.features.get(Obj.ACHBRT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) harbours(feature);
    214                 if ((objects = Renderer.map.features.get(Obj.BERTHS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) harbours(feature);
    215                 if ((objects = Renderer.map.features.get(Obj.LOKBSN)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) locks(feature);
    216                 if ((objects = Renderer.map.features.get(Obj.LKBSPT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) locks(feature);
    217                 if ((objects = Renderer.map.features.get(Obj.GATCON)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) locks(feature);
    218                 if ((objects = Renderer.map.features.get(Obj.DISMAR)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) distances(feature);
    219                 if ((objects = Renderer.map.features.get(Obj.HULKES)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) ports(feature);
    220                 if ((objects = Renderer.map.features.get(Obj.CRANES)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) ports(feature);
    221                 if ((objects = Renderer.map.features.get(Obj.LNDMRK)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) landmarks(feature);
    222                 if ((objects = Renderer.map.features.get(Obj.BUISGL)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) harbours(feature);
    223                 if ((objects = Renderer.map.features.get(Obj.MORFAC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) moorings(feature);
    224                 if ((objects = Renderer.map.features.get(Obj.NOTMRK)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) notices(feature);
    225                 if ((objects = Renderer.map.features.get(Obj.SMCFAC)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) marinas(feature);
    226                 if ((objects = Renderer.map.features.get(Obj.BRIDGE)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) bridges(feature);
    227                 if ((objects = Renderer.map.features.get(Obj.PILPNT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) lights(feature);
    228                 if ((objects = Renderer.map.features.get(Obj.RDOCAL)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) callpoint(feature);
    229                 if ((objects = Renderer.map.features.get(Obj.LITMIN)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) lights(feature);
    230                 if ((objects = Renderer.map.features.get(Obj.LITMAJ)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) lights(feature);
    231                 if ((objects = Renderer.map.features.get(Obj.LIGHTS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) lights(feature);
    232                 if ((objects = Renderer.map.features.get(Obj.SISTAT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
    233                 if ((objects = Renderer.map.features.get(Obj.SISTAW)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
    234                 if ((objects = Renderer.map.features.get(Obj.CGUSTA)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
    235                 if ((objects = Renderer.map.features.get(Obj.RDOSTA)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
    236                 if ((objects = Renderer.map.features.get(Obj.RADSTA)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
    237                 if ((objects = Renderer.map.features.get(Obj.RTPBCN)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
    238                 if ((objects = Renderer.map.features.get(Obj.RSCSTA)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
    239                 if ((objects = Renderer.map.features.get(Obj.PILBOP)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) stations(feature);
    240                 if ((objects = Renderer.map.features.get(Obj.WTWGAG)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) gauges(feature);
    241                 if ((objects = Renderer.map.features.get(Obj.OFSPLF)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) platforms(feature);
    242                 if ((objects = Renderer.map.features.get(Obj.WRECKS)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) wrecks(feature);
    243                 if ((objects = Renderer.map.features.get(Obj.LITVES)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) floats(feature);
    244                 if ((objects = Renderer.map.features.get(Obj.LITFLT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) floats(feature);
    245                 if ((objects = Renderer.map.features.get(Obj.BOYINB)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) floats(feature);
    246                 if ((objects = Renderer.map.features.get(Obj.BOYLAT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
    247                 if ((objects = Renderer.map.features.get(Obj.BOYCAR)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
    248                 if ((objects = Renderer.map.features.get(Obj.BOYISD)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
    249                 if ((objects = Renderer.map.features.get(Obj.BOYSAW)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
    250                 if ((objects = Renderer.map.features.get(Obj.BOYSPP)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
    251                 if ((objects = Renderer.map.features.get(Obj.BOYWTW)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) buoys(feature);
    252                 if ((objects = Renderer.map.features.get(Obj.BCNLAT)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
    253                 if ((objects = Renderer.map.features.get(Obj.BCNCAR)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
    254                 if ((objects = Renderer.map.features.get(Obj.BCNISD)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
    255                 if ((objects = Renderer.map.features.get(Obj.BCNSAW)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
    256                 if ((objects = Renderer.map.features.get(Obj.BCNSPP)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
    257                 if ((objects = Renderer.map.features.get(Obj.BCNWTW)) != null) for (Feature feature : objects) if (feature.reln == Rflag.MASTER) beacons(feature);
    258         }
    259        
    260         private static void areas(Feature feature) {
    261                 String name = getName(feature);
     179        static Feature feature;
     180        static ArrayList<Feature> objects;
     181        static RuleSet ruleset;
     182        static boolean testObject(Obj obj) {
     183                return ((objects = Renderer.map.features.get(obj)) != null);
     184        }
     185       
     186        static boolean testFeature(Feature f) {
     187                return ((feature = f).reln == Rflag.MASTER);
     188        }
     189       
     190        public static void rules (RuleSet set) {
     191                ruleset = set;
     192                if ((set == RuleSet.ALL) || (set == RuleSet.BASE)) {
     193                        if (testObject(Obj.LNDARE)) for (Feature f : objects) if (testFeature(f)) areas();
     194                        if (testObject(Obj.BUAARE)) for (Feature f : objects) if (testFeature(f)) areas();
     195                        if (testObject(Obj.HRBFAC)) for (Feature f : objects) if (testFeature(f)) areas();
     196                        if (testObject(Obj.HRBBSN)) for (Feature f : objects) if (testFeature(f)) areas();
     197                        if (testObject(Obj.LOKBSN)) for (Feature f : objects) if (testFeature(f)) areas();
     198                        if (testObject(Obj.LKBSPT)) for (Feature f : objects) if (testFeature(f)) areas();
     199                        if (testObject(Obj.LAKARE)) for (Feature f : objects) if (testFeature(f)) areas();
     200                        if (testObject(Obj.RIVBNK)) for (Feature f : objects) if (testFeature(f)) areas();
     201                        if (testObject(Obj.RIVERS)) for (Feature f : objects) if (testFeature(f)) waterways();
     202                        if (testObject(Obj.CANALS)) for (Feature f : objects) if (testFeature(f)) waterways();
     203                        if (testObject(Obj.DEPARE)) for (Feature f : objects) if (testFeature(f)) areas();
     204                        if (testObject(Obj.COALNE)) for (Feature f : objects) if (testFeature(f)) areas();
     205                        if (testObject(Obj.ROADWY)) for (Feature f : objects) if (testFeature(f)) highways();
     206                        if (testObject(Obj.RAILWY)) for (Feature f : objects) if (testFeature(f)) highways();
     207                }
     208                if (testObject(Obj.SLCONS)) for (Feature f : objects) if (testFeature(f)) shoreline();
     209                if ((set == RuleSet.ALL) || (set == RuleSet.SEAMARK)) {
     210                        if (testObject(Obj.PIPSOL)) for (Feature f : objects) if (testFeature(f)) pipelines();
     211                        if (testObject(Obj.CBLSUB)) for (Feature f : objects) if (testFeature(f)) cables();
     212                        if (testObject(Obj.PIPOHD)) for (Feature f : objects) if (testFeature(f)) pipelines();
     213                        if (testObject(Obj.CBLOHD)) for (Feature f : objects) if (testFeature(f)) cables();
     214                        if (testObject(Obj.TSEZNE)) for (Feature f : objects) if (testFeature(f)) separation();
     215                        if (testObject(Obj.TSSCRS)) for (Feature f : objects) if (testFeature(f)) separation();
     216                        if (testObject(Obj.TSSRON)) for (Feature f : objects) if (testFeature(f)) separation();
     217                        if (testObject(Obj.TSELNE)) for (Feature f : objects) if (testFeature(f)) separation();
     218                        if (testObject(Obj.TSSLPT)) for (Feature f : objects) if (testFeature(f)) separation();
     219                        if (testObject(Obj.TSSBND)) for (Feature f : objects) if (testFeature(f)) separation();
     220                        if (testObject(Obj.ISTZNE)) for (Feature f : objects) if (testFeature(f)) separation();
     221                        if (testObject(Obj.SNDWAV)) for (Feature f : objects) if (testFeature(f)) areas();
     222                        if (testObject(Obj.OSPARE)) for (Feature f : objects) if (testFeature(f)) areas();
     223                        if (testObject(Obj.FAIRWY)) for (Feature f : objects) if (testFeature(f)) areas();
     224                        if (testObject(Obj.DRGARE)) for (Feature f : objects) if (testFeature(f)) areas();
     225                        if (testObject(Obj.RESARE)) for (Feature f : objects) if (testFeature(f)) areas();
     226                        if (testObject(Obj.SPLARE)) for (Feature f : objects) if (testFeature(f)) areas();
     227                        if (testObject(Obj.SEAARE)) for (Feature f : objects) if (testFeature(f)) areas();
     228                        if (testObject(Obj.OBSTRN)) for (Feature f : objects) if (testFeature(f)) obstructions();
     229                        if (testObject(Obj.UWTROC)) for (Feature f : objects) if (testFeature(f)) obstructions();
     230                        if (testObject(Obj.MARCUL)) for (Feature f : objects) if (testFeature(f)) areas();
     231                        if (testObject(Obj.RECTRC)) for (Feature f : objects) if (testFeature(f)) transits();
     232                        if (testObject(Obj.NAVLNE)) for (Feature f : objects) if (testFeature(f)) transits();
     233                        if (testObject(Obj.HRBFAC)) for (Feature f : objects) if (testFeature(f)) harbours();
     234                        if (testObject(Obj.ACHARE)) for (Feature f : objects) if (testFeature(f)) harbours();
     235                        if (testObject(Obj.ACHBRT)) for (Feature f : objects) if (testFeature(f)) harbours();
     236                        if (testObject(Obj.BERTHS)) for (Feature f : objects) if (testFeature(f)) harbours();
     237                        if (testObject(Obj.DISMAR)) for (Feature f : objects) if (testFeature(f)) distances();
     238                        if (testObject(Obj.HULKES)) for (Feature f : objects) if (testFeature(f)) ports();
     239                        if (testObject(Obj.CRANES)) for (Feature f : objects) if (testFeature(f)) ports();
     240                        if (testObject(Obj.LNDMRK)) for (Feature f : objects) if (testFeature(f)) landmarks();
     241                        if (testObject(Obj.BUISGL)) for (Feature f : objects) if (testFeature(f)) harbours();
     242                        if (testObject(Obj.MORFAC)) for (Feature f : objects) if (testFeature(f)) moorings();
     243                        if (testObject(Obj.NOTMRK)) for (Feature f : objects) if (testFeature(f)) notices();
     244                        if (testObject(Obj.SMCFAC)) for (Feature f : objects) if (testFeature(f)) marinas();
     245                        if (testObject(Obj.BRIDGE)) for (Feature f : objects) if (testFeature(f)) bridges();
     246                        if (testObject(Obj.PILPNT)) for (Feature f : objects) if (testFeature(f)) lights();
     247                        if (testObject(Obj.RDOCAL)) for (Feature f : objects) if (testFeature(f)) callpoint();
     248                        if (testObject(Obj.LITMIN)) for (Feature f : objects) if (testFeature(f)) lights();
     249                        if (testObject(Obj.LITMAJ)) for (Feature f : objects) if (testFeature(f)) lights();
     250                        if (testObject(Obj.LIGHTS)) for (Feature f : objects) if (testFeature(f)) lights();
     251                        if (testObject(Obj.SISTAT)) for (Feature f : objects) if (testFeature(f)) stations();
     252                        if (testObject(Obj.SISTAW)) for (Feature f : objects) if (testFeature(f)) stations();
     253                        if (testObject(Obj.CGUSTA)) for (Feature f : objects) if (testFeature(f)) stations();
     254                        if (testObject(Obj.RDOSTA)) for (Feature f : objects) if (testFeature(f)) stations();
     255                        if (testObject(Obj.RADSTA)) for (Feature f : objects) if (testFeature(f)) stations();
     256                        if (testObject(Obj.RTPBCN)) for (Feature f : objects) if (testFeature(f)) stations();
     257                        if (testObject(Obj.RSCSTA)) for (Feature f : objects) if (testFeature(f)) stations();
     258                        if (testObject(Obj.PILBOP)) for (Feature f : objects) if (testFeature(f)) stations();
     259                        if (testObject(Obj.WTWGAG)) for (Feature f : objects) if (testFeature(f)) gauges();
     260                        if (testObject(Obj.OFSPLF)) for (Feature f : objects) if (testFeature(f)) platforms();
     261                        if (testObject(Obj.WRECKS)) for (Feature f : objects) if (testFeature(f)) wrecks();
     262                        if (testObject(Obj.LITVES)) for (Feature f : objects) if (testFeature(f)) floats();
     263                        if (testObject(Obj.LITFLT)) for (Feature f : objects) if (testFeature(f)) floats();
     264                        if (testObject(Obj.BOYINB)) for (Feature f : objects) if (testFeature(f)) floats();
     265                        if (testObject(Obj.BOYLAT)) for (Feature f : objects) if (testFeature(f)) buoys();
     266                        if (testObject(Obj.BOYCAR)) for (Feature f : objects) if (testFeature(f)) buoys();
     267                        if (testObject(Obj.BOYISD)) for (Feature f : objects) if (testFeature(f)) buoys();
     268                        if (testObject(Obj.BOYSAW)) for (Feature f : objects) if (testFeature(f)) buoys();
     269                        if (testObject(Obj.BOYSPP)) for (Feature f : objects) if (testFeature(f)) buoys();
     270                        if (testObject(Obj.BOYWTW)) for (Feature f : objects) if (testFeature(f)) buoys();
     271                        if (testObject(Obj.BCNLAT)) for (Feature f : objects) if (testFeature(f)) beacons();
     272                        if (testObject(Obj.BCNCAR)) for (Feature f : objects) if (testFeature(f)) beacons();
     273                        if (testObject(Obj.BCNISD)) for (Feature f : objects) if (testFeature(f)) beacons();
     274                        if (testObject(Obj.BCNSAW)) for (Feature f : objects) if (testFeature(f)) beacons();
     275                        if (testObject(Obj.BCNSPP)) for (Feature f : objects) if (testFeature(f)) beacons();
     276                        if (testObject(Obj.BCNWTW)) for (Feature f : objects) if (testFeature(f)) beacons();
     277                }
     278        }
     279       
     280        private static void areas() {
     281                String name = getName();
    262282                switch (feature.type) {
     283                case BUAARE:
     284                        Renderer.lineVector(feature, new LineStyle(new Color(0x40000000, true)));
     285                        break;
    263286                case COALNE:
    264287                        Renderer.lineVector(feature, new LineStyle(Color.black, 10));
     
    270293                        }
    271294                        break;
    272                 case DOCARE:
    273295                case LAKARE:
    274296                case RIVBNK:
    275                         Renderer.lineVector(feature, new LineStyle(Bwater));
     297                        Renderer.lineVector(feature, new LineStyle(Bwater, 10, Bwater));
    276298                        break;
    277299                case DRGARE:
     
    291313                                if (Renderer.zoom >= 14)
    292314                                        Renderer.lineVector(feature, new LineStyle(new Color(0x40ffffff, true)));
     315                        }
     316                        break;
     317                case LKBSPT:
     318                case LOKBSN:
     319                case HRBBSN:
     320                        Renderer.lineVector(feature, new LineStyle(Color.black, 10, Bwater));
     321                        break;
     322                case HRBFAC:
     323                        if (feature.objs.get(Obj.HRBBSN) != null) {
     324                                Renderer.lineVector(feature, new LineStyle(Color.black, 10, Bwater));
    293325                        }
    294326                        break;
     
    384416        }
    385417       
    386         private static void beacons(Feature feature) {
     418        private static void beacons() {
    387419                if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR)))) {
    388420                        BcnSHP shape = (BcnSHP)getAttEnum(feature, feature.type, 0, Att.BCNSHP);
     
    427459        }
    428460       
    429         private static void buoys(Feature feature) {
     461        private static void buoys() {
    430462                if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BOYLAT) || (feature.type == Obj.BOYCAR)))) {
    431463                        BoySHP shape = (BoySHP) getAttEnum(feature, feature.type, 0, Att.BOYSHP);
     
    451483        }
    452484       
    453         private static void bridges(Feature feature) {
     485        private static void bridges() {
    454486                if (Renderer.zoom >= 16) {
    455487                        double verclr, verccl, vercop, horclr;
     
    490522        }
    491523       
    492         private static void cables(Feature feature) {
     524        private static void cables() {
    493525                if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
    494526                        if (feature.type == Obj.CBLSUB) {
     
    512544        }
    513545       
    514         private static void callpoint(Feature feature) {
     546        private static void callpoint() {
    515547                if (Renderer.zoom >= 14) {
    516548                        Symbol symb = Harbours.CallPoint2;
     
    531563        }
    532564       
    533         private static void distances(Feature feature) {
     565        private static void distances() {
    534566                if (Renderer.zoom >= 14) {
    535567                        if (!testAttribute(feature, Obj.DISMAR, 0, Att.CATDIS, CatDIS.DIS_NONI)) {
     
    574606        }
    575607       
    576         private static void floats(Feature feature) {
     608        private static void floats() {
    577609                switch (feature.type) {
    578610                case LITVES:
     
    593625        }
    594626       
    595         private static void gauges(Feature feature) {
     627        private static void gauges() {
    596628                if (Renderer.zoom >= 14) {
    597629                        Renderer.symbol(feature, Harbours.TideGauge);
     
    600632        }
    601633       
    602         private static void harbours(Feature feature) {
    603                 String name = getName(feature);
     634        private static void harbours() {
     635                String name = getName();
    604636                switch (feature.type) {
    605637                case ACHBRT:
     
    717749        }
    718750       
    719         private static void landmarks(Feature feature) {
     751        private static void highways() {
     752                switch (feature.type) {
     753                case ROADWY:
     754                        ArrayList<CatROD> cat = (ArrayList<CatROD>) (getAttList(feature, Obj.ROADWY, 0, Att.CATROD));
     755                        if (cat.size() > 0) {
     756                                switch (cat.get(0)) {
     757                                case ROD_MWAY:
     758                                        Renderer.lineVector(feature, new LineStyle(Color.black, 20));
     759                                        break;
     760                                case ROD_MAJR:
     761                                        Renderer.lineVector(feature, new LineStyle(Color.black, 15));
     762                                        break;
     763                                case ROD_MINR:
     764                                        Renderer.lineVector(feature, new LineStyle(Color.black, 10));
     765                                        break;
     766                                default:
     767                                        Renderer.lineVector(feature, new LineStyle(Color.black, 5));
     768                                }
     769                        } else {
     770                                Renderer.lineVector(feature, new LineStyle(Color.black, 5));
     771                        }
     772                        break;
     773                case RAILWY:
     774                        Renderer.lineVector(feature, new LineStyle(Color.gray, 10));
     775                        Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 30, 30 }));
     776                        break;
     777                default:
     778                }
     779        }
     780       
     781        private static void landmarks() {
    720782                ArrayList<CatLMK> cats = (ArrayList<CatLMK>) getAttList(feature, feature.type, 0, Att.CATLMK);
    721783                Symbol catSym = Landmarks.Shapes.get(cats.get(0));
     
    734796        }
    735797       
    736         private static void lights(Feature feature) {
     798        private static void lights() {
    737799                switch (feature.type) {
    738800                case LITMAJ:
     
    764826        }
    765827
    766         private static void locks(Feature feature) {
    767         }
    768 
    769         private static void marinas(Feature feature) {
     828        private static void marinas() {
    770829                if (Renderer.zoom >= 16) {
    771830                        ArrayList<Symbol> symbols = new ArrayList<Symbol>();
     
    778837        }
    779838       
    780         private static void moorings(Feature feature) {
     839        private static void moorings() {
    781840                switch ((CatMOR) getAttEnum(feature, feature.type, 0, Att.CATMOR)) {
    782841                case MOR_DLPN:
     
    804863        }
    805864
    806         private static void notices(Feature feature) {
     865        private static void notices() {
    807866                if (Renderer.zoom >= 14) {
    808867                        double dx = 0.0, dy = 0.0;
     
    871930        }
    872931
    873         private static void obstructions(Feature feature) {
     932        private static void obstructions() {
    874933                if ((Renderer.zoom >= 12) && (feature.type == Obj.OBSTRN)) {
    875934                        switch ((CatOBS) getAttEnum(feature, feature.type, 0, Att.CATOBS)) {
     
    899958        }
    900959
    901         private static void pipelines(Feature feature) {
     960        private static void pipelines() {
    902961                if ((Renderer.zoom >= 16) && (feature.geom.length < 2)) {
    903962                        if (feature.type == Obj.PIPSOL) {
     
    921980        }
    922981
    923         private static void platforms(Feature feature) {
     982        private static void platforms() {
    924983                ArrayList<CatOFP> cats = (ArrayList<CatOFP>) getAttList(feature, Obj.OFSPLF, 0, Att.CATOFP);
    925984                if ((CatOFP) cats.get(0) == CatOFP.OFP_FPSO)
     
    931990        }
    932991
    933         private static void ports(Feature feature) {
     992        private static void ports() {
    934993                if (Renderer.zoom >= 14) {
    935994                        if (feature.type == Obj.CRANES) {
     
    9451004        }
    9461005
    947         private static void separation(Feature feature) {
     1006        private static void separation() {
    9481007                switch (feature.type) {
    9491008                case TSEZNE:
     
    9731032        }
    9741033
    975         private static void shoreline(Feature feature) {
    976                 if (Renderer.zoom >= 12) {
    977                         switch ((CatSLC) getAttEnum(feature, feature.type, 0, Att.CATSLC)) {
    978                         case SLC_TWAL:
    979                                 WatLEV lev = (WatLEV) getAttEnum(feature, feature.type, 0, Att.WATLEV);
    980                                 if (lev == WatLEV.LEV_CVRS) {
    981                                         Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
     1034        private static void shoreline() {
     1035                if ((ruleset == RuleSet.ALL) || (ruleset == RuleSet.BASE)) {
     1036                        Renderer.lineVector(feature, new LineStyle(Color.black, 10, Yland));
     1037                }
     1038                if ((ruleset == RuleSet.ALL) || (ruleset == RuleSet.SEAMARK)) {
     1039                        if (Renderer.zoom >= 12) {
     1040                                switch ((CatSLC) getAttEnum(feature, feature.type, 0, Att.CATSLC)) {
     1041                                case SLC_TWAL:
     1042                                        WatLEV lev = (WatLEV) getAttEnum(feature, feature.type, 0, Att.WATLEV);
     1043                                        if (lev == WatLEV.LEV_CVRS) {
     1044                                                Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
     1045                                                if (Renderer.zoom >= 15)
     1046                                                        Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, 80);
     1047                                        } else {
     1048                                                Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null));
     1049                                        }
    9821050                                        if (Renderer.zoom >= 15)
    983                                                 Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, 80);
    984                                 } else {
    985                                         Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null));
    986                                 }
    987                                 if (Renderer.zoom >= 15)
    988                                         Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -30);
    989                                 break;
    990                         case SLC_SWAY:
    991                                 Renderer.lineVector(feature, new LineStyle(Color.black, 2, null, new Color(0xffe000)));
    992                                 if ((Renderer.zoom >= 16) && feature.objs.containsKey(Obj.SMCFAC)) {
    993                                         ArrayList<Symbol> symbols = new ArrayList<Symbol>();
    994                                         ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(feature, Obj.SMCFAC, 0, Att.CATSCF);
    995                                         for (CatSCF scf : scfs) {
    996                                                 symbols.add(Facilities.Cats.get(scf));
    997                                         }
    998                                         Renderer.cluster(feature, symbols);
    999                                 }
    1000                                 break;
    1001                         default:
    1002                                 break;
    1003                         }
    1004                 }
    1005         }
    1006 
    1007         private static void stations(Feature feature) {
     1051                                                Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -30);
     1052                                        break;
     1053                                case SLC_SWAY:
     1054                                        Renderer.lineVector(feature, new LineStyle(Color.black, 2, null, new Color(0xffe000)));
     1055                                        if ((Renderer.zoom >= 16) && feature.objs.containsKey(Obj.SMCFAC)) {
     1056                                                ArrayList<Symbol> symbols = new ArrayList<Symbol>();
     1057                                                ArrayList<CatSCF> scfs = (ArrayList<CatSCF>) getAttList(feature, Obj.SMCFAC, 0, Att.CATSCF);
     1058                                                for (CatSCF scf : scfs) {
     1059                                                        symbols.add(Facilities.Cats.get(scf));
     1060                                                }
     1061                                                Renderer.cluster(feature, symbols);
     1062                                        }
     1063                                        break;
     1064                                default:
     1065                                        break;
     1066                                }
     1067                        }
     1068                }
     1069        }
     1070
     1071        private static void stations() {
    10081072                if (Renderer.zoom >= 14) {
    10091073                        String str = "";
     
    11091173        }
    11101174
    1111         private static void transits(Feature feature) {
     1175        private static void transits() {
    11121176          if (Renderer.zoom >= 14) {
    11131177                if (feature.type == Obj.RECTRC) Renderer.lineVector (feature, new LineStyle(Color.black, 10, null, null));
     
    11161180                if (Renderer.zoom >= 15) {
    11171181                        String str = "";
    1118                         String name = getName(feature);
     1182                        String name = getName();
    11191183                        if (name != null)
    11201184                                str += name + " ";
     
    11281192        }
    11291193
    1130         private static void waterways(Feature feature) {
     1194        private static void waterways() {
    11311195                Renderer.lineVector(feature, new LineStyle(Bwater, 20));
    11321196        }
    11331197
    1134         private static void wrecks(Feature feature) {
     1198        private static void wrecks() {
    11351199                if (Renderer.zoom >= 14) {
    11361200                        switch ((CatWRK) getAttEnum(feature, feature.type, 0, Att.CATWRK)) {
  • applications/editors/josm/plugins/seachart/src/s57/S57map.java

    r31014 r31027  
    1818import s57.S57val;
    1919import s57.S57val.*;
     20import s57.S57osm;
     21import s57.S57osm.*;
    2022
    2123public class S57map {
     
    482484
    483485        public void tagsDone(long id) {
    484                 if (feature.type == Obj.UNKOBJ) {
    485                         for (OSMtag tag : osmtags) {
    486                                 Obj obj = S57obj.OSMobj(tag.key, tag.val);
    487                                 if (obj != Obj.UNKOBJ) {
    488                                         feature.type = obj;
    489                                         ObjTab objs = feature.objs.get(obj);
    490                                         if (objs == null) {
    491                                                 objs = new ObjTab();
    492                                                 feature.objs.put(obj, objs);
    493                                         }
    494                                         AttMap atts = objs.get(0);
    495                                         if (atts == null) {
    496                                                 atts = new AttMap();
    497                                                 objs.put(0, atts);
    498                                         }
    499                                         AttVal<?> attval = S57val.OSMatt(tag.key, tag.val);
    500                                         if (attval.att != Att.UNKATT) {
    501                                                 atts.put(attval.att, attval);
    502                                         }
    503                                         break;
    504                                 }
     486                for (OSMtag tag : osmtags) {
     487                        KeyVal kv = S57osm.OSMtag(tag.key, tag.val);
     488                        if (kv.obj != Obj.UNKOBJ) {
     489                                if (feature.type == Obj.UNKOBJ) {
     490                                        feature.type = kv.obj;
     491                                }
     492                                ObjTab objs = feature.objs.get(kv.obj);
     493                                if (objs == null) {
     494                                        objs = new ObjTab();
     495                                        feature.objs.put(kv.obj, objs);
     496                                }
     497                                AttMap atts = objs.get(0);
     498                                if (atts == null) {
     499                                        atts = new AttMap();
     500                                        objs.put(0, atts);
     501                                }
     502                                if (kv.att != Att.UNKATT) {
     503                                        atts.put(kv.att, new AttVal(kv.att, kv.conv, kv.val));
     504                                }
     505                                break;
    505506                        }
    506507                }
     
    594595                        nedge.last = first;
    595596                        switch (lext) {
    596                         case NE:
    597597                        case N:
    598                                 if ((fext != Ext.NE) && (fext != Ext.N)) {
     598                                if ((lext == fext) || (fext != Ext.N)) {
    599599                                        nedge.nodes.add(1L);
    600                                         if ((fext != Ext.NW) && (fext != Ext.W)) {
     600                                        if ((fext != Ext.W)) {
    601601                                                nedge.nodes.add(2L);
    602                                                 if ((fext != Ext.SW) && (fext != Ext.S)) {
     602                                                if ((fext != Ext.S)) {
    603603                                                        nedge.nodes.add(3L);
    604                                                         if ((fext != Ext.SE) && (fext != Ext.W)) {
     604                                                        if ((fext != Ext.W)) {
    605605                                                                nedge.nodes.add(4L);
    606606                                                        }
     
    609609                                }
    610610                                break;
    611                         case NW:
    612611                        case W:
    613                                 if ((fext != Ext.NW) && (fext != Ext.W)) {
     612                                if ((lext == fext) || (fext != Ext.W)) {
    614613                                        nedge.nodes.add(2L);
    615                                         if ((fext != Ext.SW) && (fext != Ext.S)) {
     614                                        if ((fext != Ext.S)) {
    616615                                                nedge.nodes.add(3L);
    617                                                 if ((fext != Ext.SE) && (fext != Ext.E)) {
     616                                                if ((fext != Ext.E)) {
    618617                                                        nedge.nodes.add(4L);
    619                                                         if ((fext != Ext.NE) && (fext != Ext.N)) {
     618                                                        if ( (fext != Ext.N)) {
    620619                                                                nedge.nodes.add(1L);
    621620                                                        }
     
    624623                                }
    625624                                break;
    626                         case SW:
    627625                        case S:
    628                                 if ((fext != Ext.SW) && (fext != Ext.S)) {
     626                                if ((lext == fext) || (fext != Ext.S)) {
    629627                                        nedge.nodes.add(3L);
    630                                         if ((fext != Ext.SE) && (fext != Ext.E)) {
     628                                        if ((fext != Ext.E)) {
    631629                                                nedge.nodes.add(4L);
    632                                                 if ((fext != Ext.NE) && (fext != Ext.N)) {
     630                                                if ((fext != Ext.N)) {
    633631                                                        nedge.nodes.add(1L);
    634                                                         if ((fext != Ext.NW) && (fext != Ext.W)) {
     632                                                        if ((fext != Ext.W)) {
    635633                                                                nedge.nodes.add(2L);
    636634                                                        }
     
    639637                                }
    640638                                break;
    641                         case SE:
    642639                        case E:
    643                                 if ((fext != Ext.SE) && (fext != Ext.E)) {
     640                                if ((lext == fext) || (fext != Ext.E)) {
    644641                                        nedge.nodes.add(4L);
    645                                         if ((fext != Ext.NE) && (fext != Ext.N)) {
     642                                        if ((fext != Ext.N)) {
    646643                                                nedge.nodes.add(1L);
    647                                                 if ((fext != Ext.NW) && (fext != Ext.W)) {
     644                                                if ((fext != Ext.W)) {
    648645                                                        nedge.nodes.add(2L);
    649                                                         if ((fext != Ext.SW) && (fext != Ext.S)) {
     646                                                        if ((fext != Ext.S)) {
    650647                                                                nedge.nodes.add(3L);
    651648                                                        }
     
    661658                        features.get(Obj.LNDARE).add(land);
    662659                }
     660                return;
    663661        }
    664662
    665663        // Utility methods
    666664       
    667         enum Ext {I, N, NW, W, SW, S, SE, E, NE }
     665        enum Ext {I, N, W, S, E }
     666        class Xnode {
     667                double lat;
     668                double lon;
     669                Ext ext;
     670        }
    668671        Ext outsideBounds(long ref) {
    669672                Snode node = nodes.get(ref);
    670673                if (node.lat >= bounds.maxlat) {
    671                         if (node.lon <= bounds.minlon) {
    672                                 return Ext.NW;
    673                         } else if (node.lon >= bounds.maxlon) {
    674                                 return Ext.NE;
    675                         }
    676674                        return Ext.N;
    677675                }
    678676                if (node.lat <= bounds.minlat) {
    679                         if (node.lon <= bounds.minlon) {
    680                                 return Ext.SW;
    681                         } else if (node.lon >= bounds.maxlon) {
    682                                 return Ext.SE;
    683                         }
    684677                        return Ext.S;
    685678                }
    686679                if (node.lon >= bounds.maxlon) {
    687                         if (node.lat <= bounds.minlat) {
    688                                 return Ext.SE;
    689                         } else if (node.lat >= bounds.maxlat) {
    690                                 return Ext.NE;
    691                         }
    692680                        return Ext.E;
    693681                }
    694682                if (node.lon <= bounds.minlon) {
    695                         if (node.lat <= bounds.minlat) {
    696                                 return Ext.SW;
    697                         } else if (node.lat >= bounds.maxlat) {
    698                                 return Ext.NW;
    699                         }
    700683                        return Ext.W;
    701684                }
     
    904887                int ec;
    905888                long lastref;
    906                
     889
    907890                public GeomIterator(Geom g) {
    908891                        geom = g;
  • applications/editors/josm/plugins/seachart/src/s57/S57obj.java

    r31014 r31027  
    178178        }
    179179       
    180         private static final HashMap<String, Obj> OSMtags = new HashMap<String, Obj>();
    181         static {
    182                 OSMtags.put("natural=coastline", Obj.COALNE); OSMtags.put("natural=water", Obj.LAKARE);
    183                 OSMtags.put("waterway=riverbank", Obj.RIVBNK); OSMtags.put("waterway=river", Obj.RIVERS); OSMtags.put("waterway=canal", Obj.CANALS);
    184                 OSMtags.put("wetland=tidalflat", Obj.DEPARE);
    185         }
    186        
    187         public static Obj OSMobj(String key, String val) {
    188                 Obj obj = OSMtags.get(key + "=" + val);
    189                 if (obj != null) {
    190                         return obj;
    191                 }
    192                 return Obj.UNKOBJ;
    193         }
    194 
    195180}
  • applications/editors/josm/plugins/seachart/src/s57/S57val.java

    r31014 r31027  
    12421242        }
    12431243
    1244         static class KeyVal {
    1245                 Att key;
    1246                 Object val;
    1247                 KeyVal(Att k, Object v) {
    1248                         key = k;
    1249                         val = v;
    1250                 }
    1251         }
    1252        
    1253         private static final HashMap<String, KeyVal> OSMtags = new HashMap<String, KeyVal>();
    1254         static {
    1255                 OSMtags.put("wetland=tidalflat", new KeyVal(Att.DRVAL2, (double)0));
    1256         }
    1257        
    1258         public static AttVal OSMatt(String key, String val) {
    1259                 KeyVal att = OSMtags.get(key + "=" + val);
    1260                 if (att != null) {
    1261                         return new AttVal(att.key, Conv.F, att.val);
    1262                 }
    1263                 return new AttVal(Att.UNKATT, Conv.A, null);
    1264         }
    1265 
    12661244}
  • applications/editors/josm/plugins/seachart/src/seachart/ChartImage.java

    r30992 r31027  
    6868                g2.setBackground(Rules.Bwater);
    6969                g2.clearRect(rect.x, rect.y, rect.width, rect.height);
     70                Renderer.reRender(g2, zoom, Math.pow(2, (zoom-12)), SeachartAction.map, this);
    7071                g2.setPaint(Color.black);
    7172                g2.setFont(new Font("Arial", Font.BOLD, 20));
    7273                g2.drawString(("Z" + zoom), (rect.x + rect.width - 40), (rect.y + rect.height - 10));
    73                 Renderer.reRender(g2, zoom, Math.pow(2, (zoom-12)), SeachartAction.map, this);
    7474        }
    7575
Note: See TracChangeset for help on using the changeset viewer.