[mapserver-users] Mapcache instruction

Yves Jacolin yves.jacolin at camptocamp.com
Thu Sep 20 05:09:50 PDT 2018


<cache>disk</cache> should also be changed to <cache>mbtiles</cache> in
your example. Note that "mbtiles" is not the best name (I copy pasted my
example)! You can find a better name :)

And yes except that you need to create the db file (as you should
create a database postgresql before to use it) all other command are
similar.

Y.

PS : please keep reply to the list :)



Le jeu. 20 sept. 2018 à 13:44, Sebastiano Laini <
Sebastiano.Laini at buchanancomputing.co.uk> a écrit :

> I see, so I just need to replace this code:
>
>
>
>   <cache name="disk" type="disk">
>
>     <base>/var/www/vhosts/buchananmapping.co.uk/httpdocs/maps/cache</base>
>
>     <symlink_blank/>
>
>   </cache>
>
>
>
> Whith this:
>
>
>
>     <cache name="mbtiles" type="sqlite3">
>
>         <dbfile>/var/www/osm_google.db</dbfile>
>
>     </cache>
>
>
>
> And then used my code as usual? (changing the cache that I call in the
> tileset)
>
>
>
>   <source name="Mymaps" type="wms">
>
>     <getmap>
>
>       <params>
>
>         <FORMAT>image/jpeg</FORMAT>
>
>         <LAYERS>miniscale</LAYERS>
>
>         <MAP>/var/www/vhosts/DOMAIN/maps.map</MAP>
>
>       </params>
>
>     </getmap>
>
>     <http>
>
>       <url>URL/cgi-bin/mapserv?</url>
>
>     </http>
>
>   </source>
>
>
>
>   <tileset name="Mycache">
>
> <source>Mymaps</source>
>
> <cache>disk</cache>
>
> <grid>Mygrid</grid>
>
> <format>JPEG</format>
>
> <metatile>4 4</metatile>
>
>   <metabuffer>0</metabuffer>
>
>   <expires>31536000</expires>
>
>   </tileset>
>
>
>
>   <grid name="Mygrid">
>
>                <metadata>
>
> <title>this is a custom grid</title>
>
>                </metadata>
>
>                <srs>EPSG:27700</srs>
>
>                <size>128 128</size>
>
>                <extent>0 0 700000 1250000</extent>
>
>                <resolutions>70 28 14 7 6.16 2.8 1.4 0.7 0.28 0.14
> 0.07</resolutions>
>
> </grid>
>
>
>
> The request is going to be the same or is changing?
>
>
>
> An example of my actual request is this one:
>
>
>
>
> URL/mapcache/?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Mycache&TILED=true&WIDTH=128&HEIGHT=128&CRS=EPSG%3A27700&STYLES=&BBOX=465920%2C174800%2C501760%2C210640
>
>
>
> Is created through OpenLayers 4, I sent the cords “BBOX” and the cache
> name “LAYERS=Mycache”
>
>
>
> Sebastiano.
>
>
>
> *From:* Yves Jacolin [mailto:yves.jacolin at camptocamp.com]
> *Sent:* 20 September 2018 12:24
> *To:* Sebastiano Laini <Sebastiano.Laini at BuchananComputing.co.uk>
> *Cc:* mapserver-users <mapserver-users at lists.osgeo.org>
> *Subject:* Re: [mapserver-users] Mapcache instruction
>
>
>
> Here a short tuto from my personal notes:
>
>
>
> 1. create a cache entry in your mapcache file
>
>     <cache name="mbtiles" type="sqlite3">
>
>         <dbfile>/var/www/osm_google.db</dbfile>
>
>     </cache>
>
> 2. create a empty sqlite file
>
> - run sqlite3
>
> - run this commande inside sqlite3: ".save filename.db" (without ")
>
> 3. use this cache in your settings
>
>
>
> You don't need MySQL or PostgreSQL, only sqlite3 and its dependencies.
> Path used in my example for cache block are for Unix like system, you
> should adapt it for Windows : c:/....
>
>
>
> Y.
>
>
>
> Le jeu. 20 sept. 2018 à 13:07, Sebastiano Laini <
> Sebastiano.Laini at buchanancomputing.co.uk> a écrit :
>
> Hi all,
>
>
>
> We have a MapCache setup with “disk_cache” but we are running out of
> Inodes when I try to seed the whole UK with projection 27700.
>
>
>
> I was thinking to propose to my supervisor to use the “SQLite Caches” but
> I don’t know how it works. Can someone guide me through the process of
> setup MapCache with this type of cache? And if I need some dependency, we
> use PostgreSQL in our server so I assume I need to install also MySQL.
>
>
>
> I’ve already read the documentation but still I have doubt about the db
> part, how to create the db and locate it. I never use SQLite, just
> PostgreSQL.
>
>
>
> Regards;
>
>
>
> Sebastiano.
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
> --
>
> Training and support manager
> Camptocamp
> Bâtiment le Dauphin - 1er étage
> 18 rue du Lac Saint André
> 73382 Le Bourget-du Lac
>
> Tel (France) : +33 4 58 48 20 43
> Tel (Switzerland) : +41 21 619 10 43
> Mob. : +33 6 18 75 42 21
>
> email : yves.jacolin at camptocamp.com
> http://www.camptocamp.com
>


-- 
Training and support manager
Camptocamp
Bâtiment le Dauphin - 1er étage
18 rue du Lac Saint André
73382 Le Bourget-du Lac

Tel (France) : +33 4 58 48 20 43
Tel (Switzerland) : +41 21 619 10 43
Mob. : +33 6 18 75 42 21

email : yves.jacolin at camptocamp.com
http://www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20180920/7de07170/attachment-0001.html>


More information about the mapserver-users mailing list