blob: a1848233dc9c55a128ac59be6955c9a183c27edf (
plain)
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
|
#!/bin/bash
set -e -u
# Prevent python from generating compiled *.pyc files
export PYTHONDONTWRITEBYTECODE=1
OMIM_PATH="${OMIM_PATH:-$(dirname "$0")/../..}"
DATA_PATH="${DATA_PATH:-$OMIM_PATH/data}"
function BuildDrawingRules() {
styleType=$1
styleName=$2
suffix=${3-}
echo "Building drawing rules for style $styleName"
# Cleanup
rm "$DATA_PATH"/drules_proto$suffix.{bin,txt} || true
# Run script to build style
python "$OMIM_PATH/tools/kothic/src/libkomwm.py" --txt \
-s "$DATA_PATH/styles/$styleType/style-$styleName/style.mapcss" \
-o "$DATA_PATH/drules_proto$suffix"
}
# Cleanup
cleanup=(classificator.txt types.txt visibility.txt colors.txt patterns.txt)
for item in ${cleanup[*]}
do
rm $DATA_PATH/$item || true
done
# Building drawing rules
BuildDrawingRules clear clear _clear
BuildDrawingRules clear night _dark
BuildDrawingRules vehicle clear _vehicle_clear
BuildDrawingRules vehicle night _vehicle_dark
echo "Merging default and vehicle styles"
python "$OMIM_PATH/tools/python/stylesheet/drules_merge.py" \
"$DATA_PATH/drules_proto_clear.bin" "$DATA_PATH/drules_proto_vehicle_clear.bin" \
"$DATA_PATH/drules_proto.bin" "$DATA_PATH/drules_proto.txt" > /dev/null
|