Run…
let $opt := map { "lax": true() } return json:parse('{ "coords":{ "gml:Point":{ "gml:coordinates":"0,0" } } }', $opt )/json/coords/*
…and I’m pretty sure you’ll see what is wrong if you compare the result with the examples in the documentation (http://docs.basex.org/wiki/Geo_Module#geo:distance).
On Fri, Nov 24, 2017 at 5:31 PM, E. Wray Johnson wray.johnson@gmail.com wrote:
What is wrong with this code?
import module namespace geo = 'http://expath.org/ns/geo'; declare namespace gml='http://www.opengis.net/gml';
let $opt := map { "lax": true() } let $y := json:parse('{ "coords":{ "gml:Point":{ "gml:coordinates":"0,0" } } }', $opt )
let $x := json:parse('{ "coords":{ "gml:Point":{ "gml:coordinates":"-123.45,45.343" } } }', $opt )
return geo:distance($x/json/coords/*, $y/json/coords/*)