public Geometry getEnvelope() { return lineString.getEnvelope(); }
public Geometry getEnvelope() { return super.getEnvelope(); }
public Geometry getEnvelope() { return super.getEnvelope(); }
ev[0] = new DefaultElementValue(element, p.getEnvelope());
private static Geometry tileToJTSGeometry(long tileX, long tileY, byte zoom, int enlargementInMeter) { double minLat = MercatorProjection.tileYToLatitude(tileY + 1, zoom); double maxLat = MercatorProjection.tileYToLatitude(tileY, zoom); double minLon = MercatorProjection.tileXToLongitude(tileX, zoom); double maxLon = MercatorProjection.tileXToLongitude(tileX + 1, zoom); double[] epsilons = bufferInDegrees(tileY, zoom, enlargementInMeter); minLon -= epsilons[1]; minLat -= epsilons[0]; maxLon += epsilons[1]; maxLat += epsilons[0]; Coordinate bottomLeft = new Coordinate(minLon, minLat); Coordinate topRight = new Coordinate(maxLon, maxLat); return GEOMETRY_FACTORY.createLineString(new Coordinate[]{bottomLeft, topRight}).getEnvelope(); }
jtsTopLeft}).getEnvelope(); return jtsEnv;
public void testAsGeometry() throws Exception { assertTrue(geometryFactory.createPoint((Coordinate) null).getEnvelope() .isEmpty()); Geometry g = geometryFactory.createPoint(new Coordinate(5, 6)) .getEnvelope(); assertTrue(!g.isEmpty()); assertTrue(g instanceof Point); Point p = (Point) g; assertEquals(5, p.getX(), 1E-1); assertEquals(6, p.getY(), 1E-1); LineString l = (LineString) reader.read("LINESTRING(10 10, 20 20, 30 40)"); Geometry g2 = l.getEnvelope(); assertTrue(!g2.isEmpty()); assertTrue(g2 instanceof Polygon); Polygon poly = (Polygon) g2; poly.normalize(); assertEquals(5, poly.getExteriorRing().getNumPoints()); assertEquals(new Coordinate(10, 10), poly.getExteriorRing().getCoordinateN( 0)); assertEquals(new Coordinate(10, 40), poly.getExteriorRing().getCoordinateN( 1)); assertEquals(new Coordinate(30, 40), poly.getExteriorRing().getCoordinateN( 2)); assertEquals(new Coordinate(30, 10), poly.getExteriorRing().getCoordinateN( 3)); assertEquals(new Coordinate(10, 10), poly.getExteriorRing().getCoordinateN( 4)); }