Skip to content

Instantly share code, notes, and snippets.

@companje
Created August 16, 2022 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save companje/dded86cc21948a46b9dc06b4c711a5fb to your computer and use it in GitHub Desktop.
Save companje/dded86cc21948a46b9dc06b4c711a5fb to your computer and use it in GitHub Desktop.
geof:sfWithin (filter results with a boundingbox) with SPARQL
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix def: <https://hetutrechtsarchief.nl/def/> .
@prefix hua: <https://hetutrechtsarchief.nl/id/> .
hua:D8884A3B2E6CA8F6E0538F04000A374B
a def:Adresvermelding ;
geo:asWKT "POINT (9.1825624999999995 45.4652869999999965)"^^geo:wktLiteral .
PREFIX def: <https://hetutrechtsarchief.nl/def/>
prefix geo: <http://www.opengis.net/ont/geosparql#>
prefix geof: <http://www.opengis.net/def/function/geosparql/>
select ?zoekveld ?match ?x {
?x a def:Adresvermelding ;
geo:asWKT ?match.
bind('Polygon((10 45, 10 46, 9 46, 9 45, 10 45))'^^geo:wktLiteral as ?zoekveld)
filter(geof:sfWithin(?match, ?zoekveld))
}
limit 10
@companje
Copy link
Author

companje commented Aug 16, 2022

Screenshot Milano Point in Polygon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment