mapproxy-util-autoconfig(1)

NAME
mapproxy-util-autoconfig - creates MapProxy and MapProxy-seeding configurations

SYNOPSIS
\FCmapproxy-util autoconfig\F[]
[OPTIONS]

DESCRIPTION
mapproxy-util autoconfig creates MapProxy and MapProxy-seeding configurations based on existing WMS capabilities documents.

It creates a \FCsource\F[] for each available layer. The source will include a BBOX coverage from the layer extent, \FClegendurl\F[] for legend graphics, \FCfeatureinfo\F[] for querlyable layers, scale hints and all detected \FCsupported_srs\F[]. It will duplicate the layer tree to the \FClayers\F[] section of the MapProxy configuration, including the name, title and abstract.

The tool will create a cache for each source layer and \FCsupported_srs\F[] if there is a grid configured in your \FC--base\F[] configuration for that SRS.

The MapProxy layers will use the caches when available, otherwise they will use the source directly (cascaded WMS).
    Note

    The tool can help you to create new configations, but it can’t predict how you will use the MapProxy services. The generated configuration can be highly inefficient, especially when multiple layers with separate caches are requested at once. Please make sure you understand the configuration and check the documentation for more options that are useful for your use-cases.

OPTIONS

\FC--capabilities\F[] url|filename
    URL or filename of the WMS capabilities document. The tool will add \FCREQUEST\F[] and \FCSERVICE\F[] parameters to the URL as necessary.

\FC--output\F[] filename
    Filename for the created MapProxy configuration.

\FC--output-seed\F[] filename
    Filename for the created MapProxy-seeding configuration.

\FC--force\F[]
    Overwrite any existing configuration with the same output filename.

\FC--base\F[] filename
    Base configuration that should be included in the \FC--output\F[] file with the \FCbase\F[] option.

\FC--overwrite\F[] filename, \FC--overwrite-seed\F[] filename
    YAML configuration that overwrites configuration options before the generated configuration is written to \FC--output\F[]/\FC--output-seed\F[].

  EXAMPLE
Print configuration on console:

\FC
mapproxy-util autoconfig \
    --capabilities http://osm.omniscale.net/proxy/service
      \F[]

Write MapProxy and MapProxy-seeding configuration to files:

\FC
mapproxy-util autoconfig \
    --capabilities http://osm.omniscale.net/proxy/service \
    --output mapproxy.yaml \
    --output-seed seed.yaml
      \F[]

Write MapProxy configuration with caches for grids from \FCbase.yaml\F[]:

\FC
mapproxy-util autoconfig \
    --capabilities http://osm.omniscale.net/proxy/service \
    --output mapproxy.yaml \
    --base base.yaml
      \F[]

OVERWRITES
It's likely that you need to tweak the created configuration - e.g. to define another coverage, disable featureinfo, etc. You can do this by editing the output file of course, or you can modify the output by defining all changes to an overwrite file. Overwrite files are applied every time you call mapproxy-util autoconfig.

Overwrites are YAML files that will be merged with the created configuration file.

The overwrites are applied independently for each \FCservices\F[], \FCsources\F[], \FCcaches\F[] and \FClayers\F[] section. That means, for example, that you can modify the \FCsupported_srs\F[] of a source and the tool will use the updated SRS list to decide which caches will be configured for that source.

  EXAMPLE
Created configuration:

\FC
sources:
  mysource_wms:
    type: wms
    req:
        url: http://example.org
        layers: a
      \F[]

Overwrite file:

\FC
sources:
  mysource_wms:
    supported_srs: ['EPSG:4326'] # add new value for mysource_wms
    req:
        layers: a,b  # overwrite existing value
        custom_param: 42  #  new value
      \F[]

Actual configuration written to \FC--output\F[]:

\FC
sources:
  mysource_wms:
    type: wms
    supported_srs: ['EPSG:4326']
    req:
        url: http://example.org
        layers: a,b
        custom_param: 42
      \F[]

  SPECIAL KEYS
There are a few special keys that you can use in your overwrite file.

All The value of the \FC__all__\F[] key will be merged into all dictionaries. The following overwrite will add \FCsessionid\F[] to the \FCreq\F[] options of all \FCsources\F[]:

    \FC
    sources:
      __all__:
        req:
          sessionid: 123456789
                  \F[]

Extend
    The values of keys ending with \FC__extend__\F[] will be added to existing lists.

    To add another SRS for one source:

    \FC
    sources:
        my_wms:
          supported_srs__extend__: ['EPSG:31467']
                  \F[]

Wildcard
    The values of keys starting or ending with three underscores (\FC___\F[]) will be merged with values where the key matches the suffix or prefix.

    For example, to set \FClevels\F[] for \FCosm_webmercator\F[] and \FCaerial_webmercator\F[] and to set \FCrefresh_before\F[] for \FCosm_webmercator\F[] and \FCosm_utm32\F[]:

    \FC
    seeds:
        ____webmercator:
            levels:
              from: 0
              to: 12

        osm____:
            refresh_before:
                days: 5
                  \F[]