Menu

#31 Download changed tiles

closed
r_x
5
2012-09-18
2009-11-04
Anonymous
No

I've created a few profiles for OpenStreetMap atlases for areas where I frequently use TrekBuddy, but I'd like to update them from time to time. Is there a way to only download the tiles that have changed since the last download? I tried using wget, but it says "Last-modified header missing". Does this mean that OSM doesn't timestamp their files? If so, I guess there is no way for TAC to figure it out either.

Discussion

  • r_x

    r_x - 2009-11-05

    The supported update mechanism depends on the map source.
    OSM (Mapnik) for example doesn't use timestamps, it uses eTag (If-None-Match) whereas Google Maps uses If-Modified-Since. Some other do set the Last-Modified header field but do not support If-Modified-Since (you have to use HTTP HEAD to check instead) and last but not least some maps do not even provide the last-Modified time.

    I am currently working on a full support of all those cases in TAC together with configurable tile update/expiration time. The current SVN state already contains the checks via f-None-Match and If-Modified-Since. But be aware that the tile storage format is now a database instead of a plain directory.

     
  • Anonymous

    Anonymous - 2009-11-05

    If I understand the HTML spec correctly, if-none-match is not connected to a modification of any kind. Since this would be useful and seems not to be hard to implement, should we be asking OSM to implement it?

     
  • r_x

    r_x - 2009-11-06

    Sorry but I disagree - it is connected to a modification:

    "A client that has one or more entities previously obtained from the resource can verify that one of those entities is current by including a list of their associated entity tags in the If-Match header field."
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.24

    "is current" translated for a map tile means "has been modified since I doenloaded it".

    BTW: The two most popular map sources already allow conditional requests:
    OpenStreetMap Mapnik: IfNoneMatch
    OpenStreetMap Osmarenderer: IfModifiedSince

     
  • r_x

    r_x - 2009-11-22

    I finished the implementation that allows to download only updated tiles.

    The last two cases were "LastModified" and "ETag" which both require an additional check via HTTP HEAD to retrieve the attribute LastModified respectively the ETag attribute. Once received it can be compared with the data from tile store if the tile on the server is newer than the local tile.

    Of course there are still map sources which do not provide any attributes on the state of the tiles. For example Google does currently not provide any attributes. Those maps are checked on a time basis.

     

Log in to post a comment.

MongoDB Logo MongoDB