Returns the distance between two points or the distance of a route.

Each register of the resultset indicates a point of the route.

The column 1 of the resultset must contain the latitude and the column 2 the length of the point.

1 geo.getRouteDistance

<geo.getRouteDistance>
    <lat1 /> +
    <lng1 /> +
    <lat2 /> +
    <lng2 /> +
    <rs /> +
</geo.getRouteDistance>

Remarks

The arguments must be 4 numbers indicating the latitude and length of the points 1 and 3 or a ResultSet.

Example

Calculate the distance in meters of a route.

Copy
<xsql-script>
    <body>      
        <return>
            <geo.getRouteDistance >
            <select>
                <columns> lat, lng </columns>
                <from table='mships' />
            </select>
            </geo.getRouteDistance>     
        </return>
    </body>
</xsql-script>
Example

Distance in meters between Barcelona and Girona:

Copy
<xsql-script>
   <body>      
       <return>
           <geo.getRouteDistance >
               <number>41.383333</number>  <!-- bcn -->
               <number>2.183333</number>
               <number>41.984444 </number>   <!-- girona -->
               <number>2.821111</number>
           </geo.getRouteDistance>     
       </return>
   </body>

</xsql-script>