Changeset 9952 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2016-03-07T23:29:30+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/GeometryTest.java
r9951 r9952 13 13 import org.openstreetmap.josm.data.coor.EastNorth; 14 14 import org.openstreetmap.josm.data.osm.DataSet; 15 import org.openstreetmap.josm.data.osm.Relation; 15 16 import org.openstreetmap.josm.data.osm.Way; 16 17 import org.openstreetmap.josm.io.OsmReader; … … 72 73 Way closedWay = (Way) Utils.filter(ds.allPrimitives(), SearchCompiler.compile("landuse=forest")).iterator().next(); 73 74 Assert.assertEquals(5760015.7353515625, Geometry.closedWayArea(closedWay), 1e-3); 75 Assert.assertEquals(5760015.7353515625, Geometry.computeArea(closedWay), 1e-3); 76 } 77 } 78 79 /** 80 * Test of {@link Geometry#multipolygonArea(Relation)}} method. 81 * 82 * @throws Exception if an error occurs 83 */ 84 @Test 85 public void testMultipolygonArea() throws Exception { 86 try (FileInputStream in = new FileInputStream(TestUtils.getTestDataRoot() + "multipolygon.osm")) { 87 DataSet ds = OsmReader.parseDataSet(in, null); 88 final Relation r = ds.getRelations().iterator().next(); 89 Assert.assertEquals(4401735.20703125, Geometry.multipolygonArea(r), 1e-3); 90 Assert.assertEquals(4401735.20703125, Geometry.computeArea(r), 1e-3); 74 91 } 75 92 }
Note:
See TracChangeset
for help on using the changeset viewer.