- Timestamp:
- 2020-06-17T22:16:45+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDataText.java
r15777 r16674 10 10 import java.util.stream.Stream; 11 11 12 import org.openstreetmap.josm.data.SystemOfMeasurement; 12 13 import org.openstreetmap.josm.data.conflict.Conflict; 13 14 import org.openstreetmap.josm.data.coor.ILatLon; … … 25 26 import org.openstreetmap.josm.data.osm.OsmData; 26 27 import org.openstreetmap.josm.data.osm.OsmPrimitive; 28 import org.openstreetmap.josm.data.osm.Relation; 29 import org.openstreetmap.josm.data.osm.Way; 27 30 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 28 31 import org.openstreetmap.josm.data.projection.proj.TransverseMercator; … … 175 178 add(tr("Centroid: "), toStringCSV(false, 176 179 ProjectionRegistry.getProjection().eastNorth2latlon(Geometry.getCentroid(((IWay<?>) o).getNodes())))); 180 if (o instanceof Way) { 181 double dist = ((Way) o).getLength(); 182 String distText = SystemOfMeasurement.getSystemOfMeasurement().getDistText(dist); 183 add(tr("Length: {0}", distText)); 184 } 185 if (o instanceof Way && ((Way) o).concernsArea() && ((Way) o).isClosed()) { 186 double area = Geometry.closedWayArea((Way) o); 187 String areaText = SystemOfMeasurement.getSystemOfMeasurement().getAreaText(area); 188 add(tr("Area: {0}", areaText)); 189 } 177 190 addWayNodes((IWay<?>) o); 178 191 } else if (o instanceof IRelation) { 179 192 addBbox(o); 193 if (o instanceof Relation && ((Relation) o).concernsArea()) { 194 double area = Geometry.multipolygonArea(((Relation) o)); 195 String areaText = SystemOfMeasurement.getSystemOfMeasurement().getAreaText(area); 196 add(tr("Area: {0}", areaText)); 197 } 180 198 addRelationMembers((IRelation<?>) o); 181 199 }
Note:
See TracChangeset
for help on using the changeset viewer.