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>
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Elat1 | decimal | Latitude of the point 1. | |||
Elng1 | decimal | Length of the point 1. | |||
Elat2 | decimal | Latitude of the point 2. | |||
Elng2 | decimal | Length of the point 2. | |||
Ers | Resultset | Resultset with the columns latitude and length. |
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>