The Presentation API includes methods that you can use for geospatial sorting.

The ERecSortKey class is used to specify all sort keys, including geocode sort keys.

To create a geocode sort key, use the four-parameter constructor:

ERecSortKey(String propertyName,
            boolean isAscending,
            double latitude,
            double longitude);

An ERecSortKey has accessor methods for the latitude and longitude of the reference location:

Note that calling these methods on a non-geocode sort key causes an error.

The type of sort key (GEOCODE_SORT_KEY or ALPHA_NUM_SORT_KEY) can be determined using the getType() method (Java) or the Type property (.NET).

The code samples below show the use of the accessor methods.

Although you can implement sorting without first retrieving a list of valid sorting keys from the result object, this approach requires that the application have its parameters coordinated properly with the MDEX Engine. The application will have the Ns parameters hard-coded, and will rely on the MDEX Engine to have corresponding parameters. If a navigation request is made with an invalid Ns parameter, that request returns an error from the MDEX Engine.




Copyright © Legal Notices