From c0245df07b79bc191b8c439898316b21c9aee0d5 Mon Sep 17 00:00:00 2001 From: Manuel Fuhr Date: Wed, 17 May 2023 20:04:56 +0200 Subject: [PATCH] Adapt scripts & documentation --- docs/developers/build_segments.md | 37 ------------------- misc/pbfparser/.gitignore | 3 -- misc/pbfparser/README.txt | 23 ------------ misc/pbfparser/compile_parser.bat | 1 - .../scripts/mapcreation/process_pbf_planet.sh | 7 +--- .../process_pbf_planet_production.sh | 2 +- 6 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 misc/pbfparser/.gitignore delete mode 100644 misc/pbfparser/README.txt delete mode 100644 misc/pbfparser/compile_parser.bat diff --git a/docs/developers/build_segments.md b/docs/developers/build_segments.md index 604d8eb..513fab5 100644 --- a/docs/developers/build_segments.md +++ b/docs/developers/build_segments.md @@ -13,43 +13,6 @@ also build them yourself from an OSM dump (e.g. planet or [GeoFabrik extract](https://download.geofabrik.de/)) -## Build the pbfparser - -First, there are two file formats available to download OSM data: `bzip`-ed -XML files (very large) and `.pbf` -([Protobuf](https://github.com/protocolbuffers/protobuf) format) which is much -more efficient. If you want to use the latter one, you will have to build the -`pbfparser` (located in `misc/pbfparser` first): - -* Download [the latest - version](https://github.com/openstreetmap/osmosis/releases) - of [Osmosis](https://wiki.openstreetmap.org/wiki/Osmosis) and unzip it - somewhere. -* Copy the `lib/default/protobuf-java-*.jar` and - `lib/default/osmosis-osm-binary-*.jar` files from the unzipped Osmosis - archive to `misc/pbfparser/protobuf.jar` and `misc/pbfparser/osmosis.jar`. -* Build BRouter and copy - `brouter-server/build/libs/brouter-*-all.jar` to - `misc/pbfparser/brouter.jar`. -* You can build the `pbfparser` using, in the `misc/pbfparser/` - folder, - -``` -javac -d . -cp "brouter.jar:protobuf.jar:osmosis.jar" *.java -``` - -* Finally, you can build a `jar` file from these files using - -``` -jar cf pbfparser.jar btools/**/*.class -``` - -_Note:_ If the `jar` file is not properly created, everything else will seem -to work normally but there will not be any data extracted from the OSM data -dump. You can check what is actually inside the built `jar` file using -`jar tf pbfparser.jar`. - - ## Run the map creation script If you want to have elevation information in the generated segments files, you diff --git a/misc/pbfparser/.gitignore b/misc/pbfparser/.gitignore deleted file mode 100644 index 4dd82da..0000000 --- a/misc/pbfparser/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.jar -*.BAK -btools/ diff --git a/misc/pbfparser/README.txt b/misc/pbfparser/README.txt deleted file mode 100644 index b43e019..0000000 --- a/misc/pbfparser/README.txt +++ /dev/null @@ -1,23 +0,0 @@ -The pbf-parse is not included in the regular source tree -to avoid the library dependencies to "osmosis" and "protobuf" - -In order to run the mapcreator from a pbf-file (as it is -done in the process_pbf_planet.sh script included in -the git-repo), you have to build yourself the "pbfparser.jar" -by doing the following: - --> get osmosis from https://bretth.dev.openstreetmap.org/osmosis-build/osmosis-latest.zip --> copy lib/default/osmosis-osm-binary-*.jar in the archive to osmosis.jar in -this folder --> copy lib/default/protobuf-java-*.jar in the archive to protobuf.jar in this -folder --> copy the brouter-server/build/libs/brouter-...-all.jar to -brouter.jar in this folder --> compile the PBF-Parser using: - javac -d . -cp protobuf.jar:osmosis.jar:brouter.jar *.java --> pack all the compiled class files together in a jar -"pbfparser.jar" with "jar cf pbfparser.jar btools/**/*.class" - -Alternatively, just for testing you can run the Mapcreator against a *xml.bz2 Database-Extract, -then you don't need the pbf-parser. However, the XML-Parser does not (yet) parse -Turn-Restrictions, so really just for testing... diff --git a/misc/pbfparser/compile_parser.bat b/misc/pbfparser/compile_parser.bat deleted file mode 100644 index 7a5452b..0000000 --- a/misc/pbfparser/compile_parser.bat +++ /dev/null @@ -1 +0,0 @@ -javac -d . -cp pbfparser.jar;brouter.jar BPbfFieldDecoder.java BPbfBlobDecoder.java OsmParser.java diff --git a/misc/scripts/mapcreation/process_pbf_planet.sh b/misc/scripts/mapcreation/process_pbf_planet.sh index 2ad173d..d3b190e 100755 --- a/misc/scripts/mapcreation/process_pbf_planet.sh +++ b/misc/scripts/mapcreation/process_pbf_planet.sh @@ -24,14 +24,11 @@ touch lastmaprun.date rm -rf /var/www/brouter/segments4_lastrun -JAVA='/java/bin/java -Xmx2600m -Xms2600m -Xmn32m' +JAVA='java -Xmx2600m -Xms2600m -Xmn32m' BROUTER_PROFILES=$(realpath "../../profiles2") BROUTER_JAR=$(realpath $(ls ../../../brouter-server/build/libs/brouter-*-all.jar)) -OSMOSIS_JAR=$(realpath "../../pbfparser/osmosis.jar") -PROTOBUF_JAR=$(realpath "../../pbfparser/protobuf.jar") -PBFPARSER_JAR=$(realpath "../../pbfparser/pbfparser.jar") PLANET_FILE=${PLANET_FILE:-$(realpath "./planet-latest.osm.pbf")} # Download SRTM zip files from @@ -43,7 +40,7 @@ SRTM_PATH="/private-backup/srtm" mkdir tmp cd tmp mkdir nodetiles -${JAVA} -cp "${OSMOSIS_JAR}:${PROTOBUF_JAR}:${PBFPARSER_JAR}:${BROUTER_JAR}" btools.mapcreator.OsmCutter ${BROUTER_PROFILES}/lookups.dat nodetiles ways.dat relations.dat restrictions.dat ${BROUTER_PROFILES}/all.brf ${PLANET_FILE} +${JAVA} -cp ${BROUTER_JAR} -DavoidMapPolling=true btools.mapcreator.OsmCutter ${BROUTER_PROFILES}/lookups.dat nodetiles ways.dat relations.dat restrictions.dat ${BROUTER_PROFILES}/all.brf ${PLANET_FILE} mkdir ftiles ${JAVA} -cp ${BROUTER_JAR} -Ddeletetmpfiles=true -DuseDenseMaps=true btools.mapcreator.NodeFilter nodetiles ways.dat ftiles diff --git a/misc/scripts/mapcreation/process_pbf_planet_production.sh b/misc/scripts/mapcreation/process_pbf_planet_production.sh index 4da46f6..f9a6deb 100644 --- a/misc/scripts/mapcreation/process_pbf_planet_production.sh +++ b/misc/scripts/mapcreation/process_pbf_planet_production.sh @@ -15,7 +15,7 @@ mkdir waytiles mkdir waytiles55 mkdir nodes55 -../../jdk8/bin/java -Xmx6144M -Xms6144M -Xmn256M -cp ../pbfparser.jar:../brouter_fc.jar -Ddeletetmpfiles=true -DuseDenseMaps=true btools.util.StackSampler btools.mapcreator.OsmFastCutter ../lookups.dat nodetiles waytiles nodes55 waytiles55 bordernids.dat relations.dat restrictions.dat ../all.brf ../trekking.brf ../softaccess.brf ../planet-new.osm.pbf +../../jdk8/bin/java -Xmx6144M -Xms6144M -Xmn256M -cp ../brouter_fc.jar -Ddeletetmpfiles=true -DuseDenseMaps=true btools.util.StackSampler btools.mapcreator.OsmFastCutter ../lookups.dat nodetiles waytiles nodes55 waytiles55 bordernids.dat relations.dat restrictions.dat ../all.brf ../trekking.brf ../softaccess.brf ../planet-new.osm.pbf mv ../planet-latest.osm.pbf ../planet-old.osm.pbf mv ../planet-new.osm.pbf ../planet-latest.osm.pbf