This web service allows you to classify a list of resources positioned around a particular point in terms of distance or time. It takes as input a start point (in this case, the target location) and a list of resources with their geographic locations, plus a priority category of either 1 or 2 (this is an optional parameter). The resources are records saved in a database of the user’s choice, depending on their requirements. It is the allotted task of the client to select these resources in the database. The resources are returned sorted firstly on the attribute priority1, and then by time or distance (according to which has been chosen). The priorities are optional. The default value of the priorities is 0. This depends on the configured graph, the name of which has been specified in the Geoconcept Web administration interface.
{ "url": "https://api.geoconcept.com/EU/GCW/geoconcept-web/api/lbs/searchAround/v4.json", "method": "POST", "body": { "location": { "x": -1.553927, "y": 47.21858 }, "resources": [ { "id": "1", "x": -1.593927, "y": 47.18858, "priority1": 1, "priority2": 1 }, { "id": "2", "x": -1.556927, "y": 47.21958, "priority1": 2, "priority2": 1 } ], "method": "time", "reverse": "false" } }
Input
parameter | description | optional | default |
---|---|---|---|
location |
Coordinates of the start point (or arrival point) |
no |
|
method |
Method to compute the route between the start point and the resources: |
yes |
time |
reverse |
if true, the location point is considered as an arrival |
yes |
false |
srs |
projection (EPSG code such as epsg:4326 or wgs84) |
yes |
epsg:4326 |
exclusions |
List of restriction rules to use, separated by the ; character |
yes |
|
resources |
List of resources, separated by ";" characters. |
yes |
|
startDateTime |
Start date and time (format ISO8601: local time) example: 2014-01-21T09:00:00.000+01:00 (or 2014-01-21T09:00:00.000%2B01:00) for a start on 21 January 2014, at 9.00am in Paris |
yes |
|
snapMethod |
Snap to graph method |
yes |
standard |
avoidArea |
Forbidden transit zone in WKT format (POLYGON or MULTIPOLYGON) in the requested projection (srs parameter) |
yes |
|
configName |
Name of the configuration to use: |
yes |
|
computeOptions |
Selection of variables to use in calculations, using semi-colons ; as separators: |
yes |
(*) At least one of the two parameters location, and locationNode must be entered.
Output
Search Around
parameter | type | min/max | description |
---|---|---|---|
location |
couple of double, separated with a comma |
0/1 |
Coordinates of the start point (or arrival point). The longitude and latitude coordinates are separated by the , character. |
method |
string |
0/1 |
Specified input method (time, distance or flying), and time by default. |
srs |
string |
0/1 |
Input projection specified. |
exclusions |
string |
0/unlimited |
List of rules for specified input restrictions |
searchAroundResult |
Array of SearchAroundElement |
0/unlimited |
List of results for each candidate. |
Search Around element (SearchAroundElement)
parameter | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
Candidate identifier |
distanceMeters |
double |
1/1 |
Distance in meters |
durationSeconds |
double |
1/1 |
Time in seconds |
Case of a proximity search finding(searchAroundResponse/status is OK)
{ "message": null, "status": "OK", "location": "-1.553927,47.21858", "locationNode": null, "method": "TIME", "srs": "epsg:4326", "exclusions": [], "searchAroundResult": [ { "id": "1", "distanceMeters": 6681, "durationSeconds": 877 }, { "id": "2", "distanceMeters": 425, "durationSeconds": 100 } ] }
Case of a snap-to-graph error (searchAroundResponse/status is OK)
{ "message": null, "status": "OK", "location": "47.21858,-1.553927", "locationNode": null, "method": "TIME", "srs": "epsg:4326", "exclusions": [], "searchAroundResult": [ { "id": "1", "distanceMeters": -1, "durationSeconds": -1 }, { "id": "2", "distanceMeters": -1, "durationSeconds": -1 } ] }
Case of an absent location parameter (searchAroundResponse/status is ERROR)
{ "message":"Location must be not null", "status":"ERROR", "location":null, "locationNode":null, "method":null, "srs":null, "exclusions":[], "searchAroundResult":[] }
Case of an incomplete location parameter, or one with the wrong separator (searchAroundResponse/status is ERROR)
{ "message": "Location point must have 2 components separated with a ,", "status": "ERROR", "location": null, "locationNode": null, "method": null, "srs": null, "exclusions": [], "searchAroundResult": [] }
Case of the absence of a resource (searchAroundResponse/status is ERROR)
{ "message":"resources not defined", "status":"ERROR", "location":null, "locationNode":null, "method":null, "srs":null, "exclusions":[], "searchAroundResult":[] }
Case of a badly formatted resource (searchAroundResponse/status is ERROR)
{ "message":"ServiceException: not enough fields in candidate 1,-1.59392", "status":"ERROR" }
- 1. Is it possible to give priority to either journey time or journey distance?
- 2. How does one structure the classification of returned addresses, in relation to the distance, the time, and to priorities generally?
- 3. What format should the priority take and is it possible to define a classification order? (increasing/decreasing)
- 4. If just one address in the list has a priority of 0, is the priority taken into account for one of the addresses in the list?
- 5. How do you perform a search around calculation without including any road tolls?
- 6. What are the maximum values allowed by predefined configName?
- 7. What are the exclusions available?
- 8. What are the Hazardous material exclusions?
- 9. What are Speed Patterns? How are they used?
- 10. How do you use heavy goods vehicle attributes?