X <http://franz.com/ns/allegrograph/5.0/geo/nd/fn#haversineLatLonLatLon>
( lat1 lon1 lat2 lon2 &rest rest )
Returns the haversine distance between <lat1
, lon1
> and <lat2
, lon2
>. lat1
, lon1
, lat2
, and lon2
specify two points in spherical coordinates and must be bound to numeric values.
For example:
PREFIX ndfn: <http://franz.com/ns/allegrograph/5.0/geo/nd/fn#>
PREFIX : <http://franz.com/ns/keyword#>
SELECT * {
bind(ndfn:haversineLatLonLatLon(38.889, -77.035, 38.889, -77.050, :km) as ?distance)
}
An optional fifth argument may be
Notes
The following namespace abbreviations are used:
- fti - <http://franz.com/ns/allegrograph/2.2/textindex/>
- geo - <http://franz.com/ns/allegrograph/3.0/geospatial/>
- geofn - <http://franz.com/ns/allegrograph/3.0/geospatial/fn/>
- nd - <http://franz.com/ns/allegrograph/5.0/geo/nd#>
- ndfn - <http://franz.com/ns/allegrograph/5.0/geo/nd/fn#>
- sna - <http://franz.com/ns/allegrograph/4.11/sna/>
The SPARQL magic properties reference has additional information on using AllegroGraph magic properties and functions.