geoadmin/mf-chsdi3 — pull request #1135 by procrastinatio (2014-11-25 09:08:37+00:00)
Title: [WIP] Service 'query' on layers

This is the service part for the layer attributes search.

It is based on the _ArcGIS REST API_,

http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Query_Feature_Service_Layer/02r3000000r1000000/

1/ Layer attributes informations

The type of attribute and its translation (if present) is also returned:

http://mf-chsdi3.int.bgdi.ch/mom_query_attributes/rest/services/api/MapServer/ch.bafu.bundesinventare-bln

```
{
fields: [{
alias: "bln_name",
type: "TEXT",
name: "bln_name"
}, {
alias: "bln_obj",
type: "INTEGER",
name: "bln_obj"
}, {
alias: "bln_fl",
type: "NUMERIC",
name: "bln_fl"
}],
id: "ch.bafu.bundesinventare-bln",
name: "IFP"
}
```

2/ Query attributes

For now only the **where** and **geometry** are implemented.

**where**
[objects with surface > 100](http://mf-chsdi3.int.bgdi.ch/mom_query_attributes/rest/services/api/MapServer/ch.bafu.bundesinventare-bln/query?where=bln_fl < 100 )

[objects with name like 'Domat'](http://mf-chsdi3.int.bgdi.ch/mom_query_attributes/rest/services/api/MapServer/ch.bafu.bundesinventare-bln/query?where=bln_name ilike '%Domat%')

[object combining both filters](http://mf-chsdi3.int.bgdi.ch/mom_query_attributes/rest/services/api/MapServer/ch.bafu.bundesinventare-bln/query?where=bln_fl < 50 and bln_name ilike '%Domat%')

Spatial filter (**geometry**, a geojson object)

[objects within a geometry](http://mf-chsdi3.int.bgdi.ch/mom_query_attributes/rest/services/api/MapServer/ch.bakom.mobil-antennenstandorte-gsm/query?where=powercode%20like%27%%27&geometry={%22type%22:%20%22MultiPolygon%22,%20%22coordinates%22:%20[[[[600000,%20200000],%20[620000,%20200000],[620000,%20220000],[600000,%20220000],[600000,%20200000]%20]]]})