Reference

mapproxy-util-autoconfig(1)

creates MapProxy and MapProxy-seeding configurations

NAME

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

SYNOPSIS

FCmapproxy-util autoconfigF[0] [OPTIONS]

DESCRIPTION

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

It creates a FCsourceF[0] for each available layer. The source will include a BBOX coverage from the layer extent, FClegendurlF[0] for legend graphics, FCfeatureinfoF[0] for querlyable layers, scale hints and all detected FCsupported_srsF[0]. It will duplicate the layer tree to the FClayersF[0] section of the MapProxy configuration, including the name, title and abstract.

The tool will create a cache for each source layer and FCsupported_srsF[0] if there is a grid configured in your FC--baseF[0] 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--capabilitiesF[0] url|filename

URL or filename of the WMS capabilities document. The tool will add FCREQUESTF[0] and FCSERVICEF[0] parameters to the URL as necessary.

FC--outputF[0] filename

Filename for the created MapProxy configuration.

FC--output-seedF[0] filename

Filename for the created MapProxy-seeding configuration.

FC--forceF[0]

Overwrite any existing configuration with the same output filename.

FC--baseF[0] filename

Base configuration that should be included in the FC--outputF[0] file with the FCbaseF[0] option.

FC--overwriteF[0] filename, FC--overwrite-seedF[0] filename

YAML configuration that overwrites configuration options before the generated configuration is written to FC--outputF[0]/FC--output-seedF[0].

EXAMPLE

Print configuration on console:

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

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[0]

Write MapProxy configuration with caches for grids from FCbase.yamlF[0]:

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

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 FCservicesF[0], FCsourcesF[0], FCcachesF[0] and FClayersF[0] section. That means, for example, that you can modify the FCsupported_srsF[0] 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[0]

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[0]

Actual configuration written to FC--outputF[0]:

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

SPECIAL KEYS

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

All

The value of the FC__all__F[0] key will be merged into all dictionaries. The following overwrite will add FCsessionidF[0] to the FCreqF[0] options of all FCsourcesF[0]:

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

Extend

The values of keys ending with FC__extend__F[0] will be added to existing lists.

To add another SRS for one source:

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

Wildcard

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

For example, to set FClevelsF[0] for FCosm_webmercatorF[0] and FCaerial_webmercatorF[0] and to set FCrefresh_beforeF[0] for FCosm_webmercatorF[0] and FCosm_utm32F[0]:

FC
seeds:
    ____webmercator:
        levels:
          from: 0
          to: 12
    osm____:
        refresh_before:
            days: 5
              F[0]

History