This web service returns the geometry of objects in geojson format, filtered by layer, and optionally by bounding box. Available only for vector type layers (cf. the web service for the list of layers).
This web service is available with Geoconcept Web by setting the services.activate.getFeatures parameter to true (cf. advanced settings section).
Input
parameter | description | optional | default |
---|---|---|---|
layerId |
Vector layer identifier |
no |
|
bbox |
The filter bounding box must be in the same projection as the objects. |
yes |
Output
parameter | type | min/max | description |
---|---|---|---|
message |
string |
1/1 |
"Get geojson features" |
status |
string |
1/1 |
"OK" or "ERROR" |
result |
array |
0/unlimited |
Result |
Result (result)
parameter | type | min/max | description |
---|---|---|---|
id |
string |
1/1 |
null |
geojson |
string |
1/1 |
geojson |
pagination |
string |
1/1 |
null |
sort |
string |
1/1 |
null |
distinctValues |
string |
1/1 |
null |
fields |
array |
0/unlimited |
Description of fields used in the geojson |
Description of fields used in the geojson (fields)
parameter | type | min/max | description |
---|---|---|---|
name |
string |
1/1 |
Fieldname for the field in the database. |
alias |
string |
1/1 |
Alias for the field. |
type |
string |
1/1 |
Field typing. |
Query
Query
http://<server>/<webapp>/api/lbs/layers/getFeatures
Data (JSON)
{ "layerId":"136", "bbox":"-262000,5982000,-258000,5988000" }
Response
The response is always coded in UTF-8.
JSON format
{ "message":"Get geojson features", "status":"OK", "result":{ "id":null, "geojson":"{[geojson]}", "pagination":null, "sort":null, "distinctValues":null, "fields":[ { "name":"co_insee_com", "alias":"city_code", "type":"Integer" }, { "name":"lb_com", "alias":"city", "type":"String" }, { "name":"lb_voie_ext", "alias":"street", "type":"String" }, { "name":"va_no_voie", "alias":"number", "type":"Integer" } ] } }
Geojson
{ "type":"FeatureCollection", "features":[ { "type":"Feature", "geometry":{ "type":"Point", "coordinates":[ -258650.09, 5982645.79 ] }, "properties":{ "co_insee_com":"44132", "lb_com":"PORNICHET", "lb_voie_ext":"AVENUE DE BONNE SOURCE", "va_no_voie":"150" }, "id":"gw_sample_point.A5U8T4" }, [...] } ] }
The case of a layer being absent
{"message":null,"status":"ERROR","result":{"id":null,"geojson":null,"pagination":null,"sort":null,"distinctValues":null,"fields":null}}
the case of a faulty Bounding box
{"message":"Error to get feature source : gw_sample_point","status":"ERROR","result":{"id":null,"geojson":null,"pagination":null,"sort":null,"distinctValues":null,"fields":null}}