[mapserver-users] MapCache Larger tiles, reduce number of files

Jean-Philippe Chenel jp.chenel at live.ca
Mon Mar 9 12:21:03 PDT 2020


Steve,

It is what I supposed, but when I've generated the tiles 512x512 using the default resolution GoogleMapCompatible, with the cache template {z}/{x}/{y}.{ext} and loaded it in OpenLayers using ol.source.XYZ, I've noticied that the x tile being tried to load was not in the good range.

z/x/-y.png

Tiles generated:
.../8/37 and 38/64 and 65.png

Tiles loaded by OpenLayers (with error 404):
.../8/73 to 77/130 and 131.png

Thanks,
________________________________
De : mapserver-users <mapserver-users-bounces at lists.osgeo.org> de la part de Stephen Woodbridge <stephenwoodbridge37 at gmail.com>
Envoyé : 9 mars 2020 14:56
À : mapserver-users at lists.osgeo.org <mapserver-users at lists.osgeo.org>
Objet : Re: [mapserver-users] MapCache Larger tiles, reduce number of files

Jean-Philippe,

I don't think it works like that. Resolution is determined by zoom
factor so you generate  metatile at that resolution then you chop that
metatile in tiles of whatever size you specify. So resolution is
controled by zoom not tile size.

-Steve W

On 3/9/2020 2:45 PM, Jean-Philippe Chenel wrote:
> Hi,
>
> With MapCache, I want to generate the tiles that will be copied to a
> mobile device, on a viewer created with OpenLayers.
>
> When generating a large extent, with multiple levels of zoom, the
> files count is really big, so I want to reduce the number of files by
> increasing the tile size. I've made a test with tiles 512x512, but
> I've realized that the resolution must be changed when changing tiles
> size. So, the tiles are bigger, but changing the resolution make
> generating the same number of files.
>
> I'm open for workaround and other tricks.
>
> mapcache.xml
>
> <grid name="GoogleMaps512">
> <metadata>
> <title>GoogleMaps512</title>
> </metadata>
> <extent>-20037508.3427892480 -20037508.3427892480 20037508.3427892480
> 20037508.3427892480</extent>
> <srs>EPSG:3857</srs>
> <srsalias>EPSG:900913</srsalias>
> <units>m</units>
> <size>512 512</size>
> <resolutions>156543.0339280410 78271.51696402048 39135.75848201023
> 19567.87924100512 9783.939620502561 4891.969810251280
> 2445.984905125640 1222.992452562820 611.4962262814100
> 305.7481131407048 152.8740565703525 76.43702828517624
> 38.21851414258813 19.10925707129406 9.554628535647032
> 4.777314267823516 2.388657133911758 1.194328566955879
> 0.5971642834779395</resolutions>
> </grid>
>
> <cache name="tmpl_xyz" type="disk" layout="template">
> <template>/data/mapcache/tiles/{tileset}/{grid}/{z}/{x}/{y}.{ext}</template>
> </cache>
>
> <tileset name="OpenStreetMap">
> <source>vmap0</source>
> <cache>tmpl_xyz</cache>
> <grid>GoogleMaps512</grid>
> <format>PNG</format>
> </tileset>
>
> With best regards,
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20200309/5a5ad221/attachment.htm>


More information about the MapServer-users mailing list