Re: Caching tiles locally?
- From: "Zeeshan Ali (Khattak)" <zeeshanak gnome org>
- To: Jiří Techet <techet gmail com>
- Cc: libchamplain mailing list <libchamplain-list gnome org>
- Subject: Re: Caching tiles locally?
- Date: Thu, 14 May 2015 14:04:14 +0100
Hi Fabrice,
Just FYI, the current caching methods downloads tile images and can
easily take a huge amount of disk space. We are hoping that Jonas'
work will client-side rendering possible and once that is the case, we
have a good platform to cache vector tiles instead, which consume a
lot less disk space.
http://jonasdn.blogspot.se/2015/05/client-side-rendering-of-our-map-using.html
On Thu, May 14, 2015 at 1:21 PM, Jiří Techet <techet gmail com> wrote:
Hi Fabrice,
in principle you have to get the map source from the view using
champlain_view_get_map_source()
then get x, y tile coordinates using
champlain_map_source_get_x()
champlain_map_source_get_y()
for specific latitude and longitude and create a new tile with these
coordinates using
champlain_tile_new_full ()
(tile size is 256). At this point you may also want to connect the
"render-complete" signal to know when tile gets loaded. Now call
champlain_map_source_fill_tile()
The tile will be filled and cached automatically in libchamplain cache under
~/.cache/champlain.
Now you'll have to do the above in a loop for the area you are interested in
and also for the zoom levels you are interested in.
But most importantly, make sure you follow the terms of use of the tile
provider you are going to use. See for instance the section "Bulk
Downloading" here
http://wiki.openstreetmap.org/wiki/Tile_usage_policy
This is also the reason why you have to do such a thing manually (provided
you know what you are doing and it's legal) and there's no single-call
function directly in libchamplain so people don't cause high load on the
tile servers.
Cheers,
Jiri
On Thu, May 14, 2015 at 12:56 PM, Fabrice Delente <delentef gmail com>
wrote:
Hello,
I use libchamplain in python+GTK3 to create a small GPS viewer for the
tracks I run in my hometown. I'd like to cache the data for my town on
my computer, so that I don't have to reload the data from the web.
I've looked at the API but don't see how I can do that, can anybody
give me directions? Thanks.
_______________________________________________
libchamplain-list mailing list
libchamplain-list gnome org
https://mail.gnome.org/mailman/listinfo/libchamplain-list
_______________________________________________
libchamplain-list mailing list
libchamplain-list gnome org
https://mail.gnome.org/mailman/listinfo/libchamplain-list
--
Regards,
Zeeshan Ali (Khattak)
________________________________________
Befriend GNOME: http://www.gnome.org/friends/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]