[MapProxy] Issue with specific resolutions/scales

Jeremy Holt jholt at adc4gis.com
Mon May 11 11:09:03 PDT 2015


Hello! Thanks in advance for taking a peek at this!

I've been utilizing mapproxy for a number of services and various
coordinate systems, and this is the first issue I've had that seems related.

Basically, I have resolutions defined in a grid that do not seem supported
for tile creation/requests.

Using Mapproxy 1.7 on Ubuntu servers.

I have 17 res levels defined in the grid, and 3 of them return service
errors when a BBOX is passed in the request. The rest are just fine.
In my application, mapproxy is used to create tiles via WMS reuqests to
ArcGIS Server, and return those created imagery tiles via WMS consumed in
OpenLayers. Scale levels and resolutions coordinate in that respect. This
example uses a county coordinate system (EPSG:103413, Feet, defined in SRS)
and seems to have no problem with the majority of requests. I have attached
the output of a logging service with a stack trace when the failing
requests are made. I'm wondering if there is a factor related to the Grid
that is perhaps missing to support these resolutions, or if there is
something else I can do to get successful requests at specific resolutions.
I'll be more than happy to provide further information.


The following is a list of the resolutions defined in the Grid:

[
   390.62500000000006,
   303.8194444444444,
   217.013888888888,
   104.16666666666666,
   52.08333333333333,
   41.666666666666664,
   20.833333333333332,
   10.416666666666666,
*   9.375, (1:10,800 - this is a problem scale)*
*   8.333333333333334, (1:9600 - this is a problem scale)*
*   7.291666666666666, (1:8400 - this is a problem scale)*
   6.250000000000001,
   5.208333333333333,
   4.166666666666667,
   2.0833333333333335,
   1.0416666666666667,
   0.5208333333333334
]

Here is an example request that FAILS (1:10800 , res 9.375):
http://mp4.adc4gis.com/dodgecowi/service?SRS=EPSG%3A103413&LAYERS=dodgecowi_aerial2012_layer&FORMAT=image%2Fjpeg&TILED=true&TILESORIGIN=771292.20390976%2C617600.31082016&WIDTH=256&HEIGHT=256&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&BBOX=874492.20390976,701600.31082016,876892.20390976,704000.31082016

Here is a request that WORKS for the scale above (1:12000 ,
res 10.416666666666666):
http://mp4.adc4gis.com/dodgecowi/service?SRS=EPSG%3A103413&LAYERS=dodgecowi_aerial2012_layer&FORMAT=image%2Fjpeg&TILED=true&TILESORIGIN=771292.20390976%2C617600.31082016&WIDTH=256&HEIGHT=256&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&BBOX=888625.53724309,702933.64415349,891292.20390976,705600.31082016


Here is the 'mapproxy.yaml' for review:

services:
  demo:
  kml:
  tms:
    # needs no arguments
 # wmts:
  wms:
    srs: ['EPSG:4326', 'EPSG:900913','EPSG:103405',
'EPSG:4258','EPSG:31466', 'EPSG:31467', 'EPSG:31468', 'EPSG:25831',
'EPSG:25832', 'EPSG:25833', 'EPSG:103930', 'EPSG:26914', 'EPSG:103901',
'EPSG:103902', 'EPSG:103426', 'EPSG:96922', 'EPSG:103450', 'EPSG:103441',
'EPSG:0', 'EPSG:103950', 'EPSG:103456', 'EPSG:103456', 'EPSG:103444',
'EPSG:103969', 'EPSG:103408', 'EPSG:32054', 'EPSG:103459', 'EPSG:3070',
'EPSG:103454', 'EPSG:102100', 'EPSG:103407', 'EPSG:103460', 'EPSG:103413',
'EPSG:103409', 'EPSG:102704', 'EPSG:103406', 'EPSG:103446', 'EPSG:103433',
'EPSG:103411', 'EPSG:103409']
    image_formats: ['image/jpeg', 'image/png32',  'image/png' ]
    md:
      # metadata used in capabilities documents
      title: MapProxy WMS Proxy
      abstract: This is the pretty great MapProxy.
      online_resource: http://mapproxy.org/
      contact:
        person: Jeremy Holt
        position: GIS Consultant
        organization: ADC
        address:
        city: EC
        postcode:
        country: USA
        phone:
        fax:
        email:
      access_constraints:
        This service is intended for private and evaluation use only.
        The data is licensed as Creative Commons Attribution-Share Alike 2.0
        (http://creativecommons.org/licenses/by-sa/2.0/)
      fees: 'None'
layers:
   #dodgecowi
  - name: dodgecowi_hillshade_layer
    title: Dodge County, WI Main Tab
    sources: [dodgecowi_hillshade]
  - name: dodgecowi_aerial2006_layer
    title: Dodge County, WI Main Tab
    sources: [dodgecowi_aerial2006]
  - name: dodgecowi_aerial1999_layer
    title: Dodge County, WI Main Tab
    sources: [dodgecowi_aerial1999]
  - name: dodgecowi_aerial2012_layer
    title: Dodge County, WI Main Tab
    sources: [dodgecowi_aerial2012]
caches:
#dodgecowi
  dodgecowi_hillshade:
    grids: [dodgecowi_grid]
    sources: [dodgecowi_hillshade_wms]
    format: image/jpeg
  dodgecowi_aerial2006:
    grids: [dodgecowi_grid]
    sources: [dodgecowi_aerial2006_wms]
    format: image/jpeg
  dodgecowi_aerial1999:
    grids: [dodgecowi_grid]
    sources: [dodgecowi_aerial1999_wms]
    format: image/jpeg
  dodgecowi_aerial2012:
    grids: [dodgecowi_grid]
    sources: [dodgecowi_aerial2012_wms]
    format: image/jpeg
sources:
#dodgecowi:
  dodgecowi_hillshade_wms:
    type: wms
    req:
      url:
http://ags1.wgxtreme.com/ArcGIS/services/DodgeCoWi/DodgeCoWIMain/MapServer/WMSServer
?
      layers: 0
      supported_srs: ['EPSG:4326', 'EPSG:103413']
      supported_formats: ['image/jpeg']
      format: image/jpeg
  dodgecowi_aerial2006_wms:
    type: wms
    req:
      url:
http://ags1.wgxtreme.com/ArcGIS/services/DodgeCoWi/DodgeCoWIMain/MapServer/WMSServer
?
      layers: 1
      supported_srs: ['EPSG:4326', 'EPSG:103413']
      supported_formats: ['image/jpeg']
      format: image/jpeg
  dodgecowi_aerial1999_wms:
    type: wms
    req:
      url:
http://ags1.wgxtreme.com/ArcGIS/services/DodgeCoWi/DodgeCoWIMain/MapServer/WMSServer
?
      layers: 2
      supported_srs: ['EPSG:4326', 'EPSG:103413']
      supported_formats: ['image/jpeg']
      format: image/jpeg
  dodgecowi_aerial2012_wms:
    type: wms
    req:
      url:
http://ags1.wgxtreme.com/ArcGIS/services/DodgeCoWi/DodgeCoWIMain/MapServer/WMSServer
?
      layers: 3
      supported_srs: ['EPSG:4326', 'EPSG:103413']
      supported_formats: ['image/jpeg']
      format: image/jpeg
grids:
  dodgecowi_grid:
    srs: 'EPSG:103413'
    tile_size: [256, 256]
    bbox: [771292.20390976,617600.31082016,992212.34279864,799240.93582016]
    res:
[564.2361111111111,477.4305555555556,390.62500000000006,303.8194444444444,217.013888888888,104.16666666666666,52.08333333333333,41.666666666666664,20.833333333333332,10.416666666666666,9.375,8.333333333333334,7.291666666666666,6.250000000000001,5.208333333333333,4.166666666666667,2.0833333333333335,1.0416666666666667,0.86805555555556,0.7812500000000001,0.6944444444444444,0.6076388888888888,0.5208333333333334,0.43402777777778,0.3472222222222222,0.2604166666666667,0.17361111111111,0.08680555555555555,0.043402777777777776]
globals:
  # # coordinate transformation options
  # srs:
  #   # WMS 1.3.0 requires all coordiates in the correct axis order,
  #   # i.e. lon/lat or lat/lon. Use the following settings to
  #   # explicitly set a CRS to either North/East or East/North
  #   # ordering.
  #   axis_order_ne: ['EPSG:9999', 'EPSG:9998']
  #   axis_order_en: ['EPSG:0000', 'EPSG:0001']
  #   # you can set the proj4 data dir here, if you need custom
  #   # epsg definitions. the path must contain a file named 'epsg'
  #   # the format of the file is:
  #   # <4326> +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs  <>
  #   proj_data_dir: '/path to dir that contains epsg file'

  srs:
    proj_data_dir: '../srs'

  # # cache options
  cache:
    # where to store the cached images
    base_dir: '/mnt/cache'
    # where to store lockfiles
    lock_dir: '/tmp/tile_locks'
  #   # request x*y tiles in one step
    meta_size: [6, 6]
  #   # add a buffer on all sides (in pixel) when requesting
  #   # new images
    meta_buffer: 256


  # image/transformation options
  image:
      # resampling_method: nearest
      # resampling_method: bilinear
      resampling_method: bicubic
      jpeg_quality: 90
  #     # stretch cached images by this factor before
  #     # using the next level
      stretch_factor: 1.15
  #     # shrink cached images up to this factor before
  #     # returning an empty image (for the first level)
      max_shrink_factor: 4.0



-- 
Jeremy Holt
GIS Consultant
Applied Data Consultants, Inc.
www.adc4gis.com
715-874-4397 ext. 243
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20150511/8a63e4af/attachment.html>
-------------- next part --------------
facility
mapproxy.wsgiapp
file
/usr/local/lib/python2.7/dist-packages/mapproxy/wsgiapp.py
function
__call__
level
Critical [2]
line
187
message
fatal error in service for /service SRS=EPSG%3A103413&LAYERS=dodgecowi_aerial2012_layer&FORMAT=image%2Fjpeg&TILED=true&TILESORIGIN=771292.20390976%2C617600.31082016&WIDTH=256&HEIGHT=256&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&BBOX=830492.20390976,675866.97748683,830625.53724309,676000.31082016
pid
2668
process_name
MainProcess
source
wwt-virt-mproxy1
thread_name
GreenThread-253
version
1.0
full_message
Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/mapproxy/wsgiapp.py", line 181, in __call__
resp = self.handlers[handler_name].handle(req)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/service/ows.py", line 38, in handle
return self.services[service].handle(req)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/service/base.py", line 30, in handle
return handler(parsed_req)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/service/wms.py", line 130, in map
renderer.render(merger)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/service/wms.py", line 529, in render
layer_merger)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/util/async.py", line 82, in call
return func(*args)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/service/wms.py", line 578, in _render_layer
layer_img = layer.get_map(self.query)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/layer.py", line 425, in get_map
result = self._image(query)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/layer.py", line 458, in _image
tile_collection = self.tile_manager.load_tile_coords(affected_tile_coords, with_metadata=query.tiled_only)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/cache/tile.py", line 127, in load_tile_coords
created_tiles = creator.create_tiles(uncached_tiles)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/cache/tile.py", line 229, in create_tiles
created_tiles = self._create_meta_tiles(meta_tiles)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/cache/tile.py", line 302, in _create_meta_tiles
created_tiles.extend(self._create_meta_tile(meta_tile))

File "/usr/local/lib/python2.7/dist-packages/mapproxy/cache/tile.py", line 310, in _create_meta_tile
with self.tile_mgr.lock(main_tile):

File "/usr/local/lib/python2.7/dist-packages/mapproxy/platform/cpython/lock.py", line 42, in __enter__
self.lock()

File "/usr/local/lib/python2.7/dist-packages/mapproxy/platform/cpython/lock.py", line 65, in lock
self._lock = self._try_lock()

File "/usr/local/lib/python2.7/dist-packages/mapproxy/platform/cpython/lock.py", line 56, in _try_lock
return LockFile(self.lock_file)

File "/usr/local/lib/python2.7/dist-packages/mapproxy/util/ext/lockfile.py", line 131, in __init__
fp.truncate()

IOError: [Errno 116] Stale file handle


More information about the MapProxy mailing list