Reverse Geocoding in Bulk
If large amounts of positions has to be reverse geocoded, it can be useful to group and process these positions in larger groups. Therefor the xlocate service provides the searchLocationsInBulk operation.
Benefits
Reverse Geocoding several positions with one request has the following benefits:
- Due the less protocol overhead, the network traffic is reduced.
- The possibility to use a asynchronous implementation of the service operation.
Prerequisites
Check if the following prerequisites are fulfilled before you start with the use case:
- Installed and licensed PTV xLocate service
- Installed PTV map data
Programming Guide
// Search for the positions. xlocate.searchLocationsInBulk({ "$type": "SearchByPositionBulkRequest", "coordinates": [{ "x": "6.130490", "y": "49.610400" }, { "x": "6.120758", "y": "49.609820" }] }, searchCompleted); // Process the results. function searchCompleted(response, exception) { if (response.responseItems instanceof Array) { print('Reverse Geocoding succeeded and results for ' + response.responseItems.length + ' addresses found.'); } else { print('Reverse Geocoding failed.'); } }NOTE: Reverse Geocode more than 1000 addresses with one request may require increased xServer memory settings.