I'm trying to get the ratio closes to 1, but I cannot seem to be able to find how to do it... This is my code so far:
<testadvarden>
{for $i in 0 to 72
let $latitude := $i
let $iterad := (local:distance(data($latitude)))
return <lista latitud = "{$latitude}" ratio = "{$iterad}" /> }
</testadvarden>
My function distance only returns the ratio. These are the most relevant return values:
<testadvarden>
<lista latitud="26" ratio="1.210681245514598"/>
<lista latitud="27" ratio="1.1472684079724134"/>
<lista latitud="28" ratio="1.108013683878131"/>
<lista latitud="29" ratio="1.0367234044480529"/>
<lista latitud="30" ratio="0.9820439101177922"/>
<lista latitud="31" ratio="0.8714211421572755"/>
<lista latitud="32" ratio="0.7316921947582108"/>
</testadvarden>
So my problem is how to get the given latitud for the ratio closest to 1.