blob: 766b524bdb2c7c9b3b5c65c6760d0431b4dc12aa (
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
40
41
42
|
#!/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 $styleType/$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
# In designer mode we use drules_proto_design file instead of standard ones
cp $OMIM_PATH/data/drules_proto_clear.bin $OMIM_PATH/data/drules_proto_design.bin
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
|