Skip to content

Instantly share code, notes, and snippets.

@seanlinmt
Created August 26, 2017 02:07
Show Gist options
  • Save seanlinmt/bc16a8ab996b6377946404daec30f433 to your computer and use it in GitHub Desktop.
Save seanlinmt/bc16a8ab996b6377946404daec30f433 to your computer and use it in GitHub Desktop.
sample mapproxy configuration
globals:
http:
client_timeout: 10
image:
resampling_method: bicubic
services:
demo:
tms:
use_grid_names: true
origin: 'nw'
kml:
use_grid_names: true
wms:
md:
title: clearpixels WMS Server
sources:
localities_sarawak:
type: wms
req:
url: http://gaia.labs.clearpixels.co.nz:8080/geoserver/wms?
layers: localityChanges2015_sarawak,locality2013q4_sarawak
transparent: True
wms_opts:
featureinfo: True
electoral_sarawak:
type: wms
req:
url: http://gaia.labs.clearpixels.co.nz:8080/geoserver/wms?
layers: dms2015_sarawak,dun2015_sarawak
transparent: True
wms_opts:
featureinfo: True
pollcentre2015_sarawak:
type: wms
req:
url: http://gaia.labs.clearpixels.co.nz:8080/geoserver/wms?
layers: pollcentre2015_sarawak
transparent: True
wms_opts:
featureinfo: True
arcgis_world_imagery:
type: tile
url: http://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/%(z)s/%(y)s/%(x)s
grid: gm_grid
transparent: true
concurrent_requests: 0
on_error:
404:
# response: '#ff0080'
response: transparent
cache: True
coverage:
bbox: [99.64, 0.85, 119.27, 7.36]
srs: 'EPSG:4326'
bing_aerial:
type: tile
url: http://tiles.virtualearth.net/tiles/a%(quadkey)s.png?g=587&mkt=en-US&n=z&key=USE_YOUR_OWN_KEY
grid: mercator_grid
concurrent_requests: 0
on_error:
404:
# response: '#ff0080'
response: transparent
cache: False
coverage:
bbox: [99.64, 0.85, 119.27, 7.36]
srs: 'EPSG:4326'
bing_aerial_seeder:
type: tile
url: http://tiles.virtualearth.net/tiles/a%(quadkey)s.png?g=587&mkt=en-US&n=z&key=USE_YOUR_OWN_KEY
grid: mercator_grid
on_error:
404:
# response: '#ff0080'
response: transparent
cache: True
google_hybrid:
type: tile
url: http://mt1.google.com/vt/lyrs=y@0&hl=en&x=%(x)s&y=%(y)s&z=%(z)s
grid: gm_grid
transparent: true
concurrent_requests: 0
on_error:
404:
# response: '#ff0080'
response: transparent
cache: False
coverage:
bbox: [99.64, 0.85, 119.27, 7.36]
srs: 'EPSG:4326'
google_physical:
type: tile
url: http://mt2.google.com/vt/lyrs=p@0&hl=en&x=%(x)s&y=%(y)s&z=%(z)s
grid: gm_grid
transparent: true
concurrent_requests: 0
on_error:
404:
# response: '#ff0080'
response: transparent
cache: True
coverage:
bbox: [99.64, 0.85, 119.27, 7.36]
srs: 'EPSG:4326'
google_satellite:
type: tile
url: http://mt2.google.com/vt/lyrs=s@0&hl=en&x=%(x)s&y=%(y)s&z=%(z)s
grid: gm_grid
transparent: true
concurrent_requests: 0
on_error:
404:
# response: '#ff0080'
response: transparent
cache: True
coverage:
bbox: [99.64, 0.85, 119.27, 7.36]
srs: 'EPSG:4326'
here_aerial:
type: tile
url: http://1.aerial.maps.cit.api.here.com/maptile/2.1/maptile/newest/satellite.day/%(z)s/%(x)s/%(y)s/256/jpg?app_id=USE_YOUR_OWN_KEY
grid: mercator_grid
concurrent_requests: 0
on_error:
404:
# response: '#ff0080'
response: transparent
cache: True
coverage:
bbox: [99.64, 0.85, 119.27, 7.36]
srs: 'EPSG:4326'
here_label:
type: tile
# url: http://2.communitymaptiles.nokia.com/tilehub/live/map/png/%(quadkey)s?app_id=USE_YOUR_OWN_KEY
url: http://2.base.maps.cit.api.here.com/maptile/2.1/streettile/newest/normal.day/%(z)s/%(x)s/%(y)s/256/png8?style=normal&app_id=USE_YOUR_OWN_KEY
grid: mercator_grid
transparent: True
concurrent_requests: 0
on_error:
404:
# response: '#ff0080'
response: transparent
cache: True
coverage:
bbox: [99.64, 0.85, 119.27, 7.36]
srs: 'EPSG:4326'
grids:
gm_grid:
base: GLOBAL_MERCATOR
origin: ul
res: [
# res level scale @90.7 DPI
28.0000000000, # 0 100000.00000000
14.0000000000, # 1 50000.00000000
7.0000000000, # 2 25000.00000000
3.5000000000, # 3 12500.00000000
1.7500000000, # 4 6250.00000000
0.8750000000, # 5 3125.00000000
0.4375000000, # 6 1562.50000000
0.2187500000, # 7 781.25000000
0.1093750000, # 8 390.62500000
0.0546875000, # 9 195.31250000
0.0273437500, # 10 97.65625000
0.0136718750, # 11 48.82812500
0.0068359375, # 12 24.41406250
0.0034179687, # 13 12.20703125
0.0017089844, # 14 6.10351562
0.0008544922, # 15 3.05175781
0.0004272461, # 16 1.52587891
0.0002136230, # 17 0.76293945
0.0001068115, # 18 0.38146973
0.0000534058, # 19 0.19073486
]
mercator_grid:
base: GLOBAL_MERCATOR
origin: nw
caches:
arcgis_world_imagery_cache:
grids: [mercator_grid]
sources: [arcgis_world_imagery]
cache:
type: sqlite
directory: F:\caches\mapproxy\arcgis
bing_cache:
grids: [mercator_grid]
sources: [bing_aerial]
cache:
type: sqlite
directory: F:\caches\mapproxy\bing
bing_cache_seeder:
grids: [mercator_grid]
sources: [bing_aerial_seeder]
cache:
type: sqlite
directory: F:\caches\mapproxy\bing
google_hybrid_cache:
grids: [gm_grid]
sources: [google_hybrid]
cache:
type: sqlite
directory: F:\caches\mapproxy\gh
google_satellite_cache:
grids: [gm_grid]
sources: [google_satellite]
cache:
type: sqlite
directory: F:\caches\mapproxy\gs
google_physical_cache:
grids: [gm_grid]
sources: [google_physical]
cache:
type: sqlite
directory: F:\caches\mapproxy\gp
here_aerial_cache:
grids: [mercator_grid]
sources: [here_aerial]
cache:
type: sqlite
directory: F:\caches\mapproxy\here
here_aerial_label_cache:
grids: [mercator_grid]
sources: [here_label]
cache:
type: sqlite
directory: F:\caches\mapproxy\here_label
layers:
- name: electoral_sarawak
title: Sarawak electoral boundaries
sources: [electoral_sarawak]
- name: localities_sarawak
title: Sarawak voting localities layer
sources: [localities_sarawak]
- name: pollcentre2015_sarawak
title: Sarawak polling centres layer
sources: [pollcentre2015_sarawak]
- name: arcgis_imagery_layer
title: ArcGIS imagery layer
sources: [arcgis_world_imagery_cache]
- name: arcgis_here_label_layer
title: ArcGIS + Here label layer
sources: [arcgis_world_imagery_cache, here_aerial_label_cache]
- name: bing_aerial_layer
title: Bing Aerial layer
sources: [bing_cache]
- name: gs_layer
title: Google Satellite layer
sources: [google_satellite_cache]
- name: gp_layer
title: Google Physical layer
sources: [google_physical_cache]
- name: gh_layer
title: Google Hybrid layer
sources: [google_hybrid_cache]
- name: google_here_label_layer
title: Google Satellite + Here label layer
sources: [google_satellite_cache, here_aerial_label_cache]
- name: here_aerial_layer
title: Here Aerial layer
sources: [here_aerial_cache]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment