Risto H. Kurppa | 11 Aug 14:18

Downloading only updated tiles

Hi!

I've been trying to find a way to download only the updated tiles. I'm
currently using OpenMoko Freerunner and TangoGPS (both to navigate and
contribute to OSM). I download the maps with tangogps.

Now the thing I don't get: what's the best way to update the maps I've
downloaded. I have maps from several areas, some 300 MB maybe. I know
I could just delete all those files every thursday and tell tangogps
to download it all again but it's a waste of time (to scroll here and
there with tangogps and download time) and bandwith: why to download
300MB if there's only say 10 tiles updated?

So is there a way to update my local maps so that only the changed
tiles would be downloaded? rsync that checks if the file is changed
and then updates? I wonder if there really is not a tool or OSM API
that could do this, I'd think it's pretty important feature for anyone
using or contributing to OSM.

I've tried asking around this in some places but so far I got around 0
answer. So if you can help me, please do, if not, guide me to someone
who can.

r

btw. what programs you use to download tiles?

--

-- 
| risto h. kurppa
| risto at kurppa dot fi
(Continue reading)

Andy Allan | 11 Aug 16:02

Re: Downloading only updated tiles

On Mon, Aug 11, 2008 at 1:21 PM, Risto H. Kurppa <risto@...> wrote:

> So is there a way to update my local maps so that only the changed
> tiles would be downloaded? rsync that checks if the file is changed
> and then updates?

You can use the ETag HTTP header from the tiles to see if they have
been changed, so long as your application keeps track of them. See
http://en.wikipedia.org/wiki/HTTP_ETag

andy <at> everest:~$ curl --head http://a.tile.openstreetmap.org/9/256/170.png
HTTP/1.1 200 OK
Date: Mon, 11 Aug 2008 13:58:21 GMT
Server: Apache/2.2.4 (Ubuntu)
ETag: "da41b3eb954cb826578be4d26ccff719"
Content-Length: 24554
Cache-Control: max-age=554888
Expires: Mon, 18 Aug 2008 00:06:29 GMT
Content-Type: image/png

> I've tried asking around this in some places but so far I got around 0
> answer. So if you can help me, please do, if not, guide me to someone
> who can.

If you have more technical questions on this you can ask on our
developers mailing list.

Cheers,
Andy

(Continue reading)

GeoJ | 12 Aug 12:58
Favicon

Re: Downloading only updated tiles

Andy Allan wrote:
> You can use the ETag HTTP header from the tiles to see if they have
> been changed, so long as your application keeps track of them. 

Is the ETag mechanism better that the "LastModified" mechanism?

IMHO for custom applications/scripts maintaining a etag database is very 
complicated therefore it is easier to just redownload a tile instead of 
dealing with the ETags...

BTW: The tiles <at> home tiles server use the LastModified header and they 
support the IfModifiedSince header...

GeoJ

Risto H. Kurppa | 15 Aug 15:01

Re: Downloading only updated tiles

On Tue, Aug 12, 2008 at 1:58 PM, GeoJ <geoj@...> wrote:
> Andy Allan wrote:
>> You can use the ETag HTTP header from the tiles to see if they have
>> been changed, so long as your application keeps track of them.
>
> Is the ETag mechanism better that the "LastModified" mechanism?
>
> IMHO for custom applications/scripts maintaining a etag database is very
> complicated therefore it is easier to just redownload a tile instead of
> dealing with the ETags...
>
> BTW: The tiles <at> home tiles server use the LastModified header and they
> support the IfModifiedSince header...
>
> GeoJ

There's now a python script that can now update the local files:
http://stetson.frozenhat.fi/~tpr/temp/osmupdater-20080814.tar.bz2

run: python osmupdater.py --help

r

--

-- 
| risto h. kurppa
| risto at kurppa dot fi
| http://risto.kurppa.fi

GeoJ | 22 Aug 17:00
Favicon

Re: Downloading only updated tiles

Risto H. Kurppa wrote:

> There's now a python script that can now update the local files:
> http://stetson.frozenhat.fi/~tpr/temp/osmupdater-20080814.tar.bz2

Are you sure that the ETag is always the tile's md5 value? Is that 
somewhere documented?

GeoJ

Pradeep B V | 9 Sep 08:07

Re: Downloading only updated tiles

On Mon, Aug 11, 2008 at 5:51 PM, Risto H. Kurppa <risto-8T9w5u9gdsv1KXRcyAk9cg@public.gmane.org> wrote:
Hi!

I've been trying to find a way to download only the updated tiles. I'm
currently using OpenMoko Freerunner and TangoGPS (both to navigate and
contribute to OSM). I download the maps with tangogps.


I think that this may be of help

http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.5#Getting_list_of_changed_tiles

Try http://openstreetmap.org/api/0.5/changes?hours=1&zoom=16

This will list all the tiles that have changed in the last 1 hr in zoom level 16.

--
Pradeep B V
Mapunity: social technology at work
www.mapunity.in
<div><div dir="ltr">On Mon, Aug 11, 2008 at 5:51 PM, Risto H. Kurppa <span dir="ltr">&lt;<a href="mailto:risto@...">risto@...</a>&gt;</span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote">
Hi!<br><br>
I've been trying to find a way to download only the updated tiles. I'm<br>
currently using OpenMoko Freerunner and TangoGPS (both to navigate and<br>
contribute to OSM). I download the maps with tangogps.<br><br>
</blockquote>
<div>
<br>I think that this may be of help<br><br><a href="http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.5#Getting_list_of_changed_tiles">http://wiki.openstreetmap.org/index.php/OSM_Protocol_Version_0.5#Getting_list_of_changed_tiles</a><br><br>Try <a href="http://openstreetmap.org/api/0.5/changes?hours=1&amp;zoom=16">http://openstreetmap.org/api/0.5/changes?hours=1&amp;zoom=16</a><br><br>This will list all the tiles that have changed in the last 1 hr in zoom level 16. <br><br>
</div>
</div>-- <br>Pradeep B V<br>Mapunity: social technology at work<br><a href="http://www.mapunity.in">www.mapunity.in</a><br>
</div></div>

Gmane