Hi, testing some geospatial SPARQL queries using a build of the latest commit from the developt/7 branch (thus VOS OpenSource 07.10.3211)on the LinkedGeoData Dumps from Sep 9 2014 ([1]) I encountered unexpected discrepancy between the selectiveness of st_intersects versus giving an upper bound to the distance between points calculated using st_distance.
I used the following query: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX ogc: <http://www.opengis.net/ont/geosparql#> PREFIX geom: <http://geovocab.org/geometry#> PREFIX wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> PREFIX lgd: <http://linkedgeodata.org/> PREFIX lgdo: <http://linkedgeodata.org/ontology/> PREFIX lgdm: <http://linkedgeodata.org/meta/> PREFIX lgd-tr: <http://linkedgeodata.org/triplify/> PREFIX lgd-geo: <http://linkedgeodata.org/geometry/> PREFIX dcterms: <http://purl.org/dc/terms/> SELECT ?name, ?wkt, bif:st_distance(?wkt, ?centroid ) AS ?distance FROM <http://linkedgeodata.org> { ?lgd a lgdo:City; rdfs:label ?name; geom:geometry [ogc:asWKT ?wkt ]. BIND ( bif:st_point(10.447683, 51.163375) AS ?centroid ) # choose one of the two lines below: # FILTER ( bif:st_distance(?wkt, ?centroid) <= 100 ) # use this predicate for query A # FILTER ( bif:st_intersects (?wkt, ?centroid, 100) ) # use this predicate for query B FILTER ( langMatches(lang(?name), '') ) FILTER NOT EXISTS { ?lgd a lgdm:Way. } } Using the query A (with filter by st_distance(...) <= 100), I get fourcities in my result set. Using query B, however, I only get threeout of the fourcities as result. Please see the Github gist at [2]for details. All of the four cities that should appear have distances from the centroid significantly under 100 units, so it shouldn't just be a floating point precision issue or something along that lines. As far as I understand the SQL MM standard and VOS documentation st_distance(?a, ?b) <= 100)and st_intersects (?a, ?b, 100)should be equivalent predicates provided that ?a and ?b are POINT geometries, right?If so, then this seems to be a bug. Just want to confirm my understanding before creating Github issue on this. Regards, Markus Ackermann [1]http://downloads.linkedgeodata.org/releases/2014-09-09/ [2] https://gist.github.com/neradis/01cb99080baf6e29cde6 ------------------------------------------------------------------------------ New Year. New Location. New Benefits. New Data Center in Ashburn, VA. GigeNET is offering a free month of service with a new server in Ashburn. Choose from 2 high performing configs, both with 100TB of bandwidth. Higher redundancy.Lower latency.Increased capacity.Completely compliant. http://p.sf.net/sfu/gigenet _______________________________________________ Virtuoso-users mailing list Virtuoso-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/virtuoso-users