tangogps : updating tiles ?

Rask Ingemann Lambertsen ccc94453 at vip.cybercity.dk
Wed Jul 22 01:07:09 CEST 2009


On Tue, Jul 21, 2009 at 12:07:58PM +0200, Ed Kapitein wrote:
> On Tue, 2009-07-21 at 11:20 +0200, Xavier Cremaschi wrote:

> > Does anyone know how I can update my tiles to get the most up-to-date 
> > openstreetmap info ?

   I will recommend using Yaouh! or the other one that I've forgotten the
name of, search for "command line yaouh clone" in the archives. But that
should not be allowed to ruin the fun of working it out on the command line:

> It might be as easy as this:
> 
> for TILE in `find /path/to/tiles -type f`; do
>  echo "${TILE}"
>  FILE=`basename "${TILE}"`
>  L1=`dirname "${TILE}" | gawk -F"/" '{ print $NF}'`
>  L2=`dirname "${TILE}" | gawk -F"/" '{ print $(NF-1)}'`
>  curl --output "${TILE}"
> http://tile.openstreetmap.org/"${L2}"/"${L1}"/"${FILE}"
> done
> 
> curl and http are on the same line, you mail program might split in over
> two lines.

   Shorter (and likely faster) using awk, xargs and wget:

$ (cd ~/Maps/OSM && find -type f -print | cut -c3- | \
awk ' { print "http://tile.openstreetmap.org/" $0; }' | \
xargs wget --force-directories --no-host-directories -N --user-agent 'Opera')

-N doesn't do what you hope it does, but it has the important side effect of
making wget overwrite existing files instead of creating file.1.

   Figuring out what needs to be done to obviate the need for
--no-host-directories is left as an excercise to the reader.

-- 
Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year



More information about the community mailing list