...
the syntax and indentation shown in the example file and in the MapProxy documentation should be followed exactly in order to avoid errors
any errors will be recorded in the
mapproxy.log
file, which is normally in the same folder as themapproxy.yaml
fileyou will need to make sure that any referenced folders are accessible by the MapProxy IIS application pool, and that the MapServer application pool has access to the source data and images
The MapProxy demo application is useful for testing MapProxy layers. The live MapProxy demo is accessible via http://localhost:83/demo; the test MapProxy demo is at http://localhost:84/demo.
Detailed Configuration
Layers
...
Code Block |
---|
layers:
- name: aerial2013
title: Aerial 2013
sources: [aerial2013_cache]
- name: aerial2018
title: Aerial 2018
sources: [aerial2018_cache]
- name: basemap
title: Colour
sources: [basemap_cache] |
Caches
This section defines the location of the cached data. The cache reference in the first line is referenced by the layers section, and the cache also identifies the source of the data.
...
grid: a reference to a grid definition elsewhere in the YAML file
sources: a reference to one or more source sections - if this is a MapServer WMS, the source includes both the reference to the source name in the YAML file (e.g.
aerial_wms_2013
) and the name of the layer or group in the map file (e.g.aerial2013
)cache: details of the cache itself, containing
type: the type of cache storagefilename: the location of the cache
Code Block |
---|
caches: aerial2013_cache: grids: [grid_gb] sources: ['aerial_wms_2013:aerial2013'] cache: type: mbtiles filename: E:\Tiles\aerial2013.mbtiles aerial2018_cache: grids: [grid_gb] sources: ['aerial_wms_2018:aerial2018'] |
As we have not specified a cache type or location the default file cache will be used. The location of the tiles is found at the bottom of mapproxy.yaml
and should look something like this:
Code Block | ||
---|---|---|
| ||
globals: cache: type: mbtiles filename base_dir: E:\Tiles\aerial2018.mbtilesLive |
Sources
This section defines the source of the data to be displayed and cached. It will contain one or more sources, of which a single layer can reference one or more. The first line of the source will be used in the sources section of the layer as a reference. Each source will also have:
type: the type of source being referenced
wms: for example a MapServer layer configured in Studio, or an external WMS
tile: for example an existing tilecache on an iShare or WMTS server
grid: a reference to a grid definition elsewhere in the YAML file
url: the location for the tilecache or WMS
...
origin: the origin point of the grid in relation to the grid area - the default is sw
srs: the coordinate reference system/spatial reference system being used by the data, using the EPSG code
bbox: the bounding box of the grid, i.e. the extent of the data, using the units specified in bbox_srs
bbox_srs: the SRS of the units specified in bbox
res: the resolutions that MapProxy will cache - see the section below on Adding Scales for more detail on this.
Code Block |
---|
grids: grd_os_raster_road grid_gb: origin: nw srs: 'EPSG:27700' bbox: [-238375.0,0.0,900000.0,1376256.0]700000,1300000] bbox_srs: 'EPSG:27700' res: [896.0, 448.0, 224.0, 112.0, 56.0, 28.0, 14.0, 7.0, 3.5, 1.7572,37.99999999999999,25,16.666607646976313,8,5.291747064678806,3.528118349260536,2.116774531941753,1.0586554968815869,0.5,0.25,0.125] origin: sw |
Adding Scales
The default scales may not cover the range of scales you wish to provide for your basemap, and MapProxy can help with this. The cache upscale_tiles
as described in the cache documentation can scale tiles up depending on your requirements.
...