Filter points within a polygon

105 views Asked by At

i have a problem with GeoSparql.

I set a quadratic polygon and points that are in a database. I want to return the polygon and the points that are in it, using the GeoSparql function sfContains and sfWithin functions but they return 0 results.

prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix geosp: <http://www.opengis.net/ont/geosparql#>
prefix geo-ont: <http://www.opengis.net/ont/sf#>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>

?polygon geosp:asWKT ?polygonCoordinates.
?polygon rdf:type geo-ont:Polygon
?point geosp:asWKT ?pointCoordinates .
?point rdf:type geo-ont:Point .
   # FILTER(geof:sfContains(?polygonCoordinates,  ?pointCoordinates)) .
   # FILTER(geof:sfWithin(?pointCoordinates, ?polygonCoordinates)) .
   # FILTER(geof:sfWithin(?pointCoordinates,"Polygon((41.2858646433522 24.571734341826, 41.5858646433522 24.771734341826 ,41.2858646433522 24.571734341826))"^^geosp:asWKT))

Maybe I'm not building a proper geospatial index. Please give a hint how to solve the problem or explanation where it could be.

Thanks in advance.

Stanko

0

There are 0 answers