-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·42 lines (31 loc) · 1.63 KB
/
build.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
#!/bin/bash
# build image
docker build -t 'missinglink/wof-spatialite' .
# clean up
INDIR=${INDIR:-'/data/whosonfirst-data/data'}
OUTDIR=${OUTDIR:-'/data/wof-spatialite'}
mkdir -p "${OUTDIR}"
rm -rf "${OUTDIR}/wof.sqlite"
# tessellation options
LEVEL=50
COMPLEXITY=100
# default coords
LON=${LON:-'50'}
LAT=${LAT:-'1'}
echo '-- init database --'
docker run --rm -it -e 'DB=/out/wof.sqlite' -v "${OUTDIR}:/out" 'missinglink/wof-spatialite' init
echo '-- import wof --'
docker run --rm -it -e 'DB=/out/wof.sqlite' -v "${INDIR}:/in" -v "${OUTDIR}:/out" 'missinglink/wof-spatialite' index_all '/in'
echo '-- repair geometries --'
docker run --rm -it -e 'DB=/out/wof.sqlite' -v "${OUTDIR}:/out" 'missinglink/wof-spatialite' fixify
# echo '-- simplify geometries --'
# docker run --rm -it -e 'DB=/out/wof.sqlite' -v "${OUTDIR}:/out" 'missinglink/wof-spatialite' simplify '0.1'
echo '-- create tiles --'
docker run --rm -it -e 'DB=/out/wof.sqlite' -v "${OUTDIR}:/out" 'missinglink/wof-spatialite' tile_init
docker run --rm -it -e 'DB=/out/wof.sqlite' -v "${OUTDIR}:/out" 'missinglink/wof-spatialite' tile_all "${LEVEL}" "${COMPLEXITY}"
echo '-- run point-in-polygon tests --'
docker run --rm -it -e 'DB=/out/wof.sqlite' -v "${OUTDIR}:/out" 'missinglink/wof-spatialite' pip "${LON}" "${LAT}"
docker run --rm -it -e 'DB=/out/wof.sqlite' -v "${OUTDIR}:/out" 'missinglink/wof-spatialite' pipfast "${LON}" "${LAT}"
docker run --rm -it -e 'DB=/out/wof.sqlite' -v "${OUTDIR}:/out" 'missinglink/wof-spatialite' piptile "${LON}" "${LAT}"
echo '-- run server --'
docker run --rm -it -e 'DB=/out/wof.sqlite' -v "${OUTDIR}:/out" -p '8080:8080' 'missinglink/wof-spatialite' server