1#!/bin/sh
2#
3#
4# Script to retrieve BOM data files.
5#
6# Originally written 2006/03/07 by Steven, WM5Z, and Curt, WE7U.
7# Modified from original get-NWSdata script by Geoff VK2XJG.
8#
9# Copyright (C) 2000-2019 The Xastir Group
10#
11# This program is free software; you can redistribute it and/or
12# modify it under the terms of the GNU General Public License
13# as published by the Free Software Foundation; either version 2
14# of the License, or (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24# 02110-1301, USA.
25#
26# See README.MAPS for a bit more information on the program.
27#
28#
29# NOTE:  Run this script as root.
30#
31# MAINTAINERS:  Go here to find out what the latest versions are:
32# <ftp://ftp.bom.gov.au/anon/home/adfd/spatial/>
33
34
35FILE1="gfe_public_weather"           # BOM Spatial: Public Warning Zone Boundaries
36FILE2="gfe_metro_areas"              # BOM Spatial: Metropolitan Warning Area Boundaries
37FILE3="gfe_coastal_water"           # BOM Spatial: Coastal Forecast Marine Zones
38FILE4="gfe_coastal_water_warning"  # BOM Spatial: Coastal Warning Zones
39FILE5="gfe_local_effects"            # BOM Spatial: Local Effects Areas
40FILE6="gfe_fire_weather"             # BOM Spatial: Fire Weather Zone Boundaries
41FILE7="LGA08aAust"                   # Local Government Area Boundaries
42
43prefix=@prefix@
44
45cd ${prefix}/share/xastir/Counties
46
47
48# Remove any old zip files hanging around in this directory
49#
50rm -f *.zip 2>&1 >/dev/null
51
52
53# Fetch new copies, unzip into place, delete archive.
54#
55#
56DIR=wsom
57for d in $FILE1 $FILE2 $FILE3 $FILE4 $FILE5 $FILE6; do
58if [ -e $d.shp ]
59  then
60    echo "Already have $d shapefile, skipping..."
61  else
62    # Remove possible older copies
63    cut=`echo $d|cut -c1-30 -`
64    rm -f $cut*.shx $cut*.shp $cut*.dbf $cut*.prj $cut*.zip 2>&1 >/dev/null
65    wget ftp://ftp.bom.gov.au/anon/home/adfd/spatial/$d.zip
66    unzip $d.zip
67    rm -f *.zip
68
69    mv $d*.shx $d.shx 2>&1 >/dev/null
70    mv $d*.shp $d.shp 2>&1 >/dev/null
71    mv $d*.dbf $d.dbf 2>&1 >/dev/null
72    mv $d*.prj $d.prj 2>&1 >/dev/null
73    mv $d*.sbx $d.sbx 2>&1 >/dev/null
74    mv $d*.sbn $d.sbn 2>&1 >/dev/null
75
76fi
77done
78
79DIR=county
80for d in $FILE7; do
81if [ -e $d.shp ]
82  then
83    echo "Already have $d shapefile, skipping..."
84  else
85    # Remove possible older copies
86    cut=`echo $d|cut -c1-2 -`
87    rm -f $cut*.shx $cut*.shp $cut*.dbf $cut*.prj $cut*.zip 2>&1 >/dev/null
88    wget http://wxsvr.aprs.net.au/shapefiles/$d\_shape.zip
89    unzip $d\_shape.zip
90    rm -f *.zip
91fi
92done
93
94
95