Changeset 9108 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2015-12-13T12:13:26+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r9099 r9108 975 975 /** 976 976 * Calculate area and perimeter length of a polygon. 977 * 977 * 978 978 * Uses current projection; units are that of the projected coordinates. 979 * 979 * 980 980 * @param nodes the list of nodes representing the polygon 981 981 * @return area and perimeter … … 988 988 int numSegments = closed ? nodes.size() - 1 : nodes.size(); 989 989 EastNorth p1 = nodes.get(0).getEastNorth(); 990 for (int i =1; i<=numSegments; i++) {990 for (int i = 1; i <= numSegments; i++) { 991 991 EastNorth p2 = nodes.get(i == numSegments ? 0 : i).getEastNorth(); 992 992 area += p1.east() * p2.north() - p2.east() * p1.north();
Note: See TracChangeset
for help on using the changeset viewer.