Open
Description
Version
5.4
Question
Hello,
I'm trying to run this query:
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX uom: <http://www.opengis.net/def/uom/OGC/1.0/>
# Test GeoSPARQL distance calculation between two cities
SELECT ?city1 ?city2 ?distance_km WHERE { # Define test points with EPSG:4326 (WGS84) coordinate reference system
VALUES (?city1 ?point1 ?city2 ?point2) {
("London" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(-0.1276 51.5074)"^^geo:wktLiteral "Paris" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(2.3522 48.8566)"^^geo:wktLiteral)
("New York" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(-74.0060 40.7128)"^^geo:wktLiteral "Boston" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(-71.0588 42.3601)"^^geo:wktLiteral)
("Amsterdam" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(4.9041 52.3676)"^^geo:wktLiteral "Brussels" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(4.3517 50.8503)"^^geo:wktLiteral)
}
# Calculate distance in kilometers
BIND(geof:distance(?point1, ?point2, uom:metre) / 1000 AS ?distance_km)
}
ORDER BY ?distance_km
On an jena fuseki geosparql instance in which I have defined the SIS_DATA variable to a writeable folder.
The result is an empty field for the ?distance_km variable. While this query works well on the AKSW endpoint.
When I replace
BIND(geof:distance(?point1, ?point2, uom:metre) / 1000 AS ?distance_km)
with:
BIND(geof:distance(?point1, ?point2, uom:degree) / 1000 AS ?distance_km)
The field is not empty anymore, but degrees is not what I need :).
I'm thinking this might have something to do with another problem that I experience. The geof:transform
function doesn't seem to work either. Is this related?
Thank you!