Changeset 31157 in osm


Ignore:
Timestamp:
2015-05-28T21:10:44+02:00 (9 years ago)
Author:
malcolmh
Message:

clip to map bounds

Location:
applications/editors/josm/plugins/seachart
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/seachart/jicons/src/jicons/Jicons.java

    r31044 r31157  
    130130                                        s = 0;
    131131                                        file = format = "";
    132                                         map = new S57map();
     132                                        map = new S57map(true);
    133133                                        map.addNode(0, 0, 0);
    134134                                        for (String token : ln.split("[ ]+")) {
  • applications/editors/josm/plugins/seachart/js57toosm/src/js57toosm/Js57toosm.java

    r31063 r31157  
    4848                        tin.close();
    4949               
    50                 map = new S57map();
     50                map = new S57map(true);
    5151                MapBounds bounds = S57dec.decodeFile(in, map);
    5252
  • applications/editors/josm/plugins/seachart/src/render/Renderer.java

    r31044 r31157  
    4343                sScale = symbolScale[zoom] * factor;
    4444                if (map != null) {
     45                        Point2D tl = context.getPoint(map.new Snode(map.bounds.maxlat, map.bounds.minlon));
     46                        Point2D br = context.getPoint(map.new Snode(map.bounds.minlat, map.bounds.maxlon));
     47                        g2.clip(new Rectangle2D.Double(tl.getX(), tl.getY(), (br.getX() - tl.getX()), (br.getY() - tl.getY())));
    4548                        g2.setBackground(Symbols.Bwater);
    4649                        g2.clearRect(rect.x, rect.y, rect.width, rect.height);
  • applications/editors/josm/plugins/seachart/src/s57/S57map.java

    r31063 r31157  
    224224        }
    225225       
    226         class OSMtag {
    227                 String key;
    228                 String val;
    229                 OSMtag(String k, String v) {
    230                         key = k;
    231                         val = v;
    232                 }
    233         }
    234        
    235226        public NodeTab nodes;
    236227        public EdgeTab edges;
     
    246237        private Edge edge;
    247238        private KeyVal<?> osm = S57osm.OSMtag("", "");
    248 
    249         public S57map() {
     239        boolean sea;
     240
     241        public S57map(boolean s) {
     242                sea = s;
    250243                nodes = new NodeTab();          // All nodes in map
    251244                edges = new EdgeTab();          // All edges in map
     
    477470                                }
    478471                        }
    479                 } else {
     472                } else if (!sea) {
    480473                        KeyVal<?> kv = S57osm.OSMtag(key, val);
    481474                        if (kv.obj != Obj.UNKOBJ) {
  • applications/editors/josm/plugins/seachart/src/seachart/SeachartAction.java

    r31014 r31157  
    111111
    112112        protected void createChartLayer() {
    113                 // System.out.println("hello");
    114113                rendering = new ChartImage(new ImageryInfo("SeaChart"));
    115114                rendering.setBackgroundLayer(true);
     
    145144
    146145        void makeChart() {
    147                 map = new S57map();
     146                map = new S57map(false);
    148147                if (data != null) {
    149148                        double minlat = 90;
Note: See TracChangeset for help on using the changeset viewer.