Skip to content

Commit

Permalink
Allow applying dimensions through WMS FILTER parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-morvan committed Aug 13, 2018
1 parent 1daa42a commit d2ac0a8
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
40 changes: 37 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,42 @@ The additional value needed by the WMS is the URL of the server and the ``layers

The previously defined ``mime_type`` is also used in the WMS requests.

To customise the request you also have the attributes ``params``, ``headers``
To customise the request you also have the attributes ``filter``, ``params``, ``headers``
and ``generate_salt``.

In ``filter`` you can specify a filter parameter for the layer. It behave like a template, populated with other params.
This allow applying a WMS filter for dimension value.

QGIS expression filter example:

.. code-block:: yaml
layers:
layer_name:
type: wms
url: https://localhost/qgis_mapserv
layers: layer1,layer2
filter: layer1:\"floor\" = '{floor}';
layer2:\"floor\" = '{floor}'"
OGC filter example:

.. code-block:: yaml
layers:
layer_name:
type: wms
url: https://localhost/qgis_mapserv
layers: layer1,layer2
filter: "\
(<Filter>\
<PropertyIsEqualTo>\
<PropertyName>floor</PropertyName>\
<Literal>{FLOOR}</Literal>\
</PropertyIsEqualTo>\
</Filter>)\
()"
In ``params`` you can specify additional parameter of the WMS request,
in ``headers`` you can modify the request headers. In ``version``, you can change the WMS version. See the
`Proxy/cache issue`_ for additional informations.
Expand Down Expand Up @@ -531,9 +565,9 @@ Alternate mime type
By default TileCloud support only the ``image/jpeg`` and ``image/png`` mime type.


----------------
---------------
Amazon services
----------------
---------------

Authentication
--------------
Expand Down
1 change: 1 addition & 0 deletions tilecloud_chain/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def _get_tilestore_for_layer(self, layer):
border=layer['meta_buffer'] if layer.get('meta', False) else 0,
tilegrid=self._gene.get_grid(layer)['obj'],
params=params,
filter=layer['filter']
),),
headers=layer['headers'],
)
Expand Down
2 changes: 2 additions & 0 deletions tilecloud_chain/schema-layer-wms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ mapping:
layers:
type: str
required: true
filter:
type: str
url:
type: str
required: true
Expand Down

0 comments on commit d2ac0a8

Please sign in to comment.