source: subversion/applications/rendering/mapnik/get-coastlines.sh @ 26797

Last change on this file since 26797 was 26797, checked in by apmon, 8 years ago

Allow to specify the directory into which coastlines get downloaded

  • Property svn:executable set to *
File size: 2.4 KB
Line 
1#!/bin/sh
2
3# Copyright (C) 2010 Rodolphe Quiédeville <rodolphe@quiedeville.org>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9
10UNZIP=/usr/bin/unzip
11TAR=/bin/tar
12BUNZIP2=/bin/bunzip2
13WGET=/usr/bin/wget
14
15if [ -z $1 ] ; then
16OUTDIR=`pwd`
17else
18OUTDIR=$1
19fi
20
21
22if [ ! -x $UNZIP ]; then
23    echo "unzip is not installed in $UNZIP, it is needed by this script"
24    exit
25fi
26
27if [ ! -x $TAR ]; then
28    echo "tar is not installed in $TAR, it is needed by this script"
29    exit
30fi
31
32if [ ! -x $BUNZIP2 ]; then
33    echo "bunzip2 is not installed in $BUNZIP2, it is needed by this script"
34    exit
35fi
36
37if [ ! -x $WGET ]; then
38    echo "wget is not installed in $WGET, it is needed by this script"
39    exit
40fi
41
42$WGET http://tile.openstreetmap.org/world_boundaries-spherical.tgz -O $OUTDIR/world_boundaries-spherical.tgz
43$WGET http://tile.openstreetmap.org/processed_p.tar.bz2 -O $OUTDIR/processed_p.tar.bz2
44$WGET http://tile.openstreetmap.org/shoreline_300.tar.bz2 -O $OUTDIR/shoreline_300.tar.bz2
45$WGET http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/10m-populated-places.zip -O $OUTDIR/10m-populated-places.zip
46$WGET http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/110m-admin-0-boundary-lines.zip -O $OUTDIR/110m-admin-0-boundary-lines.zip
47
48$TAR xvf $OUTDIR/world_boundaries-spherical.tgz -C $OUTDIR
49
50if [ -d $OUTDIR/world_boundaries ]; then
51
52        if [ -f $OUTDIR/processed_p.tar.bz2 ]; then
53                $TAR xvf $OUTDIR/processed_p.tar.bz2 -C $OUTDIR
54                mv $OUTDIR/processed_p.[dis]* $OUTDIR/world_boundaries/
55        else
56                echo 'processed_p.tar.bz2 not present'
57        fi
58
59        if [ -f $OUTDIR/shoreline_300.tar.bz2 ]; then
60                $TAR xvf $OUTDIR/shoreline_300.tar.bz2 -C $OUTDIR
61                mv $OUTDIR/shoreline_300.[dis]* $OUTDIR/world_boundaries/
62        else
63                echo 'shoreline_300.tar.bz2 not present'
64        fi
65
66        if [ -f $OUTDIR/10m-populated-places.zip ]; then
67                $UNZIP $OUTDIR/10m-populated-places.zip -d $OUTDIR/world_boundaries
68        else
69                echo '10m-populated-places.zip not present'
70        fi
71
72        if [ -f $OUTDIR/110m-admin-0-boundary-lines.zip ]; then
73                $UNZIP $OUTDIR/110m-admin-0-boundary-lines.zip -d $OUTDIR/world_boundaries
74        else
75                echo '110m-admin-0-boundary-lines.zip not present'
76        fi
77
78fi
Note: See TracBrowser for help on using the repository browser.