[MapProxy] Reprojecting OSM Tiles on Windows

Jörg Schräder schraeder at hansaluftbild.de
Fri Jun 17 07:28:52 EDT 2011


Dear group,

I'm currently trying to set up a Mapproxy project which will allow me to 
serve data from the OSM tilecache as a local cached wms service in 
different projections.

The problem is: MapProxy won't deliver any data in projections other 
than the source projection of the tilecache (EPSG:900913).
I've tested this with QGIS 1.6, QGIS 1.7 as WMS Clients.
Could this be a problem of running it under Windows or is my 
configuration wrong? (See log below)

My environment is:
Windows 2003 Server R2 SP2
Python 2.7.1
pyproj 1.8.9
MapProxy 1.1.0

My config:
-------------------
#MapProxy Test server for OpenStreetMap Data

services:
   demo:
   kml:
   tms:
   wms:
     srs: ['EPSG:4326', 'EPSG:900913', 'EPSG:3857', 'EPSG:25832']
     image_formats: ['image/jpeg', 'image/png']
     md:
       title: MapProxy OpenStreetMap WMS Proxy
       abstract: MapProxy Test Server for OpenStreetMap Data
       fees: 'None'

layers:
   - name: osm
     title: OpenStreetMap
     sources: [osm_cache]

caches:
   osm_cache:
     grids: [global_mercator_osm]
     sources: [osm_tms]

sources:
   osm_tms:
     type: tile
     url: http://c.tile.openstreetmap.org/%(tms_path)s.png
     origin: nw

grids:
   global_mercator_osm:
     base: GLOBAL_MERCATOR
     num_levels: 18

globals:
   srs:
     proj_data_dir: 'C:/Python27/Lib/site-packages/pyproj/data/'

   image:
       #resampling_method: nearest
       resampling_method: bicubic
-------------------

Any ideas whats going wrong or what I may have missed?

In the log I can find lot of these entries:
------------
2011-06-17 13:22:16,223 - INFO - 
4000:mapproxy.source.request:log_request - GET 
http://c.tile.openstreetmap.org/12/2122/1352.png 200 31.7 46
Traceback (most recent call last):
   File "F:\mapproxy\lib\site-packages\mapproxy\wsgiapp.py", line 159, 
in __call__
     resp = self.handlers[handler_name].handle(req)
   File "F:\mapproxy\lib\site-packages\mapproxy\service\ows.py", line 
38, in handle
     return self.services[service].handle(req)
   File "F:\mapproxy\lib\site-packages\mapproxy\service\base.py", line 
30, in handle
     return handler(parsed_req)
   File "F:\mapproxy\lib\site-packages\mapproxy\service\wms.py", line 
111, in map
     renderer.render(merger)
   File "F:\mapproxy\lib\site-packages\mapproxy\service\wms.py", line 
371, in render
     layer_merger)
   File "F:\mapproxy\lib\site-packages\mapproxy\util\async.py", line 
204, in _single_call
     result = func(*args)
   File "F:\mapproxy\lib\site-packages\mapproxy\service\wms.py", line 
412, in _render_layer
     layer_img = layer.get_map(self.query)
   File "F:\mapproxy\lib\site-packages\mapproxy\layer.py", line 289, in 
get_map
     tiled_image = self._tiled_image(query)
   File "F:\mapproxy\lib\site-packages\mapproxy\layer.py", line 324, in 
_tiled_image
     tile_collection = 
self.tile_manager.load_tile_coords(affected_tile_coords)
   File "F:\mapproxy\lib\site-packages\mapproxy\cache\tile.py", line 95, 
in load_tile_coords
     created_tiles = creator.create_tiles(uncached_tiles)
   File "F:\mapproxy\lib\site-packages\mapproxy\cache\tile.py", line 
180, in create_tiles
     created_tiles = self._create_single_tiles(tiles)
   File "F:\mapproxy\lib\site-packages\mapproxy\cache\tile.py", line 
200, in _create_single_tiles
     return self._create_threaded(self._create_single_tile, tiles)
   File "F:\mapproxy\lib\site-packages\mapproxy\cache\tile.py", line 
210, in _create_threaded
     for new_tiles in async_pool.imap(create_func, tiles):
   File "F:\mapproxy\lib\site-packages\mapproxy\util\async.py", line 54, 
in _result_iter
     for result in results:
   File "F:\mapproxy\lib\site-packages\mapproxy\util\async.py", line 
191, in map_each
     for value in self._get_results(next_result, results, raise_exceptions):
   File "F:\mapproxy\lib\site-packages\mapproxy\util\async.py", line 
235, in _get_results
     for i, value in self._fetch_results(raise_exceptions):
   File "F:\mapproxy\lib\site-packages\mapproxy\util\async.py", line 
144, in run
     result = func(*args)
   File "F:\mapproxy\lib\site-packages\mapproxy\cache\tile.py", line 
226, in _create_single_tile
     self.cache.store(tile)
   File "F:\mapproxy\lib\site-packages\mapproxy\cache\file.py", line 
184, in store
     self._store(tile, tile_loc)
   File "F:\mapproxy\lib\site-packages\mapproxy\cache\file.py", line 
190, in _store
     data = tile.source.as_buffer(seekable=True)
   File "F:\mapproxy\lib\site-packages\mapproxy\image\__init__.py", line 
245, in as_buffer
     self._make_seekable_buf() if seekable else self._make_readable_buf()
   File "F:\mapproxy\lib\site-packages\mapproxy\image\__init__.py", line 
215, in _make_seekable_buf
     self._buf = StringIO(self._buf.read())
   File "C:\Python27\Lib\socket.py", line 351, in read
     data = self._sock.recv(rbufsize)
   File "C:\Python27\Lib\httplib.py", line 553, in read
     s = self.fp.read(amt)
   File "C:\Python27\Lib\socket.py", line 380, in read
     data = self._sock.recv(left)
timeout: timed out
------------

Is this a timeout in the reprojection? What causes this and can I do 
anything about it?

Thanks,
Jörg Schräder

Another idea by the way (without knowledge of how much effort this would 
cost) - What about adding MapProxy to OSGeo4W?


More information about the MapProxy mailing list