NearbyGeomPF extends GenericSpatialPropertyFunction { @Override protected boolean checkSecondFilter(SpatialArguments spatialArguments, GeometryWrapper targetGeometryWrapper) { GeometryWrapper geometryWrapper = spatialArguments.getGeometryWrapper(); return NearbyFF.relate(geometryWrapper, targetGeometryWrapper, radius, unitsURI); }    }
@Test public void testCheckSecondFilter() { NearbyGeomPF instance = new NearbyGeomPF(); Node predicate = NodeFactory.createURI(SpatialExtension.NEARBY_GEOM_PROP); float lat = 0; float lon = 1; float radius = 5; Literal geometry = ConvertLatLon.toLiteral(lat, lon); Literal targetGeometry = ConvertLatLon.toLiteral(lat + 0.0001f, lon); List<Node> objectNodes = Arrays.asList(geometry.asNode(), NodeValue.makeFloat(radius).asNode()); PropFuncArg object = new PropFuncArg(objectNodes); SpatialArguments spatialArguments = instance.extractObjectArguments(predicate, object, SpatialIndexTestData.WGS_84_SRS_INFO); GeometryWrapper targetGeometryWrapper = GeometryWrapper.extract(targetGeometry); boolean expResult = true; boolean result = instance.checkSecondFilter(spatialArguments, targetGeometryWrapper); assertEquals(expResult, result); }