Update README.

This commit is contained in:
2018-03-14 11:11:54 +01:00
parent 019ec58e2f
commit c6247a9ae2
3 changed files with 90 additions and 83 deletions

View File

@@ -20,6 +20,7 @@ region_dir=$(dirname $(realpath ${inpbf}))
region_name=$(basename ${inpbf} .pbf)
region_name=$(basename ${region_name} .osm)
poly_file=${region_dir}/${region_name}.poly
bbox_file=${region_dir}/${region_name}.bbox
if [ ! -e "${inpbf}" ]; then
echo "${inpbf} does not exist, you may want to download it from https://download.geofabrik.de/index.html."
@@ -46,7 +47,7 @@ olddir=$(pwd)
cd ${INPUTS}/mapsforge-creator
BBOX=$(perl poly2bb.pl "${poly_file}")
echo "$BBOX" > ${INPUTS}/bbox/${region_name}.bbox
echo "$BBOX" > ${bbox_file}
BBOX=(${BBOX//,/ })
BOTTOM=${BBOX[0]}
@@ -86,50 +87,3 @@ done
CMD="$CMD --wb file=${region_dir}/${region_name}_merge.pbf omitmetadata=true"
echo $CMD
$CMD
exit 0
# Map
if [ "$SKIP_MAP_CREATION" != "true" ]; then
CMD="$OSMOSIS_HOME/bin/osmosis --rb file=$WORK_PATH/merge.pbf"
[ $MAP_TRANSFORM_FILE ] && CMD="$CMD --tt file=$MAP_TRANSFORM_FILE"
CMD="$CMD --mw file=$WORK_PATH/$NAME.map \
type=$2 \
bbox=$BOTTOM,$LEFT,$TOP,$RIGHT \
map-start-position=$LAT,$LON \
map-start-zoom=8 \
tag-values=$TAG_VALUES \
threads=$THREADS"
[ $3 ] && CMD="$CMD preferred-languages=$3"
[ $MAP_TAG_CONF_FILE ] && CMD="$CMD tag-conf-file=$MAP_TAG_CONF_FILE"
echo $CMD
$CMD || exit 1
# Check map size
if [ -f "$MAPS_PATH/$NAME.map" ]; then
OLD_SIZE=$(wc -c < "$MAPS_PATH/$NAME.map")
NEW_SIZE=$(wc -c < "$WORK_PATH/$NAME.map")
if [ $NEW_SIZE -lt $(($OLD_SIZE * 70 / 100)) ]; then
echo "$WORK_PATH/$NAME.map creation is significantly smaller."
exit 1
fi
fi
mv "$WORK_PATH/$NAME.map" "$MAPS_PATH/$NAME.map"
fi
# POI
if [ "$SKIP_POI_CREATION" != "true" ]; then
CMD="$OSMOSIS_HOME/bin/osmosis --rb file=$WORK_PATH/$NAME-latest.osm.pbf \
--pw file=$WORK_PATH/$NAME.poi"
[ $POI_TAG_CONF_FILE ] && CMD="$CMD tag-conf-file=$POI_TAG_CONF_FILE"
echo $CMD
$CMD || exit 1
mv "$WORK_PATH/$NAME.poi" "$POIS_PATH/$NAME.poi"
fi
# Post-process
rm -rf "$WORK_PATH"