[MapProxy] mapproxy + osm setup issue

Kenneth Dombrowski kenneth at ylayali.net
Mon Oct 15 13:33:09 PDT 2012


Good afternoon everyone,

I have MapProxy almost working with OpenStreetMap, but something is
still misconfigured.  I am out of ideas & would appreciate any tips.

OSM itself works when I take mapproxy out of the picture by pointing my
app to the upstream servers: 

   var mqtileUrl = 'http://tile.openstreetmap.org/{z}/{x}/{y}.png';

which results in, for example, this successful request:

  http://tile.openstreetmap.org/13/3913/3336.png

When I reconfigure my app to use my mapproxy instance @ 

  var mqtileUrl = 'http://media-map.ylayali.net/mapproxy/tms/1.0.0/osm/{z}/{x}/{y}.png';

and mapproxy.yaml to use the above working url for my upstream source:

  sources:
     osm_tiles:
       type: tile
       url:  http://tile.openstreetmap.org/%(tms_path)s.%(format)s
       grid: osm_gri

I get nothing but blue squares.  The new config results in this series of activity:

==> /srv/mediagoblin/var/log/apache/mapproxy-access.log <==
[15/Oct/2012:14:33:46 -0400] "GET /mapproxy/tms/1.0.0/osm/13/3913/3336.png HTTP/1.1" 200 418

(good so far, leaflet is making the expected request)

==> /srv/mediagoblin/var/log/source-requests.log <==
[2012-10-15 14:33:47,107] GET http://tile.openstreetmap.org/14/3913/13047.png 200 0.1 324

huh?  what happened to the tms_path here?  was it translated to
something else?

==> /srv/mediagoblin/var/log/mapproxy.log <==
2012-10-15 14:33:47,108 - DEBUG - mapproxy.cache.file - writing (3913, 3336, 14) to 
    /srv/mediagoblin/mg-mapproxy/./cache_data/osm_cache_EPSG900913/14/000/003/913/000/003/336.png

I am using the `paste serve paste.ini` deployment style & connecting via
the apache FastCGIExternalServer example client.  MapProxy version 1.4.0, 
Python 2.6.6, on Debian 6.0

Thanks for reading,
Kenneth



For reference:

mapproxy.yaml is almost an exact copy of the example @
http://wiki.openstreetmap.org/wiki/Mappproxy_setup:

    services:
      demo:
      tms:
      wms:
        srs: ['EPSG:900913','EPSG:3857']
        image_formats: ['image/jpeg', 'image/png']
        md:
          title: MapProxy WMS Proxy
          ...etc...

    layers:
      - name: osm
        title: Open Streetmap Tiles
        sources: [osm_cache]

    caches:
      osm_cache:
        sources: [osm_tiles]
        format: image/png

    sources:
       osm_tiles:
         type: tile
         ###url: http://otile1.mqcdn.com/tiles/1.0.0/osm/%(tms_path)s.%(format)s
         url: http://tile.openstreetmap.org/%(tms_path)s.%(format)s
         grid: osm_grid

    grids:
      osm_grid:
        srs: EPSG:900913
        origin: nw

    globals:
      cache:
        base_dir: './cache_data'
        lock_dir: './cache_data/locks'

      image:
          resampling_method: bilinear
          jpeg_quality: 90

My paste.ini:

    [app:main]
    use = egg:MapProxy#app
    mapproxy_conf = /srv/mediagoblin/mg-mapproxy/mapproxy.yaml

    [server:main]
    use = egg:Flup#fcgi_fork
    host = localhost
    port = 26545

    [loggers]
    keys=root,source_requests

    [handlers]
    keys=mapproxy,source_requests

    [formatters]
    keys=default,requests

    [logger_root]
    level=DEBUG
    handlers=mapproxy

    [logger_source_requests]
    level=DEBUG
    qualname=mapproxy.source.request
    # propagate=0 -> do not show up in logger_root
    propagate=0
    handlers=source_requests

    [handler_mapproxy]
    class=FileHandler
    formatter=default
    args=(r"/srv/mediagoblin/var/log/mapproxy.log", "a")
    level=DEBUG

    [handler_source_requests]
    class=FileHandler
    formatter=requests
    args=(r"/srv/mediagoblin/var/log/source-requests.log", "a")
    level=DEBUG

    [formatter_default]
    format=%(asctime)s - %(levelname)s - %(name)s - %(message)s

    [formatter_requests]
    format=[%(asctime)s] %(message)s

& my Apache2 VirtualHost:

    <VirtualHost *:80>
        ServerName media-map.ylayali.net
        DocumentRoot /srv/mediagoblin/mg-mapproxy/tmp
        CustomLog /srv/mediagoblin/var/log/apache/mapproxy-access.log combined
        ErrorLog /srv/mediagoblin/var/log/apache/mapproxy-error.log
        <Directory /srv/mediagoblin/mg-mapproxy/tmp>
            Order allow,deny
            Allow from all
        </Directory>
        Alias /mapproxy /srv/mediagoblin/mg-mapproxy/tmp/mapproxy.fcgi
        FastCGIExternalServer /srv/mediagoblin/mg-mapproxy/tmp/mapproxy.fcgi -host 127.0.0.1:26545
    </VirtualHost>

Where /srv/mediagoblin/mg-mapproxy/tmp/ is an empty directory &
mapproxy.fcgi is my "madeup" file node



More information about the MapProxy mailing list