double maxx = Double.parseDouble(bboxValues[2].toString()); double maxy = Double.parseDouble(bboxValues[3].toString()); bbox = new Envelope(minx, maxx, miny, maxy);
private static Envelope getEnvelope(OGCGeometry ogcGeometry) { com.esri.core.geometry.Envelope env = new com.esri.core.geometry.Envelope(); ogcGeometry.getEsriGeometry().queryEnvelope(env); return new Envelope(env.getXMin(), env.getXMax(), env.getYMin(), env.getYMax()); }
private static Envelope getEnvelope(OGCGeometry ogcGeometry, double radius) { com.esri.core.geometry.Envelope envelope = new com.esri.core.geometry.Envelope(); ogcGeometry.getEsriGeometry().queryEnvelope(envelope); return new Envelope(envelope.getXMin() - radius, envelope.getXMax() + radius, envelope.getYMin() - radius, envelope.getYMax() + radius); }
public Envelope latLonBoundingBox() throws Exception { Element box = ReaderUtils.getChildElement(featureType, "latLonBoundingBox"); double minx = ReaderUtils.getDoubleAttribute(box, "minx", true); double miny = ReaderUtils.getDoubleAttribute(box, "miny", true); double maxx = ReaderUtils.getDoubleAttribute(box, "maxx", true); double maxy = ReaderUtils.getDoubleAttribute(box, "maxy", true); return new Envelope(minx, maxx, miny, maxy); }
public Envelope nativeBoundingBox() throws Exception { Element box = ReaderUtils.getChildElement(featureType, "nativeBBox"); boolean dynamic = ReaderUtils.getBooleanAttribute(box, "dynamic", false, true); if (dynamic) { return null; } double minx = ReaderUtils.getDoubleAttribute(box, "minx", true); double miny = ReaderUtils.getDoubleAttribute(box, "miny", true); double maxx = ReaderUtils.getDoubleAttribute(box, "maxx", true); double maxy = ReaderUtils.getDoubleAttribute(box, "maxy", true); return new Envelope(minx, maxx, miny, maxy); }
/** * Get the union. * * @param r the other geometry * @return the union of this geometry envelope and another geometry envelope */ public Value getEnvelopeUnion(ValueGeometry r) { GeometryFactory gf = new GeometryFactory(); Envelope mergedEnvelope = new Envelope(getGeometryNoCopy().getEnvelopeInternal()); mergedEnvelope.expandToInclude(r.getGeometryNoCopy().getEnvelopeInternal()); return get(gf.toGeometry(mergedEnvelope)); }
Envelope infinity() { return new Envelope( Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY); }
@Override protected Envelope computeEnvelopeInternal() { final Envelope result = new Envelope(); for (LineString ls : components) { result.expandToInclude(ls.getEnvelopeInternal()); } return result; }
public GeometryDataset(Geometry... geometries) { this.geometries = Arrays.asList(geometries); this.bounds = new Envelope(); for (Geometry g : geometries) { bounds.expandToInclude(g.getEnvelopeInternal()); } setBuffer(0.1d); }
public void testWorld() throws Exception { CoordinateReferenceSystem wgs84 = CRS.decode("EPSG:4326", true); ReferencedEnvelope re = new ReferencedEnvelope(new Envelope(-180, 180, -90, 90), wgs84); double scale = RendererUtilities.calculateScale(re, 1000, 500, 75); assertEquals(52830886, scale, 1); }
public void testEncodeAsNull() throws Exception { Envelope e = new Envelope(); e.setToNull(); Document dom = encode(e, GML.boundedBy); assertEquals("gml:Null", dom.getDocumentElement().getFirstChild().getNodeName()); } }
public void testEncodeAsNull() throws Exception { Envelope e = new Envelope(); e.setToNull(); Document dom = encode(e, GML.boundedBy); assertEquals("gml:Null", dom.getDocumentElement().getFirstChild().getNodeName()); } }
/** Build a test feature with the specified id. */ protected static SimpleFeature buildFeature(String id) { SimpleFeatureBuilder builder = new SimpleFeatureBuilder(TYPE); builder.add(new Envelope(0, 1, 0, 1)); return builder.buildFeature(id); }
@Test public void testBbox() { Filter f = ff.bbox("geom", -10, -10, 10, 10, null); Envelope env = (Envelope) f.accept(visitor, null); assertEquals(new Envelope(-10, 10, -10, 10), env); }
@Test public void testAndIsNull() throws Exception { final Filter f = ff.and(ff.bbox("geom", -10, -10, 10, 10, null), ff.isNull(ff.literal("someDate"))); final Envelope env = (Envelope) f.accept(visitor, null); assertEquals(new Envelope(-10, 10, -10, 10), env); }
@Test public void testAndIsNil() throws Exception { final Filter f = ff.and( ff.bbox("geom", -10, -10, 10, 10, null), ff.isNil(ff.literal("someDate"), null)); final Envelope env = (Envelope) f.accept(visitor, null); assertEquals(new Envelope(-10, 10, -10, 10), env); } }
@Test public void testAndTemporalBefore() throws Exception { final Instant start = instant("2016-01-01T00:00:00.000-0500"); final Filter f = ff.and( ff.bbox("geom", -10, -10, 10, 10, null), ff.before(ff.literal("someDate"), ff.literal(start))); final Envelope env = (Envelope) f.accept(visitor, null); assertEquals(new Envelope(-10, 10, -10, 10), env); }
@Test public void testAndTemporalMeets() throws Exception { final Period p = period("2016-01-01T00:00:00.000-0500", "2106-01-02T00:00:00.000-0500"); final Filter f = ff.and( ff.bbox("geom", -10, -10, 10, 10, null), ff.meets(ff.literal("someDate"), ff.literal(p))); final Envelope env = (Envelope) f.accept(visitor, null); assertEquals(new Envelope(-10, 10, -10, 10), env); }
@Test public void testAndTemporalOverlappedBy() throws Exception { final Period p = period("2016-01-01T00:00:00.000-0500", "2106-01-02T00:00:00.000-0500"); final Filter f = ff.and( ff.bbox("geom", -10, -10, 10, 10, null), ff.overlappedBy(ff.literal("someDate"), ff.literal(p))); final Envelope env = (Envelope) f.accept(visitor, null); assertEquals(new Envelope(-10, 10, -10, 10), env); }
@Test public void testAndDWithin() { Point geom = new GeometryFactory().createPoint(new Coordinate(0, 0)); Filter filter = ff.dwithin(ff.property("geom"), ff.literal(geom), 100, "metre"); filter = ff.and(filter, ff.bbox(ff.property("geom"), 50, 50, 150, 150, null)); Envelope env = (Envelope) filter.accept(visitor, null); assertEquals(new Envelope(50, 100, 50, 100), env); }