Created
January 14, 2015 17:19
-
-
Save neradis/01cb99080baf6e29cde6 to your computer and use it in GitHub Desktop.
VOS 7.1 dev - st_distance vs. st_intersect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) | |
FILTER ( bif:st_distance(?wkt, ?centroid) <= 100 ) | |
FILTER ( langMatches(lang(?name), '') ) | |
FILTER NOT EXISTS { ?lgd a lgdm:Way. } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) | |
FILTER ( bif:st_intersects (?wkt, ?centroid, 100) ) | |
FILTER ( langMatches(lang(?name), '') ) | |
FILTER NOT EXISTS { ?lgd a lgdm:Way. } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connected to OpenLink Virtuoso | |
Driver: 07.10.3207 OpenLink Virtuoso ODBC Driver | |
name wkt distance | |
LONG VARCHAR LONG VARCHAR LONG VARCHAR | |
_______________________________________________________________________________ | |
Erfurt POINT(11.0296 50.9778) 45.57127203974507 | |
Göttingen POINT(9.93521 51.5328) 54.31867540296254 | |
Kassel POINT(9.4763 51.309) 69.50083019481471 | |
Jena POINT(11.5833 50.9331) 83.3635333416364 | |
4 Rows. -- 210 msec. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name wkt distance | |
LONG VARCHAR LONG VARCHAR LONG VARCHAR | |
_______________________________________________________________________________ | |
Erfurt POINT(11.0296 50.9778) 45.57127203974507 | |
Göttingen POINT(9.93521 51.5328) 54.31867540296254 | |
Jena POINT(11.5833 50.9331) 83.3635333416364 | |
3 Rows. -- 4572 msec. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment