Geometry gc = reader.read("GEOMETRYCOLLECTION( LINESTRING(0 0, 10 10), LINEARRING(10 10, 10 20, 20 10, 10 10))");
assertEquals(Location.BOUNDARY, pointLocator.locate(new Coordinate(10, 10), gc));
}
public void testPointLocator() throws Exception {
PointLocator pointLocator = new PointLocator();
Geometry polygon = reader.read("POLYGON ((70 340, 430 50, 70 50, 70 340))");
assertEquals(Location.EXTERIOR, pointLocator.locate(new Coordinate(420, 340), polygon));
assertEquals(Location.BOUNDARY, pointLocator.locate(new Coordinate(350, 50), polygon));
assertEquals(Location.BOUNDARY, pointLocator.locate(new Coordinate(410, 50), polygon));
assertEquals(Location.INTERIOR, pointLocator.locate(new Coordinate(190, 150), polygon));
}