Ignore:
Timestamp:
2014-02-12T00:55:05+01:00 (10 years ago)
Author:
Don-vip
Message:

see #9680 - Boost multipolygon computation performance by caching Areas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/MultipolygonCreate.java

    r6093 r6841  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
     6import java.awt.geom.Area;
    67import java.util.ArrayList;
    78import java.util.Collection;
     
    2627        public final List<Boolean> reversed;
    2728        public final List<Node> nodes;
     29        public final Area area;
    2830
    2931        public JoinedPolygon(List<Way> ways, List<Boolean> reversed) {
     
    3133            this.reversed = reversed;
    3234            this.nodes = this.getNodes();
     35            this.area = Geometry.getArea(nodes);
    3336        }
    3437
     
    3841         */
    3942        public JoinedPolygon(Way way) {
    40             this.ways = Collections.singletonList(way);
    41             this.reversed = Collections.singletonList(Boolean.FALSE);
    42             this.nodes = this.getNodes();
    43         }
    44 
     43            this(Collections.singletonList(way), Collections.singletonList(Boolean.FALSE));
     44        }
    4545
    4646        /**
     
    233233                }
    234234
    235                 PolygonIntersection intersection = Geometry.polygonIntersection(outerWay.nodes, innerWay.nodes);
     235                PolygonIntersection intersection = Geometry.polygonIntersection(outerWay.area, innerWay.area);
    236236
    237237                if (intersection == PolygonIntersection.FIRST_INSIDE_SECOND) {
Note: See TracChangeset for help on using the changeset viewer.