Verified Commit 2729aaa1 authored by Johannes Visintini's avatar Johannes Visintini
Browse files

improve readme

parent 323769e4
Pipeline #2678 passed with stage
in 0 seconds
......@@ -5,26 +5,81 @@
[![status: experimental](https://github.com/GIScience/badges/raw/master/status/experimental.svg)](https://github.com/GIScience/badges#experimental)
[![LICENSE](https://img.shields.io/badge/license-GPL--v3-orange)](COPYING)
Creates an extract in form of a OSHDB H2-file from an Ignite OSHDB database source.
Entities can be filterd by bounding box or a semantic filter (tags, type).
## usage
The [OSHDB](https://github.com/GIScience/oshdb) extract generator creates an extract in form of a OSHDB H2-file from an Ignite OSHDB database source. More information about the OSHDB can be found [here](https://github.com/GIScience/oshdb/blob/master/README.md).
build using `mvn package`, execute as:
The extractor allows filtering entities by a bounding box and a [semantic filter](https://github.com/GIScience/oshdb/blob/master/oshdb-filter/README.md) (e.g. tags, type).
## Usage
Build the jar using `mvn package`. The jar can be used as follows:
```bash
# bounding box
export BBOX=8.67,49.39,8.71,49.42
# change the following variables to your settings
export REPNUM=12345
export DBSERVER=servername
export DBUSER=username
export DBPASSWORD=password
export DATABASE=keytables-global-$REPNUM
export INPUTPREFIX=global-$REPNUM
export IGNITECONF=/.../ohsome-ignite.xml
export OUTFILE=/.../output.oshdb
java -jar target/oshdb-extractor-0.1-SNAPSHOT-jar-with-dependencies.jar -i $IGNITECONF --input-prefix $INPUTPREFIX -k "org.postgresql.Driver|jdbc:postgresql://$DBSERVER:5432/$DATABASE|$DBUSER|$DBPASSWORD" -b minlon,minlat,maxlon,maxlat -o $OUTFILE --skip-large-relations
export REP_NUM=12345
# keytables database
export DB_SERVER=servername
export DB_USER=username
export DB_PASSWORD=password
export DB_NAME=keytables-global-$REP_NUM
# ignite config
export INPUT_PREFIX=global-$REP_NUM
export IGNITE_CONFIG=./ohsome-ignite.xml
# output filename prefix
export OUTFILE_PREFIX=./output.oshdb
java -jar target/oshdb-extractor-0.1-SNAPSHOT-jar-with-dependencies.jar \
--ignite $IGNITE_CONFIG \
--input-prefix $INPUT_PREFIX \
--input-keytables "org.postgresql.Driver|jdbc:postgresql://$DB_SERVER:5432/$DB_NAME|$DB_USER|$DB_PASSWORD" \
--bbox $BBOX \
--output $OUTFILE_PREFIX \
--skip-large-relations
```
You can get a full list of supported arguments by running `--help` on the jar file.
You can get a full list of supported arguments by running `--help` on the jar file:
```bash
% java -jar target/oshdb-extractor-0.1-SNAPSHOT-jar-with-dependencies.jar --help :(
Usage: <main class> [options]
Options:
--help, -h
* -i, --ignite, --ignite-config
Path ot ignite-config.xml
* -k, --input-keytables
input keytables connection, pipe separated: "<JDBC class>|<JDBC
connection string>|<DB username>|<DB password>"
* -b, --bbox
bounding box to cut out; list of 4 coordinate endpoints: min-lon,
min-lat, max-lon, max-lat
-f, --filter
filter to check against every osh entity. N.B. geometry-based
filters will not have an effect on the output.
* -o, --output
Path to output H2 file
--input-prefix
input cache prefix
--skip-bbox-check
skip check that tests whether the requested bounding box lies fully in
the input data set; use this option with care
Default: false
--skip-keytables
skip keytables
Default: false
-s, --skip-large-relations
skip non-intersecting relations; useful for small extracts where large
relations are not needed; recommended option
Default: false
--skip-metadata
skip metadata
Default: false
--skip-relations
skip relations
Default: false
```
......@@ -371,7 +371,7 @@ public class CreateH2Extract {
private static class CmdArgsConfig {
@Parameter(names = {"-i", "--ignite", "--ignite-config"},
description = "Path ot ignite-config.xml", required = true, order = 1)
description = "Path to ignite-config.xml", required = true, order = 1)
public File igniteConfig;
@Parameter(names = {"--input-prefix"}, description = "input cache prefix", required = false)
......@@ -389,7 +389,7 @@ public class CreateH2Extract {
public String bbox;
@Parameter(names = {"-f", "--filter"},
description = "filter to check against every osh entity. N.B. geometry-based filters"
description = "filter to check against every osh entity. N.B. geometry-based filters "
+ "will not have an effect on the output.", required = false, order = 4)
public String filter;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment