public Geometry getBoundary() { return polygon.getBoundary(); }
assertTrue(geometryFactory.createLinearRing(new Coordinate[] { }).getBoundary().isEmpty()); assertTrue(geometryFactory.createLineString(new Coordinate[] { }).getBoundary().isEmpty()); assertTrue(geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] { }), new LinearRing[] { }).getBoundary().isEmpty()); assertTrue(geometryFactory.createMultiPolygon(new Polygon[] { }).getBoundary().isEmpty()); assertTrue(geometryFactory.createMultiLineString(new LineString[] { }).getBoundary().isEmpty());
private Map<Poi, Map<String, String>> getPoisInsidePolygon(Polygon polygon) { Coordinate[] coordinates = polygon.getBoundary().getCoordinates(); double minLat = coordinates[0].y; double minLon = coordinates[0].x;
if (!pt.getBoundary().within(ls)) { r = true;
if (!ls.getBoundary().contains(pt)) { r = true;
/** * Computes the boundary of this geometry * * @return a lineal geometry (which may be empty) * @see Geometry#getBoundary */ public Geometry getBoundary() { if (isEmpty()) { return getFactory().createMultiLineString(); } ArrayList allRings = new ArrayList(); for (int i = 0; i < geometries.length; i++) { Polygon polygon = (Polygon) geometries[i]; Geometry rings = polygon.getBoundary(); for (int j = 0; j < rings.getNumGeometries(); j++) { allRings.add(rings.getGeometryN(j)); } } LineString[] allRingsArray = new LineString[allRings.size()]; return getFactory().createMultiLineString((LineString[]) allRings.toArray(allRingsArray)); }
public void runStarCrossRing() { int size = 1000; Envelope env = new Envelope(0,100,0,100); Polygon poly = StarCross.star(env, size, geomFact); Geometry geom = poly.getBoundary(); //System.out.println(geom); checkValid("StarCross " + geom.getGeometryType() + " (size = " + size + " )", geom); }
public void testBoundaryOfEmptyGeometry() throws Exception { assertTrue(geometryFactory.createPoint((Coordinate)null).getBoundary().getClass() == GeometryCollection.class); assertTrue(geometryFactory.createLinearRing(new Coordinate[] { }).getBoundary().getClass() == MultiPoint.class); assertTrue(geometryFactory.createLineString(new Coordinate[] { }).getBoundary().getClass() == MultiPoint.class); assertTrue(geometryFactory.createPolygon(geometryFactory.createLinearRing(new Coordinate[] { }), new LinearRing[] { }).getBoundary().getClass() == MultiLineString.class); assertTrue(geometryFactory.createMultiPolygon(new Polygon[] { }).getBoundary().getClass() == MultiLineString.class); assertTrue(geometryFactory.createMultiLineString(new LineString[] { }).getBoundary().getClass() == MultiPoint.class); assertTrue(geometryFactory.createMultiPoint(new Point[] { }).getBoundary().getClass() == GeometryCollection.class); try { geometryFactory.createGeometryCollection(new Geometry[] { }).getBoundary(); assertTrue(false); } catch (IllegalArgumentException e) { } }