[MapProxy] extension-less tiles as source?

Oliver Tonnhofer olt at omniscale.de
Fri Feb 12 04:02:42 PST 2016


Thanks for the configuration.

Python tries to guess the content-type for file:// URLs. It returns image/jpeg for .jpg files, but text/plain for files without any file suffix.
But MapProxy refuses to load non-image responses. You do not see anything in the demo because of your on_error configuration.


Can you tell MapTiler to use .png or .jpeg as the extension? It doesn’t matter for MapProxy if a .png actually contains JPEG data.


Regards,
Oliver

-- 
Oliver Tonnhofer  | Omniscale GmbH & Co KG  | http://omniscale.com
OpenStreetMap WMS and tile services         | http://maps.omniscale.com




> On 10.02.2016, at 22:10, Pestereva, Anna <apestereva at aerialservicesinc.com> wrote:
> 
> Oliver,
> 
> thank you, your reply is encouraging, but it doesn't seem to work for me.. No tiles are returned when viewing in Demo app, and no cache is generated.
> 
> I checked the source-requests.log - and saw that the extensionless files were being requested from the supplied source, and they even got returned (there is size value) - but that still didn't result in visible layer.. Here is a snippet from source-requests.log:
> 
> [2016-02-10 14:45:13,039] GET file:///path/to/hybrid/13/1989/5180 - 2.2 0
> [2016-02-10 14:45:13,080] GET file:///path/to/hybrid/13/1990/5180 - - 0
> [2016-02-10 14:45:13,104] GET file:///path/to/hybrid/13/1989/5179 - 5.3 0
> [2016-02-10 14:45:13,190] GET file:///path/to/hybrid/13/1990/5179 - - 0
> 
> 
> When I substituted the source URL for a jpg tileset copy - whether also local, or hosted on another server - I was able to see the layer properly in the Demo app. So, I'm assuming the rest of the config is correct. Here is the snippet of my config:
> 
> 
> layers:
>   - name: asi_hybrid_test
>     title: Test layer from extensionless hybrid source
>     sources: [hybrid_test_cache]
> 
> caches:
>   hybrid_test_cache:
>     grids: [webmercator]
>     sources: [hybrid_test_tms]
> 
> parts:
>   on_error: &onerror
>     other:
>       response: transparent
>       cache: false
> 
> sources:
>   hybrid_test_tms:
>     url: file:///path/to/hybrid/%(z)s/%(x)s/%(y)s
> #    url: http://maps.asi-gis.com/webmaps/tiles/gndvi3/%(z)s/%(x)s/%(y)s.jpg
> #    url: file:///path/to/gndvi3/%(z)s/%(x)s/%(y)s.jpg
>     type: tile
>     coverage:
>       bbox: [-92.6, 42.9, -92.5, 43.0]
>       bbox_srs: 'EPSG:4326'
>     transparent: true
>     on_error: *onerror
> 
> 
> My only next thought is - should I be configuring a custom grid?
> 
> Side question - do you happen to know how common is such use of tiles with no format? This is first time I run into it, and couldn't find support for this approach in the WMTS standard.
> 
> Would appreciate any suggestions. Thank you!
> 
> 
> On Tue, Feb 9, 2016 at 8:38 AM, Oliver Tonnhofer <olt at omniscale.de> wrote:
> Hi,
> 
> that should work.
> 
> Can you provide a full example?
> 
> 
> Regards,
> Oliver
> 
> --
> Oliver Tonnhofer  | Omniscale GmbH & Co KG  | http://omniscale.com
> OpenStreetMap WMS and tile services         | http://maps.omniscale.com
> 
> 
> 
> 
> > On 06.02.2016, at 00:41, Pestereva, Anna <apestereva at aerialservicesinc.com> wrote:
> >
> > Hello all,
> >
> > has anyone had experience with using tiles without any extensions as a Mapproxy source?
> >
> > So far my tests were not successful, I tried configuring these URLs in my source with no luck:
> > url: file:///path/to/my/tiles/%(z)s/%(x)s/%(y)s
> > url: file:///path/to/my/tiles/%(z)s/%(x)s/%(y)s.
> > There were no errors when trying to view my layer, but no imagery was served either, and no cache got generated.
> >
> > In our case, we need to use hybrid tile format (jpg+png) and Maptiler started producing hybrid tiles with no extensions as of version 0.6.3. Leaflet does show such tiles if configuring directly, like so
> > L.tileLayer('{z}/{x}/{y}', options).addTo(map);
> > However we are looking to use these tiles in Mapproxy.
> >
> > Thank you!
> > --
> > Anna Pestereva, GISP | Application Developer & Cartographer
> > Aerial Services, Inc. (ASI)
> > APestereva at AerialServicesInc.com | LinkedIn
> > www.AerialServicesInc.com | Photo{blog}metry
> > _______________________________________________
> > MapProxy mailing list
> > MapProxy at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapproxy
> 
> 
> 
> 
> -- 
> Anna Pestereva, GISP | Application Developer & Cartographer
> Aerial Services, Inc. (ASI) 
> Office: (319) 277-0436 | Direct: (319) 553-0261 | Mobile: (319) 830-6340 | Fax: (866) 800-4799
> 6315 Chancellor Drive | Cedar Falls, Iowa 50613 
> APestereva at AerialServicesInc.com | LinkedIn
> www.AerialServicesInc.com | Photo{blog}metry



More information about the MapProxy mailing list