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

Last change on this file since 34655 was 28989, checked in by tomhughes, 7 years ago

Update download locations for Natural Earth data

Patch from https://github.com/openstreetmap/mapnik-stylesheets/pull/6

  • Property svn:executable set to *
File size: 2.5 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
42if [ ! -e $OUTDIR ]; then
43    mkdir $OUTDIR
44fi
45
46$WGET http://tile.openstreetmap.org/world_boundaries-spherical.tgz -O $OUTDIR/world_boundaries-spherical.tgz
47$WGET http://tile.openstreetmap.org/processed_p.tar.bz2 -O $OUTDIR/processed_p.tar.bz2
48$WGET http://tile.openstreetmap.org/shoreline_300.tar.bz2 -O $OUTDIR/shoreline_300.tar.bz2
49$WGET http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip -O $OUTDIR/ne_10m_populated_places.zip
50$WGET http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip -O $OUTDIR/ne_110m_admin_0_boundary_lines_land.zip
51
52$TAR xvf $OUTDIR/world_boundaries-spherical.tgz -C $OUTDIR
53
54if [ -d $OUTDIR/world_boundaries ]; then
55
56        if [ -f $OUTDIR/processed_p.tar.bz2 ]; then
57                $TAR xvf $OUTDIR/processed_p.tar.bz2 -C $OUTDIR
58                mv $OUTDIR/processed_p.[dis]* $OUTDIR/world_boundaries/
59        else
60                echo 'processed_p.tar.bz2 not present'
61        fi
62
63        if [ -f $OUTDIR/shoreline_300.tar.bz2 ]; then
64                $TAR xvf $OUTDIR/shoreline_300.tar.bz2 -C $OUTDIR
65                mv $OUTDIR/shoreline_300.[dis]* $OUTDIR/world_boundaries/
66        else
67                echo 'shoreline_300.tar.bz2 not present'
68        fi
69
70        if [ -f $OUTDIR/ne_10m_populated_places.zip ]; then
71                $UNZIP -o $OUTDIR/ne_10m_populated_places.zip -d $OUTDIR/world_boundaries
72        else
73                echo 'ne_10m_populated_places.zip not present'
74        fi
75
76        if [ -f $OUTDIR/ne_110m_admin_0_boundary_lines_land.zip ]; then
77                $UNZIP -o $OUTDIR/ne_110m_admin_0_boundary_lines_land.zip -d $OUTDIR/world_boundaries
78        else
79                echo 'ne_110m_admin_0_boundary_lines_land.zip not present'
80        fi
81
82fi
Note: See TracBrowser for help on using the repository browser.