Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geof:distance not work with MULTIPOLYGON #845

Open
siwenyang opened this issue Dec 13, 2022 · 3 comments
Open

geof:distance not work with MULTIPOLYGON #845

siwenyang opened this issue Dec 13, 2022 · 3 comments

Comments

@siwenyang
Copy link

Hi there,

I am trying some queries with geosqarl.

In the OSM Germany, I tried query the distance of all Germany provinces to a certain Point(7.85 48.00).

Here is my query:

PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX osm: <https://www.openstreetmap.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX osmkey: <https://www.openstreetmap.org/wiki/Key:>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?region ?name ?dist ?geometry WHERE {
  ?region osmkey:boundary "administrative" .
  ?region osmkey:admin_level "4"^^xsd:int .
  ?region rdf:type osm:relation .
  ?region osmkey:name ?name .
  ?region geo:hasGeometry ?geometry .
  BIND (geof:distance(?geometry, "POINT(7.85 48.00)") AS ?dist) .
}

But all dist result from the query is nan:
qlever_query_example

Could you kindly let me if Qlever support this feature? or it is my query problem?

Thank you so much.

@joka921
Copy link
Member

joka921 commented Dec 16, 2022

Hi,
Your query is perfectly fine, but QLever currently has only very limited support for GeoSPARQL. Most notably, the geof:distance function is only implemented between two points, and not between a point and an arbitrary geometric shape. One our goals is to support more GeoSPARQL, but I can't currently give you an estimate on a realistic timeframe.

@siwenyang
Copy link
Author

Hi there,

Thank you for the reply and information.

Hopefullly, we can see more support on GeoSPARQL soon! It would be great.

@1ec5
Copy link

1ec5 commented Jan 19, 2024

One of the OpenHistoricalMap example queries on the OSM Wiki finds POIs that have moved the farthest over time, with the caveat that the POIs must be mapped as nodes. But distances between polygon or multipolygon centroids would let us enhance the query to find other things that have moved, such as buildings or shops that are typically mapped as areas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants