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

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

Improve binary detection and use

  • Property svn:executable set to *
File size: 2.1 KB
RevLine 
[21386]1#!/bin/sh
2
[23827]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
[22615]10UNZIP=/usr/bin/unzip
11TAR=/bin/tar
12BUNZIP2=/bin/bunzip2
[23827]13WGET=/usr/bin/wget
[22615]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
[23827]30if [ ! -x $WGET ]; then
31    echo "wget is not installed in $WGET, it is needed by this script"
32    exit
33fi
[22615]34
[23827]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
[22456]40
[23827]41$TAR xvf world_boundaries-spherical.tgz
[21386]42
43if [ -d world_boundaries ]; then
44
[22456]45        if [ -f processed_p.tar.bz2 ]; then
[23827]46                $TAR xvf processed_p.tar.bz2
[22456]47                mv processed_p.[dis]* world_boundaries/
48        else
49                echo 'processed_p.tar.bz2 not present'
50        fi
[21386]51
[22456]52        if [ -f shoreline_300.tar.bz2 ]; then
[23827]53                $TAR xvf shoreline_300.tar.bz2
[22456]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
[23827]60                $UNZIP 10m-populated-places.zip -d world_boundaries
[22456]61        else
62                echo '10m-populated-places.zip not present'
63        fi
64
65        if [ -f 110m-admin-0-boundary-lines.zip ]; then
[23827]66                $UNZIP 110m-admin-0-boundary-lines.zip -d world_boundaries
[22456]67        else
68                echo '110m-admin-0-boundary-lines.zip not present'
69        fi
70
[21386]71fi
Note: See TracBrowser for help on using the repository browser.