Changeset 15442 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2019-10-07T23:48:07+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java
r15427 r15442 117 117 } 118 118 119 /** 120 * Test reading a GeoJSON file with a named CRS. 121 * @throws Exception in case of error 122 */ 123 @Test 124 public void testReadGeoJsonNamedCrs() throws Exception { 125 try (InputStream in = Files.newInputStream(Paths.get(TestUtils.getTestDataRoot(), "geocrs.json"))) { 126 final List<OsmPrimitive> primitives = new ArrayList<>(new GeoJSONReader() 127 .doParseDataSet(in, null) 128 .getPrimitives(it -> true)); 129 assertEquals(24, primitives.size()); 130 assertTrue(primitives.stream() 131 .filter(it -> areEqualNodes(it, new Node(new LatLon(52.5840213, 13.1724145)))) 132 .findAny().isPresent()); 133 } 134 } 135 119 136 private static boolean areEqualNodes(final OsmPrimitive p1, final OsmPrimitive p2) { 120 137 return (p1 instanceof Node) 121 138 && (p2 instanceof Node) 122 && ((Node) p1).getCoor().equals(((Node) p2).getCoor()); 139 && ((Node) p1).getCoor().equalsEpsilon(((Node) p2).getCoor()); 123 140 } 124 141
Note:
See TracChangeset
for help on using the changeset viewer.