public Object visit(Intersects filter, Object extraData) { checkLeftExpressionIsProperty(filter.getExpression1()); return FilterToTextUtil.buildBinarySpatialOperator("INTERSECTS", filter, extraData); }
public Object visit(Intersects filter, Object data) { data = filter.getExpression1().accept(this, data); data = filter.getExpression2().accept(this, data); return data; }
public Object visit(Intersects filter, Object data) { data = filter.getExpression1().accept(this, data); data = filter.getExpression2().accept(this, data); return data; }
public Object visit(Intersects filter, Object data) { filter.getExpression1().accept(this, data); if (found) return found; filter.getExpression2().accept(this, data); return found; }
public Object visit(Intersects filter, Object data) { data = filter.getExpression1().accept(this, data); if (found(data)) return data; data = filter.getExpression2().accept(this, data); return data; }
public Object visit(Intersects filter, Object extraData) { Expression left = filter.getExpression1(); Expression right = filter.getExpression2(); final String type = "Intersects"; start(type); left.accept(this, extraData); right.accept(this, extraData); end(type); return extraData; }
public Object visit(Intersects filter, Object extraData) { Expression geometry1 = visit(filter.getExpression1(), extraData); Expression geometry2 = visit(filter.getExpression2(), extraData); return getFactory(extraData).intersects(geometry1, geometry2, filter.getMatchAction()); }
public void testIntersectsParse() throws Exception { FilterMockData.intersects(document, document); Intersects intersects = (Intersects) parse(); assertNotNull(intersects.getExpression1()); assertNotNull(intersects.getExpression2()); }
public void testIntersectsParse() throws Exception { FilterMockData.intersects(document, document); Intersects intersects = (Intersects) parse(); assertNotNull(intersects.getExpression1()); assertNotNull(intersects.getExpression2()); }
@Override public Object visit(Intersects filter, Object extraData) { BasicDBObject output = asDBObject(extraData); // TODO: handle swapping of operands Object e1 = filter.getExpression1().accept(this, Geometry.class); Geometry geometry = filter.getExpression2().evaluate(null, Geometry.class); DBObject geometryDBObject = geometryBuilder.toObject(geometry); addCrsToGeometryDBObject(geometryDBObject); DBObject dbo = BasicDBObjectBuilder.start() .push("$geoIntersects") .add("$geometry", geometryDBObject) .get(); output.put((String) e1, dbo); return output; }
public void testIntersectsWithFunction() throws Exception { Function function = new GeometryFunction(); // see if coordinates gets flipped, urn forces lat/lon interpretation Intersects original = ff.intersects(ff.property("geom"), function); Filter clone = (Filter) original.accept(reprojector, null); assertNotSame(original, clone); Intersects isClone = (Intersects) clone; assertEquals(isClone.getExpression1(), original.getExpression1()); LineString clonedLs = (LineString) isClone.getExpression2().evaluate(null); assertTrue(15 == clonedLs.getCoordinateN(0).x); assertTrue(10 == clonedLs.getCoordinateN(0).y); assertTrue(25 == clonedLs.getCoordinateN(1).x); assertTrue(20 == clonedLs.getCoordinateN(1).y); assertEquals(CRS.decode("EPSG:4326"), clonedLs.getUserData()); }
public void testIntersectsReproject(Expression geom) throws FactoryException { GeometryFactory gf = new GeometryFactory(); LineString ls = gf.createLineString( new Coordinate[] {new Coordinate(10, 15), new Coordinate(20, 25)}); ls.setUserData(CRS.decode("urn:x-ogc:def:crs:EPSG:6.11.2:4326")); // see if coordinates gets flipped, urn forces lat/lon interpretation Intersects original = ff.intersects(geom, ff.literal(ls)); Filter clone = (Filter) original.accept(reprojector, null); assertNotSame(original, clone); Intersects isClone = (Intersects) clone; assertEquals(isClone.getExpression1(), original.getExpression1()); LineString clonedLs = (LineString) ((Literal) isClone.getExpression2()).getValue(); assertTrue(15 == clonedLs.getCoordinateN(0).x); assertTrue(10 == clonedLs.getCoordinateN(0).y); assertTrue(25 == clonedLs.getCoordinateN(1).x); assertTrue(20 == clonedLs.getCoordinateN(1).y); assertEquals(CRS.decode("EPSG:4326"), clonedLs.getUserData()); }
public void testIntersectsReferencedGeometry() throws Exception { GeometryFactory gf = new GeometryFactory(); LineString ls = gf.createLineString( new Coordinate[] {new Coordinate(10, 15), new Coordinate(20, 25)}); ls.setUserData(CRS.decode("urn:x-ogc:def:crs:EPSG:6.11.2:4326")); // see if coordinates gets flipped, urn forces lat/lon interpretation Intersects original = ff.intersects(ff.property("line"), ff.literal(ls)); Filter clone = (Filter) original.accept(reprojector, null); assertNotSame(original, clone); Intersects isClone = (Intersects) clone; assertEquals(isClone.getExpression1(), original.getExpression1()); LineString clonedLs = (LineString) isClone.getExpression2().evaluate(null); assertTrue(15 == clonedLs.getCoordinateN(0).x); assertTrue(10 == clonedLs.getCoordinateN(0).y); assertTrue(25 == clonedLs.getCoordinateN(1).x); assertTrue(20 == clonedLs.getCoordinateN(1).y); assertEquals(CRS.decode("EPSG:4326"), clonedLs.getUserData()); }
public Object visit(Intersects filter, Object extraData) { checkLeftExpressionIsProperty(filter.getExpression1()); return FilterToTextUtil.buildBinarySpatialOperator("INTERSECTS", filter, extraData); } public Object visit(Overlaps filter, Object extraData) {
@Override public Object visit(final Intersects filter, Object data) { if (!attributeOfInterest.equals(filter.getExpression1().toString())) { return new ExtractGeometryFilterVisitorResult(infinity(), null); } data = filter.getExpression2().accept(this, data); return new ExtractGeometryFilterVisitorResult((Geometry) data, CompareOperation.INTERSECTS); }
public Object visit( Intersects filter, Object data ) { filter.getExpression1().accept(this, data); filter.getExpression2().accept(this, data); return data; }
public Object visit( Intersects filter, Object data ) { filter.getExpression1().accept(this, data); if( found ) return found; filter.getExpression2().accept(this, data); return found; }
@Test public void testGeometryFilter() throws Exception { mapping = createSampleDerivedAttributeMappings(); visitor = new UnmappingFilterVisitor(mapping); targetDescriptor = mapping.getTargetFeature(); targetType = (FeatureType) targetDescriptor.getType(); Expression literalGeom = ff.literal(new GeometryFactory().createPoint(new Coordinate(1, 1))); Intersects gf = ff.intersects(ff.property("areaOfInfluence"), literalGeom, MatchAction.ALL); Filter unrolled = (Filter) gf.accept(visitor, null); assertTrue(unrolled instanceof Intersects); assertNotSame(gf, unrolled); assertEquals(MatchAction.ALL, ((Intersects) unrolled).getMatchAction()); Intersects newFilter = (Intersects) unrolled; Expression left = newFilter.getExpression1(); Expression right = newFilter.getExpression2(); assertSame(right, literalGeom); assertTrue(left instanceof Function); Function fe = (Function) left; assertEquals("buffer", fe.getName()); Expression arg0 = (Expression) fe.getParameters().get(0); assertTrue(arg0 instanceof PropertyName); assertEquals("location", ((PropertyName) arg0).getPropertyName()); }
public Object visit( Intersects filter, Object data ) { data = filter.getExpression1().accept(this, data); if( found(data)) return data; data = filter.getExpression2().accept(this, data); return data; }
public Object visit(Intersects filter, Object extraData) { Expression geometry1= visit(filter.getExpression1(), extraData); Expression geometry2= visit(filter.getExpression2(), extraData); return getFactory(extraData).intersects(geometry1, geometry2); }