[MapProxy] Decoding Error

Jeff Konnen jaykayone at gmail.com
Mon Jul 2 13:41:15 PDT 2012


Hi Oliver

Could it be python 2.6?
On RHEL, we use python 2.6, on mac os, i tested with python 2.7
Otherwise versions of mapproxy and PIL seem to identical

Thanks for your help
Jeff

On 02 Jul 2012, at 16:15, Jeff Konnen wrote:

> Upgrading Mapproxy and PIL to 1.4.0 resp 1.1.7 did not help either :(
> 
> Some more information: After upgrading, the error message is a bit more precise:
> unable to load tile <mapproxy.image.ImageSource object at 0x7fac30036750>, removing it (reason was: broken data stream when reading image file)
> 
> I still have no idea how to fix this, as I can't reproduce the error when I try to access the same file with PIL from command-line.
> 
> Here is my test yaml:
> services:
>   demo:
>   kml:
>   tms:
>     # needs no arguments
>   wms:
>     srs: ['EPSG:2169']
>     image_formats: ['image/jpeg','image/png']
>     md:
>       # metadata used in capabilities documents
>       title: MapProxy WMS Proxy
>       abstract: This is the fantastic MapProxy.
>       online_resource: http://mapproxy.org/
>       contact:
>         person: Your Name Here
>         position: Technical Director
>         organization: 
>         address: Fakestreet 123
>         city: Somewhere
>         postcode: 12345
>         country: Germany
>         phone: +49(0)000-000000-0
>         fax: +49(0)000-000000-0
>         email: info at omniscale.de
>       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:
>   - name: OSM_MQ
>     title: OSM_MQ
>     sources: [osm_cache_mq]
>   
> grids:
>   global_mercator_osm:
>     base: GLOBAL_MERCATOR
>     num_levels: 18 
>     origin: nw
>     srs: EPSG:900913    
>     
> caches:
>   osm_cache_mq:
>     grids: [global_mercator_osm]
>     sources: [osm_tms_mq]  
>     disable_storage: true
>     format: image/png    
>     cache:
>       type: mbtiles
>       filename: /tmp/osm_mq.mbtiles
>       
> 
> sources:
>   osm_tms_mq:
>     type: tile
>     url: http://otile1.mqcdn.com/tiles/1.0.0/osm/%(tms_path)s.png
>     grid: global_mercator_osm   
>     on_error:
>         202:
>           response: transparent
>           cache: True    
> 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: '/usr/share/proj/'
> 
>   # image/transformation options
>   image:
>       #resampling_method: nearest
>       # resampling_method: bilinear
>        resampling_method: bicubic
>        paletted: false
>   #     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
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> and the test request:
> http://mapproxy:8080/service?VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:2169&BBOX=-5492.29987506387,969.790037458326,168537.735685007,192859.236316351&WIDTH=877&HEIGHT=967&LAYERS=OSM_MQ&STYLES=&EXCEPTIONS=application/vnd.ogc.se_xml&FORMAT=image/png&BGCOLOR=0xFEFFFF&TRANSPARENT=TRUE
> 
> 
> Thanks in advance
> Jeff
> 
> On Fri, Jun 29, 2012 at 11:42 AM, Jeff Konnen <jaykayone at gmail.com> wrote:
> This is weird, if I try to open the file in python, it seems to be ok:
> 
> import urllib2
> import Image
> from cStringIO import StringIO
> im = Image.open(StringIO(urllib2.urlopen("http://otile2.mqcdn.com/tiles/1.0.0/osm/9/264/174.png").read()))
> print im.format, im.size, im.mode
> 
> but when using mapproxy I still get this message: 
> 
> [2012-06-29 11:24:26,823] mapproxy.image.tile - WARNING - unable to load tile <mapproxy.image.ImageSource object at 0x7fc9f0034ad0>, removing it (reason was: decoding error when reading image file)
> 
> fyi, this is my source:
>   osm_tms_mq:
>     type: tile
>     url: http://otile1.mqcdn.com/tiles/1.0.0/osm/%(tms_path)s.png
>     grid: global_mercator_osm
>     on_error:
>         202:
>           response: transparent
>           cache: True
> 
> and my wms definition:
>  wms:
>     srs: ['EPSG:2169','EPSG:310024802']
>     image_formats: ['image/jpeg','image/png']
> 
> my test-request: http://mapproxy:8080/service?VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:2169&BBOX=-5492.29987506387,969.790037458326,168537.735685007,192859.236316351&WIDTH=877&HEIGHT=967&LAYERS=OSM_MQ&STYLES=&EXCEPTIONS=application/vnd.ogc.se_xml&FORMAT=image/png&BGCOLOR=0xFEFFFF&TRANSPARENT=TRUE
> 
> I've been using this WMS for a while now and it seems to be only that one tile
> Any idea?
> Jeff
> 
> 
> 
> On Wed, Jun 27, 2012 at 11:56 AM, Jeff Konnen <jaykayone at gmail.com> wrote:
> 
> 
> On Wed, Jun 27, 2012 at 11:50 AM, Oliver Tonnhofer <olt at omniscale.de> wrote:
> 
> On 27.06.2012, at 11:36, Jeff Konnen wrote:
> > I've found this error in my logs: [2012-06-27 11:33:57,623] mapproxy.image.tile - WARNING - unable to load tile <mapproxy.image.ImageSource object at 0x7f52bc03e350>, removing it (reason was: decoding error when reading image file)
> >
> > It's about this tile: http://otile2.mqcdn.com/tiles/1.0.0/osm/9/264/174.png
> 
> Are you sure that this is the right file? MapProxy removes the tile when you see this warning and will re-request it from the source.
> 
> > Does anyone have an idea about what this could be about?
> 
> MapProxy/PIL could somehow not read the tile.
> 
> BTW: The tile is a JPEG and not a PNG.
> 
> 
> That's correct, but the neighbouring tiles are all JPEGs called PNG too and PIL can read them, it's weird..
>  
> Regards,
> Oliver
> 
> --
> Oliver Tonnhofer    | Omniscale GmbH & Co KG    | http://omniscale.de
> http://mapproxy.org | https://bitbucket.org/olt | @oltonn
> 
> 
> 
> 
> 
> 
> 
> -- 
> Jeff Konnen
> 
> 
> 
> 
> -- 
> Jeff Konnen
> 
> 
> 
> 
> -- 
> Jeff Konnen
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20120702/464d5db2/attachment-0001.html>


More information about the MapProxy mailing list