This repository has been archived by the owner on May 7, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter administrative boundaries in parallel.
- Loading branch information
Showing
5 changed files
with
59 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
if ${IMPORT_ADMINISTRATIVE}; then | ||
FAIL=0 | ||
osmosis -v \ | ||
--read-pbf-fast workers=${IMPORT_THREADS} /srv/nominatim/src/data.osm.pbf \ | ||
--tf accept-nodes "boundary=administrative" \ | ||
--tf reject-relations \ | ||
--tf reject-ways \ | ||
--write-pbf file=/srv/nominatim/src/nodes.osm.pbf & | ||
osmosis -v \ | ||
--read-pbf-fast workers=${IMPORT_THREADS} /srv/nominatim/src/data.osm.pbf \ | ||
--tf accept-ways "boundary=administrative" \ | ||
--tf reject-relations \ | ||
--used-node \ | ||
--write-pbf file=/srv/nominatim/src/ways.osm.pbf & | ||
osmosis -v \ | ||
--read-pbf-fast workers=${IMPORT_THREADS} /srv/nominatim/src/data.osm.pbf \ | ||
--tf accept-relations "boundary=administrative" \ | ||
--used-node \ | ||
--used-way \ | ||
--write-pbf file=/srv/nominatim/src/relations.osm.pbf & | ||
|
||
echo "Filtering administrative boundaries started." | ||
|
||
for job in `jobs -p` do | ||
echo ${job} | ||
wait ${job} || let "FAIL+=1" | ||
done | ||
|
||
echo "${FAIL} jobs failed." | ||
|
||
if [ "$FAIL" == "0" ]; then | ||
echo "Filtering nodes, ways and relations completed." | ||
echo "Starting merge process." | ||
exec osmosis -v \ | ||
--rb /srv/nominatim/src/nodes.osm.pbf outPipe.0=N \ | ||
--rb /srv/nominatim/src/ways.osm.pbf outPipe.0=W \ | ||
--rb /srv/nominatim/src/relations.osm.pbf outPipe.0=R \ | ||
--merge inPipe.0=N inPipe.1=W outPipe.0=NW \ | ||
--merge inPipe.0=NW inPipe.1=R outPipe.0=NWR \ | ||
--wb inPipe.0=NWR file=/srv/nominatim/src/data.osm.pbf | ||
else | ||
exit 1; | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
|
||
service postgresql start | ||
/usr/sbin/apache2ctl -D FOREGROUND |