forked from mkoloberdin/waze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrdmgendcwmaps
76 lines (64 loc) · 1.24 KB
/
rdmgendcwmaps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh
#
# rdmgenshpmaps
#
# Utility to scan a directory for the Digital Charts of the World
# shapefiles and process them through buildmap
#
# Usage:
#
# rdmgenshpmaps [maps=<map-directory-path>] [test] [dryrun] <files>...
#
maps=/usr/local/share/roadmap
prov='*'
if [ $# -eq 0 ] ; then
echo 'Usage: rdmgendcwmaps [maps=<map-directory-path>] [test] [dryrun] [<files> ...]'
exit 1
fi
verbose=''
gendir=Y
case $1 in
maps=*) maps=`expr $1 : 'maps=\(.*\)'`
shift
;;
esac
case $1 in
test) verbose=-v
gendir=N
shift
;;
esac
DRYRUN=N
case $1 in
dryrun) DRYRUN=Y
shift
;;
esac
if [ -e ./buildmap ] ; then
BUILDMAP=./buildmap
else
BUILDMAP=buildmap
fi
for i in $*
do
base=`basename $i`
FIPS=`expr substr $base 1 5`
echo $BUILDMAP -f DCW -m $maps $verbose $FIPS $i
if [ $DRYRUN != 'Y' ] ; then
$BUILDMAP -f DCW -m $maps $verbose $FIPS $i
fi
done
if [ $gendir = 'Y' ] ; then
echo "Generating usdir.rdm, please wait.."
if [ -e buildus ] ; then
echo ./buildus -s --maps=$maps
if [ $DRYRUN != 'Y' ] ; then
./buildus -s --maps=$maps
fi
else
echo buildus -s --maps=$maps
if [ $DRYRUN != 'Y' ] ; then
buildus -s --maps=$maps
fi
fi
fi