source: subversion/utils/pdf-atlas/create.sh @ 2058

Last change on this file since 2058 was 2014, checked in by joerg, 13 years ago

update download for shoreline

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1#!/bin/bash
2
3
4# ---------------------- GSHHS
5gshhs=gshhs_h
6echo "check $gshhs.b"
7mkdir -p ~/osm/GSHHS/
8#wget -nd -P ~/osm/GSHHS/ -nv  --mirror http://www.ngdc.noaa.gov/mgg/shorelines/data/gshhs/version1.2/$gshhs.b.gz
9wget -nd -P ~/osm/GSHHS/ -nv  --mirror http://www.ngdc.noaa.gov/mgg/shorelines/data/gshhs/oldversions/$gshhs.b.gz
10
11if [ ~/osm/GHHS/$gshhs.b.gz" -nt ~/osm/GHHS/$gshhs.b" ] ; then
12    echo "Unpack ~/osm/GSHHS/$gshhs.b.gz"
13    gunzip -dc ~/osm/GSHHS/$gshhs.b.gz >~/osm/GSHHS/$gshhs.b
14fi
15
16
17for place_config in \
18    Config/places-germany.txt \
19    Config/places-bavaria*.txt \
20    Config/places-germany*.txt \
21    Config/places-UK.txt \
22    Config/places-france.txt \
23    Config/places-france.txt \
24    Config/places-*.txt; do
25
26    csv_area=${place_config#*places-}
27    csv_area=${csv_area%.txt}
28
29    case $csv_area in
30        *germany*)
31            csv_area="germany"
32            ;;
33        *bavari*)
34            csv_area="germany"
35            ;;
36        *munich*)
37            csv_area="germany"
38            ;;
39        *UK*)
40            csv_area="uk"
41            ;;
42        *iow*)
43            csv_area="uk"
44            ;;
45        *france*)
46            csv_area="france"
47            ;;
48        *)
49            ;;
50    esac
51    osm_csv=$HOME/osm/planet/csv/osm-${csv_area}.csv
52
53
54    echo ""
55    echo "------------------------------------------------------------------"
56    echo "place: '$place_config' with area: '$csv_area'"
57    echo ""
58
59    if  echo $csv_area | grep \
60        -e world  \
61        -e europe \
62        ;then 
63        echo "Ignoring $place_config with $vsc_area"
64        continue
65    fi
66
67    if [ `perl ../osm2csv/osm2csv.pl    --list-areas | grep $csv_area ` ]; then
68        echo "--> Update csv File for Area '$csv_area'"
69        osm2csv_cmd="perl ../osm2csv/osm2csv.pl --area=${csv_area} --update-only -v -v -v -v"
70        echo "$osm2csv_cmd"
71        $osm2csv_cmd
72    fi
73    if [ ! -s $osm_csv ] ; then
74        echo "We have not fitting csv File"
75        continue
76        osm_csv=~/osm/planet/csv/osm.csv
77    fi
78   
79    places_name=${place_config/*\places-/}
80    places_name=${places_name%.txt}
81    pdf_name=~/osm/pdf-atlas/osm_atlas-${places_name}.pdf
82    #echo "CSV File: $pdf_name $osm_csv"
83    echo "------------------------------------------------------------------"
84    echo "Updating: " $places_name $pdf_name
85    create_atlas_cmd="./pdf-atlas.pl -v -v -d --config=Config/config.txt  --Data=$osm_csv --Places=$place_config"
86    echo "perl $create_atlas_cmd"
87    echo "     ..."
88    time perl $create_atlas_cmd
89done
Note: See TracBrowser for help on using the repository browser.