'\" -*- coding: UTF-8 -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH mapproxy-util 1 "13 April 2023" "" "" .SH NAME mapproxy-util \- commandline tool for MapProxy .SH SYNOPSIS 'nh .fi .ad l \fBmapproxy-util\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \fB\fIsubcommand\fB\fR [\fIOPTIONS\fR] 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBmapproxy-util\fR provides sub-commands that are helpful when working with MapProxy. .PP To get a list of all sub-commands call: .nf \*(T< \fBmapproxy\-util\fR \*(T> .fi .PP To call a sub-command: .nf \*(T< \fBmapproxy\-util \fIsubcommand\fB\fR \*(T> .fi .PP Each sub-command provides additional information: .nf \*(T< \fBmapproxy\-util \fIsubcommand\fB\fR \fB\-\-help\fR \*(T> .fi .PP The current sub-commands are: .TP 0.2i \(bu create .TP 0.2i \(bu serve-develop .TP 0.2i \(bu serve-multiapp-develop .TP 0.2i \(bu scales .TP 0.2i \(bu wms-capabilities .TP 0.2i \(bu grids .TP 0.2i \(bu export .TP 0.2i \(bu autoconfig (see \fBmapproxy-util-autoconfig\fR(1)) .SH CREATE This sub-command creates example configurations for you. There are templates for each configuration file. .TP \*(T<\fB\-l\fR\*(T>, \*(T<\fB\-\-list\-templates\fR\*(T> List names of all available configuration templates. .TP \*(T<\fB\-t\fR\*(T> \fIname\fR, \*(T<\fB\-\-template\fR\*(T> \fIname\fR Create a configuration with the named template. .TP \*(T<\fB\-f\fR\*(T> \fImapproxy.yaml\fR, \*(T<\fB\-\-mapproxy\-conf\fR\*(T> \fImapproxy.yaml\fR The path to the MapProxy configuration. Required for some templates. .TP \*(T<\fB\-\-force\fR\*(T> Overwrite any existing configuration with the same output filename. .SS "CONFIGURATION TEMPLATES" Available templates are: .TP base-config: Creates an example \*(T<\fImapproxy.yaml\fR\*(T> and \*(T<\fIseed.yaml\fR\*(T> file. You need to pass the destination directory to the command. .TP log-ini: Creates an example logging configuration. You need to pass the target filename to the command. .TP wsgi-app: Creates an example server script for the given MapProxy configuration (\*(T<\fB\-\-f\fR\*(T>/\*(T<\fB\-\-mapproxy\-conf\fR\*(T>). You need to pass the target filename to the command. .SS EXAMPLE .nf \*(T< \fBmapproxy\-util create\fR \fB\-t\fR base\-config ./ \*(T> .fi .SH SERVE-DEVELOP This sub-command starts a MapProxy instance of your configuration as a stand-alone server. .PP You need to pass the MapProxy configuration as an argument. The server will automatically reload if you change the configuration or any of the MapProxy source code. .TP \*(T<\fB\-b\fR\*(T> \fIaddress\fR, \*(T<\fB\-\-bind\fR\*(T> \fIaddress\fR The server address where the HTTP server should listen for incoming connections. Can be a port (\*(T<:8080\*(T>), a host (\*(T) or both (\*(T). The default is \*(T. You need to use \*(T<0.0.0.0\*(T> to be able to connect to the server from external clients. .SS EXAMPLE .nf \*(T< \fBmapproxy\-util serve\-develop\fR ./mapproxy.yaml \*(T> .fi .SH SERVE-MULTIAPP-DEVELOP This sub-command is similar to \fBserve-develop\fR but it starts a \*(T instance. .PP You need to pass a directory of your MapProxy configurations as an argument. The server will automatically reload if you change any configuration or any of the MapProxy source code. .TP \*(T<\fB\-b\fR\*(T> \fIaddress\fR, \*(T<\fB\-\-bind\fR\*(T> \fIaddress\fR The server address where the HTTP server should listen for incoming connections. Can be a port (\*(T<:8080\*(T>), a host (\*(T) or both (\*(T). The default is \*(T. You need to use \*(T<0.0.0.0\*(T> to be able to connect to the server from external clients. .SS EXAMPLE .nf \*(T< \fBmapproxy\-util serve\-multiapp\-develop\fR my_projects/ \*(T> .fi .SH SCALES This sub-command helps to convert between scales and resolutions. .PP Scales are ambiguous when the resolution of the output device (LCD, printer, mobile, etc) is unknown and therefore MapProxy only uses resolutions for configuration. You can use the \fBscales\fR sub-command to calculate between known scale values and resolutions. .PP The command takes a list with one or more scale values and returns the corresponding resolution value. .TP \*(T<\fB\-\-unit\fR\*(T> Return resolutions in this unit per pixel (default meter per pixel). .TP \*(T<\fB\-l\fR\*(T> \fIn\fR, \*(T<\fB\-\-levels\fR\*(T> \fIn\fR Calculate resolutions for \fIn\fR levels. This will double the resolution of the last scale value if \fIn\fR is larger than the number of the provided scales. .TP \*(T<\fB\-d\fR\*(T> \fIdpi\fR, \*(T<\fB\-\-dpi\fR\*(T> \fIdpi\fR The resolution of the output display to use for the calculation. You need to set this to the same value of the client/server software you are using. Common values are 72 and 96. The default value is the equivalent of a pixel size of .28mm, which is around 91 DPI. This is the value the OGC uses since the WMS 1.3.0 specification. .TP \*(T<\fB\-\-as\-res\-config\fR\*(T> Format the output so that it can be pasted into a MapProxy grid configuration. .TP \*(T<\fB\-\-res\-to\-scale\fR\*(T> Calculate from resolutions to scale. .SS EXAMPLE For multiple levels as MapProxy configuration snippet: .nf \*(T< \fBmapproxy\-util scales\fR \fB\-l\fR 4 \fB\-\-as\-res\-config\fR 100000 \*(T> .fi .PP .nf \*(T< res: [ # res level scale 28.0000000000, # 0 100000.00000000 14.0000000000, # 1 50000.00000000 7.0000000000, # 2 25000.00000000 3.5000000000, # 3 12500.00000000 ] \*(T> .fi .PP With multiple scale values and custom DPI: .nf \*(T< \fBmapproxy\-util scales\fR \fB\-\-dpi\fR 96 \fB\-\-as\-res\-config\fR \e 100000 50000 25000 10000 \*(T> .fi .PP .nf \*(T< res: [ # res level scale 26.4583333333, # 0 100000.00000000 13.2291666667, # 1 50000.00000000 6.6145833333, # 2 25000.00000000 2.6458333333, # 3 10000.00000000 ] \*(T> .fi .SH WMS-CAPABILITIES This sub-command parses a valid capabilities document from a URL and displays all available layers. .PP This tool does not create a MapProxy configuration, but the output should help you to set up or modify your MapProxy configuration. .PP The command takes a valid URL GetCapabilities URL. .TP \*(T<\fB\-\-host\fR\*(T> \fIURL\fR Display all available Layers for this service. Each new layer will be marked with a hyphen and all sublayers are indented. .TP \*(T<\fB\-\-version\fR\*(T> \fIversionnumber\fR Parse the Capabilities-document for the given version. Only version 1.1.1 and 1.3.0 are supported. The default value is 1.1.1. .SS EXAMPLE With the following MapProxy layer configuration: .PP .nf \*(T< layers: \- name: osm title: Omniscale OSM WMS \- osm.omniscale.net sources: [osm_cache] \- name: foo title: Group Layer layers: \- name: layer1a title: Title of Layer 1a sources: [osm_cache] \- name: layer1b title: Title of Layer 1b sources: [osm_cache] \*(T> .fi .PP Parsed capabilities document: .PP .nf \*(T< \fBmapproxy\-util wms\-capabilities\fR http://127.0.0.1:8080/service?REQUEST=GetCapabilities \*(T> .fi .PP .nf \*(T< Capabilities Document Version 1.1.1 Root\-Layer: \- title: MapProxy WMS Proxy url: http://127.0.0.1:8080/service? opaque: False srs: ['EPSG:31467', 'EPSG:31466', 'EPSG:4326', 'EPSG:25831', 'EPSG:25833', 'EPSG:25832', 'EPSG:31468', 'EPSG:900913', 'CRS:84', 'EPSG:4258'] bbox: EPSG:900913: [\-20037508.3428, \-20037508.3428, 20037508.3428, 20037508.3428] EPSG:4326: [\-180.0, \-85.0511287798, 180.0, 85.0511287798] queryable: False llbbox: [\-180.0, \-85.0511287798, 180.0, 85.0511287798] layers: \- name: osm title: Omniscale OSM WMS \- osm.omniscale.net url: http://127.0.0.1:8080/service? opaque: False srs: ['EPSG:31467', 'EPSG:31466', 'EPSG:25832', 'EPSG:25831', 'EPSG:25833', 'EPSG:4326', 'EPSG:31468', 'EPSG:900913', 'CRS:84', 'EPSG:4258'] bbox: EPSG:900913: [\-20037508.3428, \-20037508.3428, 20037508.3428, 20037508.3428] EPSG:4326: [\-180.0, \-85.0511287798, 180.0, 85.0511287798] queryable: False llbbox: [\-180.0, \-85.0511287798, 180.0, 85.0511287798] \- name: foobar title: Group Layer url: http://127.0.0.1:8080/service? opaque: False srs: ['EPSG:31467', 'EPSG:31466', 'EPSG:25832', 'EPSG:25831', 'EPSG:25833', 'EPSG:4326', 'EPSG:31468', 'EPSG:900913', 'CRS:84', 'EPSG:4258'] bbox: EPSG:900913: [\-20037508.3428, \-20037508.3428, 20037508.3428, 20037508.3428] EPSG:4326: [\-180.0, \-85.0511287798, 180.0, 85.0511287798] queryable: False llbbox: [\-180.0, \-85.0511287798, 180.0, 85.0511287798] layers: \- name: layer1a title: Title of Layer 1a url: http://127.0.0.1:8080/service? opaque: False srs: ['EPSG:31467', 'EPSG:31466', 'EPSG:25832', 'EPSG:25831', 'EPSG:25833', 'EPSG:4326', 'EPSG:31468', 'EPSG:900913', 'CRS:84', 'EPSG:4258'] bbox: EPSG:900913: [\-20037508.3428, \-20037508.3428, 20037508.3428, 20037508.3428] EPSG:4326: [\-180.0, \-85.0511287798, 180.0, 85.0511287798] queryable: False llbbox: [\-180.0, \-85.0511287798, 180.0, 85.0511287798] \- name: layer1b title: Title of Layer 1b url: http://127.0.0.1:8080/service? opaque: False srs: ['EPSG:31467', 'EPSG:31466', 'EPSG:25832', 'EPSG:25831', 'EPSG:25833', 'EPSG:4326', 'EPSG:31468', 'EPSG:900913', 'CRS:84', 'EPSG:4258'] bbox: EPSG:900913: [\-20037508.3428, \-20037508.3428, 20037508.3428, 20037508.3428] EPSG:4326: [\-180.0, \-85.0511287798, 180.0, 85.0511287798] queryable: False llbbox: [\-180.0, \-85.0511287798, 180.0, 85.0511287798] \*(T> .fi .SH GRIDS This sub-command displays information about configured grids. .PP The command takes a MapProxy configuration file and returns all configured grids. .PP Furthermore, default values for each grid will be displayed if they are not defined explicitly. All default values are marked with an asterisk in the output. .TP \*(T<\fB\-f\fR\*(T> \fIpath/to/config\fR, \*(T<\fB\-\-mapproxy\-config\fR\*(T> \fIpath/to/config\fR Display all configured grids for this MapProxy configuration with detailed information. If this option is not set, the sub-command will try to use the last argument as the mapproxy config. .TP \*(T<\fB\-l\fR\*(T>, \*(T<\fB\-\-list\fR\*(T> Display only the names of the grids for the given configuration, which are used by any grid. .TP \*(T<\fB\-\-all\fR\*(T> Show also grids that are not referenced by any cache. .TP \*(T<\fB\-g\fR\*(T> \fIgrid_name\fR, \*(T<\fB\-\-grid\fR\*(T> \fIgrid_name\fR Display information only for a single grid. The tool will exit, if the grid name is not found. .TP \*(T<\fB\-c\fR\*(T> \fIcoverage name\fR, \*(T<\fB\-\-coverage\fR\*(T> \fIcoverage name\fR Display an approximation of the number of tiles for each level that are within this coverage. The coverage must be defined in Seed configuration. .TP \*(T<\fB\-s\fR\*(T> \fIseed.yaml\fR, \*(T<\fB\-\-seed\-conf\fR\*(T> \fIseed.yaml\fR This option loads the seed configuration and is needed if you use the \*(T<\fB\-\-coverage\fR\*(T> option. .SS EXAMPLE With the following MapProxy grid configuration: .PP .nf \*(T< grids: localgrid: srs: EPSG:31467 bbox: [5,50,10,55] bbox_srs: EPSG:4326 min_res: 10000 localgrid2: base: localgrid srs: EPSG:25832 res_factor: sqrt2 tile_size: [512, 512] \*(T> .fi .PP List all configured grids: .PP .nf \*(T< \fBmapproxy\-util grids\fR \fB\-\-list\fR \fB\-\-mapproxy\-config\fR /path/to/mapproxy.yaml \*(T> .fi .PP .nf \*(T< GLOBAL_GEODETIC GLOBAL_MERCATOR localgrid localgrid2 \*(T> .fi .PP Display detailed information for one specific grid: .PP .nf \*(T< \fBmapproxy\-util grids\fR \fB\-\-grid\fR localgrid \fB\-\-mapproxy\-conf\fR /path/to/mapproxy.yaml \*(T> .fi .PP .nf \*(T< localgrid: Configuration: bbox: [5, 50, 10, 55] bbox_srs: 'EPSG:4326' min_res: 10000 origin*: 'sw' srs: 'EPSG:31467' tile_size*: [256, 256] Levels: Resolutions, # x * y = total tiles 00: 10000, # 1 * 1 = 1 01: 5000.0, # 1 * 1 = 1 02: 2500.0, # 1 * 1 = 1 03: 1250.0, # 2 * 2 = 4 04: 625.0, # 3 * 4 = 12 05: 312.5, # 5 * 8 = 40 06: 156.25, # 9 * 15 = 135 07: 78.125, # 18 * 29 = 522 08: 39.0625, # 36 * 57 = 2.052K 09: 19.53125, # 72 * 113 = 8.136K 10: 9.765625, # 144 * 226 = 32.544K 11: 4.8828125, # 287 * 451 = 129.437K 12: 2.44140625, # 574 * 902 = 517.748K 13: 1.220703125, # 1148 * 1804 = 2.071M 14: 0.6103515625, # 2295 * 3607 = 8.278M 15: 0.30517578125, # 4589 * 7213 = 33.100M 16: 0.152587890625, # 9178 * 14426 = 132.402M 17: 0.0762939453125, # 18355 * 28851 = 529.560M 18: 0.03814697265625, # 36709 * 57701 = 2.118G 19: 0.019073486328125, # 73417 * 115402 = 8.472G \*(T> .fi .SH EXPORT This sub-command exports tiles from one cache to another. This is similar to the seed tool, but you don't need to edit the configuration. The destination cache, grid and the coverage can be defined on the command line. .PP Required arguments: .TP \*(T<\fB\-f\fR\*(T> \fIpath\fR, \*(T<\fB\-\-mapproxy\-conf\fR\*(T> \fIpath\fR The path to the MapProxy configuration of the source cache. .TP \*(T<\fB\-\-source\fR\*(T> \fIname\fR Name of the source or cache to export. .TP \*(T<\fB\-\-levels\fR\*(T> \fIlist\fR Comma separated list of levels to export. You can also define a range of levels. For example \*(T<'1,2,3,4,5'\*(T>, \*(T<\&'1..10'\*(T> or \*(T<'1,3,4,6..8'\*(T>. .TP \*(T<\fB\-\-grid\fR\*(T> \fIgrid\fR The tile grid for the export. The option can either be the name of the grid as defined in the in the MapProxy configuration, or it can be the grid definition itself. You can define a grid as a single string of the key-value pairs. The grid definition supports all grid parameters. See below for examples. .TP \*(T<\fB\-\-dest\fR\*(T> \fIdestination\fR Destination of the export. Can be a filename, directory or URL, depending on the export \*(T<\fB\-\-type\fR\*(T>. .TP \*(T<\fB\-\-type\fR\*(T> \fItype\fR Choose the export type. See below for a list of all options. .PP Other options: .TP \*(T<\fB\-\-fetch\-missing\-tiles\fR\*(T> If MapProxy should request missing tiles from the source. By default, the export tool will only existing tiles. .TP \*(T<\fB\-\-coverage\fR\*(T> \fIcoverage\fR, \*(T<\fB\-\-srs\fR\*(T> \fIsrs\fR, \*(T<\fB\-\-where\fR\*(T> \fIwhere\fR Limit the export to this coverage. You can use a BBOX, WKT files or OGR datasources. .TP \*(T<\fB\-c\fR\*(T> \fIN\fR, \*(T<\fB\-\-concurrency\fR\*(T> \fIN\fR The number of concurrent export processes. .SS "EXPORT TYPES" .TP tms: Export tiles in a TMS like directory structure. .TP mapproxy, tc Export tiles like the internal cache directory structure. This is compatible with TileCache. .TP mbtile Exports tiles into a MBTile file. .TP arcgis Exports tiles in a ArcGIS exploded cache directory structure. .SS EXAMPLE Export tiles into a TMS directory structure under \*(T<\fI\&./cache/\fR\*(T>. Limit export to the BBOX and levels 0 to 6. .PP .nf \*(T< \fBmapproxy\-util export\fR \fB\-f\fR mapproxy.yaml \fB\-\-grid\fR osm_grid \e \fB\-\-source\fR osm_cache \fB\-\-dest\fR ./cache/ \e \fB\-\-levels\fR 1..6 \fB\-\-coverage\fR 5,50,10,60 \fB\-\-srs\fR 4326 \*(T> .fi .PP Export tiles into an MBTiles file. Limit export to a shape coverage. .PP .nf \*(T< \fBmapproxy\-util export\fR \fB\-f\fR mapproxy.yaml \fB\-\-grid\fR osm_grid \e \fB\-\-source\fR osm_cache \fB\-\-dest\fR osm.mbtiles \fB\-\-type\fR mbtile \e \fB\-\-levels\fR 1..6 \fB\-\-coverage\fR boundaries.shp \e \fB\-\-where\fR 'CNTRY_NAME = "Germany"' \fB\-\-srs\fR 3857 \*(T> .fi .PP Export tiles into an MBTiles file using a custom grid definition. .PP .nf \*(T< \fBmapproxy\-util export\fR \fB\-f\fR mapproxy.yaml \fB\-\-levels\fR 1..6 \e \fB\-\-grid\fR "srs='EPSG:4326' bbox=[5,50,10,60] tile_size=[512,512]" \e \fB\-\-source\fR osm_cache \fB\-\-dest\fR osm.mbtiles \fB\-\-type\fR mbtile \*(T> .fi