Changeset 12742 in josm for trunk/src/org
- Timestamp:
- 2017-09-05T20:41:09+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r12726 r12742 35 35 import org.openstreetmap.josm.data.projection.Projection; 36 36 import org.openstreetmap.josm.data.projection.Projections; 37 import org.openstreetmap.josm.gui.MainApplication;38 import org.openstreetmap.josm.gui.MapFrame;39 37 40 38 /** … … 553 551 */ 554 552 public static Area getAreaLatLon(Relation multipolygon) { 555 MapFrame map = MainApplication.getMap(); 556 final Multipolygon mp = map == null || map.mapView == null 557 ? new Multipolygon(multipolygon) 558 : MultipolygonCache.getInstance().get(multipolygon); 553 final Multipolygon mp = MultipolygonCache.getInstance().get(multipolygon); 559 554 Path2D path = new Path2D.Double(); 560 555 path.setWindingRule(Path2D.WIND_EVEN_ODD); … … 694 689 public static double multipolygonArea(Relation multipolygon) { 695 690 double area = 0.0; 696 MapFrame map = MainApplication.getMap(); 697 final Multipolygon mp = map == null || map.mapView == null 698 ? new Multipolygon(multipolygon) 699 : MultipolygonCache.getInstance().get(multipolygon); 691 final Multipolygon mp = MultipolygonCache.getInstance().get(multipolygon); 700 692 for (Multipolygon.PolyData pd : mp.getCombinedPolygons()) { 701 693 area += pd.getAreaAndPerimeter(Projections.getProjectionByCode("EPSG:54008")).getArea();
Note:
See TracChangeset
for help on using the changeset viewer.