@Test public void testLineDistanceWithGeometries() throws IOException, TurfException { Point pt = (Point) Feature.fromJson(loadJsonFixture(PT)).geometry(); FeatureCollection pts = FeatureCollection.fromJson(loadJsonFixture(PTS)); List<Point> pointList = new ArrayList<>(); for (Feature feature : pts.features()) { pointList.add((Point) (feature.geometry())); } Point closestPt = TurfClassification.nearestPoint(pt, pointList); Assert.assertNotNull(closestPt); Assert.assertEquals(closestPt.type(), "Point"); Assert.assertEquals(closestPt.longitude(), -75.33, DELTA); Assert.assertEquals(closestPt.latitude(), 39.44, DELTA); } }