public BBOX bbox(Expression geometry, BoundingBox bounds, MatchAction matchAction) { if (bounds instanceof BoundingBox3D) { return bbox(geometry, (BoundingBox3D) bounds); } else { return bbox2d(geometry, bounds, matchAction); } }
public BBOX3D bbox(Expression geometry, BoundingBox3D env) { return bbox(geometry, env, MatchAction.ANY); }
/** * Checks if the bounding box of the feature's geometry overlaps the specified bounding box. * * <p>Similar to: <code> * geom().disjoint( geom( bbox )).not() * </code> */ public BBOX bbox( String propertyName, double minx, double miny, double maxx, double maxy, String srs) { PropertyName name = property(propertyName); return bbox(name, minx, miny, maxx, maxy, srs); }
public BBOX bbox(Expression geometry, BoundingBox bounds) { if (bounds instanceof BoundingBox3D) { return bbox(geometry, (BoundingBox3D) bounds); } else { return bbox2d(geometry, bounds, MatchAction.ANY); } }
public BBOX3D bbox(String propertyName, BoundingBox3D env) { return bbox(property(propertyName), env, MatchAction.ANY); }
public BBOX bbox( Expression e, double minx, double miny, double maxx, double maxy, String srs, MatchAction matchAction) { BBOXImpl box = bbox2d(e, new ReferencedEnvelope(minx, maxx, miny, maxy, null), matchAction); box.setSRS(srs); return box; }
public BBOX bbox( String propertyName, double minx, double miny, double maxx, double maxy, String srs, MatchAction matchAction) { PropertyName name = property(propertyName); return bbox(name, minx, miny, maxx, maxy, srs, matchAction); }
public BBOX3D bbox(String propertyName, BoundingBox3D env, MatchAction matchAction) { return bbox(property(propertyName), env, matchAction); }
public BBOX bbox(Expression geometry, double minx, double miny, double maxx, double maxy, String srs) { return bbox(geometry, minx, miny, maxx, maxy, srs, MatchAction.ANY); }
@Test /* * Test BBox function with the property name specified. */ public void testBBoxWithPropertyName() throws Exception { // property name exists and is a geometry attribute BBOX filter = ff.bbox(ff.property("gsml:shape"), -1.1, 52.5, -1.1, 52.6, null); FeatureCollection<FeatureType, Feature> features = fSource.getFeatures(filter); assertEquals(2, size(features)); FeatureIterator<Feature> iterator = features.features(); try { Feature f = iterator.next(); assertEquals("mf1", f.getIdentifier().toString()); f = iterator.next(); assertEquals("mf3", f.getIdentifier().toString()); } finally { iterator.close(); } // prove that it would fail when property name is not a geometry attribute filter = ff.bbox(ff.property("gml:name[1]"), -1.2, 52.5, -1.1, 52.6, null); features = fSource.getFeatures(filter); assertEquals(0, size(features)); }
public BBOX bbox(String propertyName, double minx, double miny, double maxx, double maxy, String srs, MatchAction matchAction) { PropertyName name = property(propertyName); return bbox(name, minx, miny, maxx, maxy, srs, matchAction); }
@Test /* * Test Bbox function with no property name specified. The default geometry should be used. */ public void testBBoxWithNoPropertyName() throws IOException { // default geometry exists // in theory, when property name is not specified, the filter should apply to all the // geometry attributes, // but it wouldn't work until the bug in GeometryFilterImpl is fixed // and our test data only have 1 geometry, so it doesn't test multiple geometries case BBOX filter = ff.bbox(ff.property(""), -1.1, 52.5, -1.1, 52.6, null); FeatureCollection<FeatureType, Feature> features = fSource.getFeatures(filter); assertEquals(2, size(features)); FeatureIterator<Feature> iterator = features.features(); try { Feature f = iterator.next(); assertEquals(f.getIdentifier().toString(), "mf1"); f = iterator.next(); assertEquals(f.getIdentifier().toString(), "mf3"); } finally { iterator.close(); } }
/** * Checks if the bounding box of the feature's geometry overlaps the * specified bounding box. * <p> * Similar to: * <code> * geom().disjoint( geom( bbox )).not() * </code> * </p> */ public BBOX bbox(String propertyName, double minx, double miny, double maxx, double maxy, String srs) { PropertyName name = property(propertyName); return bbox(name, minx, miny, maxx, maxy, srs); }
/** * Checks if the bounding box of the feature's geometry overlaps the * specified bounding box. * <p> * Similar to: * <code> * geom().disjoint( geom( bbox )).not() * </code> * </p> */ public BBOX bbox(String propertyName, double minx, double miny, double maxx, double maxy, String srs) { PropertyName name = property(propertyName); return bbox( name, minx, miny, maxx, maxy, srs ); }
public BBOX bbox(Expression e, BoundingBox box) { String srs = box.getCoordinateReferenceSystem().getName().toString(); return bbox(e,box.getMinX(),box.getMinY(),box.getMaxX(),box.getMaxY(),srs); }
public BBOX bbox(Expression geometry, BoundingBox bounds, MatchAction matchAction) { return bbox( geometry, bounds.getMinX(), bounds.getMinY(), bounds.getMaxX(), bounds.getMaxY(), CRS.toSRS( bounds.getCoordinateReferenceSystem() ), matchAction ); }
public BBOX bbox( Expression geometry, BoundingBox bounds ) { return bbox( geometry, bounds.getMinX(), bounds.getMinY(), bounds.getMaxX(), bounds.getMaxY(), CRS.toSRS( bounds.getCoordinateReferenceSystem() ) ); }
@Test /* * Test Bbox function with no property name specified. The default geometry should be used. */ public void testBBoxWithNoPropertyName() throws IOException { // default geometry exists // in theory, when property name is not specified, the filter should apply to all the // geometry attributes, // but it wouldn't work until the bug in GeometryFilterImpl is fixed // and our test data only have 1 geometry, so it doesn't test multiple geometries case BBOX filter = ff.bbox(ff.property(""), -1.1, 52.5, -1.1, 52.6, null); FeatureCollection<FeatureType, Feature> features = fSource.getFeatures(filter); assertEquals(2, size(features)); Iterator<Feature> iterator = features.iterator(); Feature f = iterator.next(); assertEquals(f.getIdentifier().toString(), "mf1"); f = iterator.next(); assertEquals(f.getIdentifier().toString(), "mf3"); }
@Test /* * Test BBox function with the property name specified. */ public void testBBoxWithPropertyName() throws Exception { // property name exists and is a geometry attribute BBOX filter = ff.bbox(ff.property("gsml:shape"), -1.1, 52.5, -1.1, 52.6, null); FeatureCollection<FeatureType, Feature> features = fSource.getFeatures(filter); assertEquals(2, size(features)); Iterator<Feature> iterator = features.iterator(); Feature f = iterator.next(); assertEquals(f.getIdentifier().toString(), "mf1"); f = iterator.next(); assertEquals(f.getIdentifier().toString(), "mf3"); // prove that it would fail when property name is not a geometry attribute filter = ff.bbox(ff.property("gml:name[1]"), -1.2, 52.5, -1.1, 52.6, null); features = fSource.getFeatures(filter); assertEquals(0, size(features)); }