This web service uses an object’s geographic coordinates to retrieve information contained in the fields of the object in a Geoconcept map. The call to the web service requires as parameters the layer name, the structure of the map and of the field(s) to interrogate.
{ "url":"https://api.geoconcept.com/EU/GCW/geoconcept-web/api/lbs/find/findObject/v2.json", "method":"POST", "body": { "srs":"epsg:4326", "geometries":"1,-5.617883,36.027288", "layerName":"STANDARD", "targets":[ { "className":"Administrative unit", "subClassName":"Order1", "fields":"Name;Government code" }, { "className":"Administrative unit", "subClassName":"Order2", "fields":"Name;Government code" }, { "className":"Administrative unit", "subClassName":"Order8", "fields":"Name;Government code" } ] } }
Input
parameter | description | optional | default |
---|---|---|---|
srs |
projection (EPSG code such as epsg:4326 or wgs84) |
no |
|
geometries |
Coordinates to find (series of Id,X,Y triplets separated by the ";" character) |
no |
|
layerName |
Name of the layer to use |
no |
|
targets |
Properties of searched objects |
no |
Targets
parameter | description | optional | default |
---|---|---|---|
targetID |
Identifier |
yes |
|
className |
Name of the Class |
no |
|
subclassName |
Name of the Subclass |
no |
|
fields |
Name of the fields separated by the ";" character |
no |
|
maxDistance |
Maximum search radius (in meters) |
yes |
|
maxCandidates |
Maximum number of candidates to return |
yes |
Output
parameter | type | min/max | description |
---|---|---|---|
id |
string |
0/1 |
Objects identifier |
targets |
array (Targets Infos) |
0/unlimited |
Objects |
Target Infos (findTargetResult)
parameter | type | min/max | description |
---|---|---|---|
targetID |
string |
0/1 |
Identifier |
objects array (Objects Info) |
string |
0/unlimited |
Object descriptions |
Objects Info
parameter | type | min/max | description |
---|---|---|---|
distance |
integer |
1/1 |
Distance in meters betwen the origin point and the found object |
wktGeometry |
string |
0/1 |
Object geometry |
Case of a response that is found (findObjectsResults/status est OK)
{ "message": null, "status": "OK", "results": [ { "id": "1", "targets": [ { "objects": [ { "distance": 0, "fields": [ "Andalucía", "01" ] } ] }, { "objects": [ { "distance": 0, "fields": [ "Cádiz", "11" ] } ] }, { "objects": [ { "distance": 0, "fields": [ "Tarifa", "11035" ] } ] } ] } ] }
Absence of an object on the position searched (status is OK)
{ "message": null, "status": "OK", "results": [ { "id": "1", "targets": [ { "objects": [] }, { "objects": [] }, { "objects": [] } ] } ] }
Faulty projection / srs (status is ERROR)
An error append : (500) Internal Server Error CoordinateTransformEngineException: Coordinate tranformation failed
Case, absence of an argument for geometries (status est ERROR)
An error append : (500) Internal Server Error IllegalArgumentException: Geometry has too few fields : String[][{1,-45.617883}]
Case of a layer that is not found (status is ERROR)
An error append : (500) Internal Server Error WebServiceException: Layer name 'Europ' does not exist
Case of a Class that is not found (status est ERROR)
An error append : (500) Internal Server Error WebServiceException: Error in finding objects failed to execute text request failed to execute gcis request (text response) failed to execute gcis request exception occured while servicing request Failed to service request com.geoconcept.gc.GcException: native returned exception (code=1) native returned exception [FindObject-88304] unknown type 'Administrative uni'
Case of a Subclass that is not found (status est ERROR)
An error append : (500) Internal Server Error WebServiceException: Error in finding objects failed to execute text request failed to execute gcis request (text response) failed to execute gcis request exception occured while servicing request Failed to service request com.geoconcept.gc.GcException: native returned exception (code=1) native returned exception [FindObject-88305] unknown subtype 'Order'
Case of a field not found (serviceResult/status est ERROR)
An error append : (500) Internal Server Error WebServiceException: Error in finding objects failed to execute text request failed to execute gcis request (text response) failed to execute gcis request exception occured while servicing request Failed to service request com.geoconcept.gc.GcException: native returned exception (code=1) native returned exception [FindObject-88300] unknown field 'Government cod'
- 1. What are the layerName availables?
- 2. What are the className, subClassName and fieds availables?
- 3. Is it possible to use other topological relationships between objects?
- 4. Is it possible to pass several geometries when calling a Web Service?