geoadmin/mf-chsdi3 — pull request #865 by procrastinatio (2014-07-15 15:48:52+00:00)
Title: [WIP] Mapproxy service extension

This PR extends the Mapproxy to:

* Serve the same layers set as in WMTS GetCapabilities ('api' and 'api-notfree')
* Layers offered as WMTS
* New projections: etrs89 (epsg:4258), wgs84 (epsg:4326), lv95 (2056) and webmercator (epsg:3857)
* Only the latest timestamp is available (MapProxy limitation)

1/ Installation

./buildout/bin/buildout -c buildout_.cfg install mapproxy-config && sudo apache2ctl graceful

Note: the MapProxy config file 'mapproxy.yaml' is not stored in git, as it as to be in sync with the layer
list from the BOD.

2/ URL Scheme

As close to the native tiles, saving the hostname:

http://{hostname}{apache_entry_point}/1.0.0/ch.swisstopo.pixelkarte-grau/default/20130903/3857/9/268/180.jpeg

With {hostname} api3.geo.admin.ch or its aliases

We use an unique 'TileMatrixSet' name, as for native tiles.

The OGC WMTS Specification allow the use of a keyword 'default' for the default value of a dimension:

http://{hostname}{apache_entry_point}/1.0.0/ch.swisstopo.pixelkarte-grau/default/default/3857/9/268/180.jpeg

3/ GetCapabilities

The Mapproxy generated WMTS Capabilities is not used.

We use the standard service to deliver the WMTS Capabilities. It has however been split by 'TileMatrixSet', which has two advantages:

* The document is smaller
* No mod rewriting at varnish level (this is done at apache level, so behing the cache)

* Native tiles (no changes)

http://{hostname}{apache_entry_point}/1.0.0/WMTSCapabilities.xml

and the ressource url:

* Reprojected tiles (use a 'custom' parameter 'epsg')

http://{hostname}{apache_entry_point}/1.0.0/WMTSCapabilities.xml?epsg=3857

and the ressource url:

**No change at varnish level**

4/ Security

Same as the native WMTS tiles (Varnish based)

5/ Performance

Needs to carefully reviewed as this service may be potentially very popular. Various cache settings also need to be assets.

6/ Compatibility

Tested with some popular tools:
* JS library like OL2, OL3 and Leaflet. Only OL2 can parse the WMTS GetCapabilities document and use it to configure a new layer (see _examples/ol3_mercator.html_)
* Desktop GIS: QGIS 2.0+ and ArcMAp 10.2.1+ are able to configure a map from theses GetCapabilities document