[MapProxy] format of cache file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[MapProxy] format of cache file

omid omidan
Hi list

I use mapproxy 1.8.2 and config a cache with this configuration.
the problem is I expect to tile images save in cache directory with .jpg file extention but they save with .png extension.
the source tiles is jpg format and the format parameter also set to jpg whay it still save file with .png?

caches:
  my_cache:
    sources: [mymap]
    grids: [GLOBAL_MERCATOR]
    # use a custom image format defined below
    format: jpg
    cache:
      type: file
      directory: /media/disk2/mycache/
      directory_layout: tms

sources:
  mymap:
    type: tile
    url: <a href="http://192.168.0.100/wmts?service=wmts&amp;request=gettile&amp;version=1.0.0&amp;layer=mylayer&amp;tilematrixset=webmercator&amp;tilematrix=%(z)s&amp;tilerow=%(y)s&amp;tilecol=%(x)s&amp;format=image%%2fjpg">http://192.168.0.100/wmts?service=wmts&request=gettile&version=1.0.0&layer=mylayer&tilematrixset=webmercator&tilematrix=%(z)s&tilerow=%(y)s&tilecol=%(x)s&format=image%%2fjpg

omid


_______________________________________________
MapProxy mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapproxy
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] format of cache file

Just van den Broecke
Hi Omid,

I think that the format field should be

     format: image/jpeg

See documentation:
https://mapproxy.org/docs/nightly/configuration.html#caches

Best,

Just
On 28-06-16 22:52, omid omidan wrote:

> Hi list
>
> I use mapproxy 1.8.2 and config a cache with this configuration.
> the problem is I expect to tile images save in cache directory with .jpg
> file extention but they save with .png extension.
> the source tiles is jpg format and the format parameter also set to jpg
> whay it still save file with .png?
>
> *caches:*
>   my_cache:
>     sources: [mymap]
>     grids: [GLOBAL_MERCATOR]
>     # use a custom image format defined below
>     format: jpg
>     cache:
>       type: file
>       directory: /media/disk2/mycache/
>       directory_layout: tms
>
> *sources:*
>   mymap:
>     type: tile
>
> url: <a href="http://192.168.0.100/wmts?service=wmts&request=gettile&version=1.0.0&layer=mylayer&tilematrixset=webmercator&tilematrix=%(z)s&tilerow=%(y)s&tilecol=%(x)s&format=image%%2fjpg">http://192.168.0.100/wmts?service=wmts&request=gettile&version=1.0.0&layer=mylayer&tilematrixset=webmercator&tilematrix=%(z)s&tilerow=%(y)s&tilecol=%(x)s&format=image%%2fjpg
>
> omid
>
>
>
> _______________________________________________
> MapProxy mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapproxy
>



_______________________________________________
MapProxy mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapproxy
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] format of cache file

omid omidan
Hi Just

thank you for your reply. 
I figure it out about the format but I had to use "image/jpg" instead of "image/jpeg" because I have a prebuild cache with .jpg extension.
Also I notice when I use "request_format: image/jpg" in a cache config the "format" parameter in source is only set to "jpg". So I have to use "FORMAT=image%%2F%(format)s" instead of "FORMAT=%(format)s" that mentioned in example of https://mapproxy.org/docs/nightly/sources.html#tiles-label"

Regards

_______________________________________________
MapProxy mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapproxy