geo:path For Journeys - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.7
Category
Reference Guide

Geolocation function can be used to find journeys. This means that the function returns the best results, based on distances between user and journey departure and arrivals points.

The following syntax allows using geo:path function for journey:

geo:path(latA, longA, latB, longB)

User wants to make a journey from point A (latA, longA) to point B (latB, longB). This journey will be compared to all available results. The journey from Y to Z will be the most relevant result because A-Y-Z-B distance will be the shortest.

Usage example:

afs:sort=geo:path(A,B,Y,Z)

It is then possible to filter results on the distance between user departure and arrival points and results departure and arrival points. Example, user departure point at less than 10 km from results' and user arrival point at less than 25 km from results':

afs:filter=geo:dist(A,Y)<10000&geo:dist(B,Z)<250000

Results must have at least four facets values, one for latitude and one for longitude of the first point, one for latitude and one for longitude of the second point.

These values are in decimal degrees. See Decimal Degrees (Wikipedia) for more information. The World Geodetic System used is WGS 84. See World Geodetic System (Wikipedia) for more information.

For more information about configuring these four necessary facets, see Geolocation Facets for geo:path Function part of the AFS v7.7 Configuration Guide.

If geolocation facets have not been configured using default names (geo:lat1, geo:lat2, geo:long1 and geo:long2), the following syntax must be used:

geo:path(lat1, long1, lat2, long2, lat1_facet, long1_facet, lat2_facet, long2_facet)