I am new to geosparql, I try to measure distances between location on earth. My training sample is a simple `turtle` file derived from a `graphDB` example. It contains two points only, one in Paris the other in Lyon referenced in `EPG:2154`. :
I compute the distance with the following request :
OGC/1.0/>
PREFIX qudt: <http://qudt.org/vocab/unit/>
SELECT DISTINCT ?o1 ?o2 ?dist (geof:distance(?o1, ?o2, uom:metre) as ?dist) WHERE {
ex:WMPoint geo:asWKT ?o1 .
ex:APPoint geo:asWKT ?o2 .
}
The answer is [ answer : "395913.0575631152"^^xsd:double] . If I change the value of (geof:distance(?o1, ?o2, uom:metre) as ?dist) I am stuck with the following situations :
with
(geof:distance(?o1, ?o2, uom:meter) as ?dist)-> empty replywith
(geof:distance(?o1, ?o2) as ?dist)-> crazy reply ["4.017890202637487"^^xsd:double]with
(geof:distance(?o1, ?o2, qudt:M) as ?dist)-> empty replywith
(geof:distance(?o1, ?o2, qudt:KiloM) as ?dist)-> empty reply
Is that a normal behavior ? Am I using qudt in a wrong way or graphDB is it not able to use qudt ? I have also tried to compute distance in meters with (lon,lat) coordiantes in default CRS CRS:84 but it failed and I get an empty answer or degree/crazy answer. Is there a way to obtain from geosparql request with (lon,lat) values an answer in kilometers ? Thanks.
So you cannot use qudt:M or qudt:KiloM. To convert to km, just divide by 1000
I thought the crazy reply "4.017890202637487" is degrees latitude. But according to https://sciencing.com/convert-distances-degrees-meters-7858322.html, a degree latitude is 111,139 m, so your distance would be 3.56232285696 degrees. I'll post a bug
Also, I'll post a doc bug: the units allowed with
geof:distanceshould be documented at