-
Notifications
You must be signed in to change notification settings - Fork 3
/
process.sh
66 lines (43 loc) · 2.03 KB
/
process.sh
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
#!/bin/sh
FILENAME="Wegenregister_SHAPE_20241219"
MAPROULETTE_CHALLENGE=24090
# Make script directory working directory
cd `dirname "$(realpath $0)"`
# Download & unzip data
mkdir -p "./source/"
if [ ! -d "./source/$FILENAME" ]; then
wget -O "./source/$FILENAME.zip" "https://download.vlaanderen.be/bff/v1/Orders/306141/download/65f6195e-d0d7-427e-84f3-c7d7669fad5b"
unzip -j "./source/$FILENAME.zip" -d "./source/$FILENAME/" "$FILENAME/Shapefile/Wegsegment.*"
fi
# Convert to GeoJSON
if [ -d "./temp" ]; then rm -r "./temp/"; fi
mkdir -p "./temp/"
ogr2ogr -f "GeoJSON" -progress \
--config SHAPE_ENCODING "ISO-8859-1" \
-s_srs "EPSG:31370" -t_srs "EPSG:4326" \
-sql "@filter.sql" \
-lco COORDINATE_PRECISION=6 \
-fieldTypeToString "All" \
"./temp/Wegsegment.geojson" \
"./source/$FILENAME/Wegsegment.shp"
# Convert fields to OpenStreetMap tags
node "../../../script/convert-tags.js" -c "./convert.json" "./temp/Wegsegment.geojson" "WegsegmentTagged.geojson"
# Generate vector tiles
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--buffer=0 \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="roads" \
--output="./temp/WegsegmentTagged.mbtiles" "./temp/WegsegmentTagged.geojson"
# Generate MapRoulette NotAnIssue buffers vector tiles
wget -O "./temp/maproulette.geojson" "https://maproulette.org/api/v2/challenge/view/$MAPROULETTE_CHALLENGE?status=2"
node "../../../script/buffer.js" --radius=20 "./temp/maproulette.geojson" "maproulette-buffers.geojson"
# Merge MapRoulette buffers to OpenStreetMap buffers
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="buffers" \
--output="./temp/belgium-buffers.mbtiles" \
"../belgium-lines-buffers.geojson" "../belgium-polygons-buffers.geojson" "./temp/maproulette-buffers.geojson"
# Difference
if [ -d "./difference" ]; then rm -r "./difference/"; fi
mkdir -p "./difference"
node "../../../script/difference.js" --output-dir="./difference" "./temp/WegsegmentTagged.mbtiles" "./temp/belgium-buffers.mbtiles"