From ae8672de34330f5f1e4fbd4c339459a56160968a Mon Sep 17 00:00:00 2001 From: lazarog98 <lazarog98@mi.fu-berlin.de> Date: Tue, 4 Apr 2023 13:08:44 +0000 Subject: [PATCH] Resolve "Add documentation to readme" --- README.md | 58 ++++++++++++------- .../java/map/builder/osm/OSMJsonUtils.java | 1 - 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index fab2160..3c251eb 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,43 @@ # Map data parser -## Basic architecture concept - - - -Legend: -* oval - data source - * blue oval - data generated by us -* rectangle - a service -* green outline - microservice - -## Development - -##### To generate classes from proto definition, one has to execute from the root directory +## General description + +This application is intended to be ran as a Kron-job in Docker. It should run once every 24 hours and creates a road network, +which is based on OSM. OSM provides three types of element: nodes, ways and relations. Each element has a lot of meta data, +as well as tags that describe different features. The map data parser filters most of this data away. + +Ways that represent streets are turned into segments and ways that represent buildings or other +objects are not used. Only the start and end nodes of segments are container within the road network and overlapping segments +are being split. The road type is defined by the `highway` tag. + +Relations in OSM represent turn restrictions. The map builder considers only some of those, due to the complexity of certain +turn restrictions and the original scope of the project. + +## Installation instructions + +First, add an access key to the repo in the `settings.xml` of your Maven installation. + +```xml +<servers> + <server> + <id>protos</id> + <configuration> + <httpHeaders> + <property> + <name>Private-Token</name> + <value>glpat-LUzA2H9fVytwNmmC-6MH</value> + </property> + </httpHeaders> + </configuration> + </server> +</servers> +``` -First install the protobuf compiler with : +Run `mvn clean install -U` to get all the dependencies and then run the application as you would in your IDE. -```sh -sudo apt install protobuf-compiler -``` +The application writes a `roadnetwork.proto` file when it's done. This can then be used with the routing server or the debug +tool. Check the respective documentations for further information. -If you want to build the protos from source schema, you should use the command : +### Alternatively -```sh -protoc -I=./mapbuilder/src/main/java/map/builder/protos/ --java_out=./mapbuilder/src/main/java/ ./mapbuilder/src/main/java/map/builder/protos/schema/roadnetwork.proto -``` \ No newline at end of file +You can also use the Docker image and set it up the container in Docker. \ No newline at end of file diff --git a/mapbuilder/src/main/java/map/builder/osm/OSMJsonUtils.java b/mapbuilder/src/main/java/map/builder/osm/OSMJsonUtils.java index 56a94a9..0aa56b6 100644 --- a/mapbuilder/src/main/java/map/builder/osm/OSMJsonUtils.java +++ b/mapbuilder/src/main/java/map/builder/osm/OSMJsonUtils.java @@ -1,7 +1,6 @@ package map.builder.osm; import map.builder.osm.json.model.*; -import org.json.JSONObject; import java.util.List; import java.util.Objects; -- GitLab