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

Last change on this file since 25604 was 23827, checked in by rodo, 9 years ago

Improve binary detection and use

  • Property svn:executable set to *
File size: 2.1 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 [ ! -x $UNZIP ]; then
16    echo "unzip is not installed in $UNZIP, it is needed by this script"
17    exit
18fi
19
20if [ ! -x $TAR ]; then
21    echo "tar is not installed in $TAR, it is needed by this script"
22    exit
23fi
24
25if [ ! -x $BUNZIP2 ]; then
26    echo "bunzip2 is not installed in $BUNZIP2, it is needed by this script"
27    exit
28fi
29
30if [ ! -x $WGET ]; then
31    echo "wget is not installed in $WGET, it is needed by this script"
32    exit
33fi
34
35$WGET http://tile.openstreetmap.org/world_boundaries-spherical.tgz -O world_boundaries-spherical.tgz
36$WGET http://tile.openstreetmap.org/processed_p.tar.bz2 -O processed_p.tar.bz2
37$WGET http://tile.openstreetmap.org/shoreline_300.tar.bz2 -O shoreline_300.tar.bz2
38$WGET http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/10m-populated-places.zip -O 10m-populated-places.zip
39$WGET http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/110m-admin-0-boundary-lines.zip -O 110m-admin-0-boundary-lines.zip
40
41$TAR xvf world_boundaries-spherical.tgz
42
43if [ -d world_boundaries ]; then
44
45        if [ -f processed_p.tar.bz2 ]; then
46                $TAR xvf processed_p.tar.bz2
47                mv processed_p.[dis]* world_boundaries/
48        else
49                echo 'processed_p.tar.bz2 not present'
50        fi
51
52        if [ -f shoreline_300.tar.bz2 ]; then
53                $TAR xvf shoreline_300.tar.bz2
54                mv shoreline_300.[dis]* world_boundaries/
55        else
56                echo 'shoreline_300.tar.bz2 not present'
57        fi
58
59        if [ -f 10m-populated-places.zip ]; then
60                $UNZIP 10m-populated-places.zip -d world_boundaries
61        else
62                echo '10m-populated-places.zip not present'
63        fi
64
65        if [ -f 110m-admin-0-boundary-lines.zip ]; then
66                $UNZIP 110m-admin-0-boundary-lines.zip -d world_boundaries
67        else
68                echo '110m-admin-0-boundary-lines.zip not present'
69        fi
70
71fi
Note: See TracBrowser for help on using the repository browser.