Hi! For example, it's need to get the distance between Berlin and London, which is 934 km.
So I've put the coordinates as they can be found in Google Maps, etc.:
let $berlin := gml:Point gml:coordinates52.519881,13.407338</gml:coordinates> </gml:Point> let $london := gml:Point gml:coordinates51.507351,-0.12766</gml:coordinates> </gml:Point> return geo:distance($berlin, $london)
And the result is 13.572817977888896
Also I had trying to change srsName attribute of gml:Point's to different values like "3857", "EPSG:3857" (it's uses meter units as mentioned here https://epsg.io/3857), but practically this changes nothing. Thanks.
вт, 26 февр. 2019 г. в 19:33, Michael Seiferle ms@basex.org:
Hi Jacob,
I’ve never really used the geo:module but according to the documentation:
in the units of the spatial reference system of geometry1
If I understand it correctly, you would have to convert your coordinates to map them to miles or kilometers for example.
Maybe you can provide an example?
Given this very simple query:
import module namespace geo = "http://expath.org/ns/geo"; declare namespace gml='http://www.opengis.net/gml'; let $point1 :=gml:Pointgml:coordinates1,1</gml:coordinates></gml:Point> let $point2 := gml:Pointgml:coordinates2,2</gml:coordinates></gml:Point> return geo:distance($point1, $point2)
The result is math:sqrt(2), the length of a straight line from P(1,1) — P’(2,2) but this length does not contain any unit of measurement.
Best Michael
Am 26.02.2019 um 12:12 schrieb Jacob Borisov jacobborisov@gmail.com:
Hello. Could anybody explain how to get a result from geo:distance() in kilometers or miles? Thanks.