# OSHDB Extract Generator [![build status](https://jenkins.ohsome.org/buildStatus/icon?job=oshdb-extract-generator/master)](https://jenkins.ohsome.org/blue/organizations/jenkins/oshdb-extract-generator/activity/?branch=master) [![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=org.heigit.ohsome.clustertools:oshdb-extractor&metric=alert_status)](https://sonarcloud.io/dashboard?id=org.heigit.ohsome.clustertools:oshdb-extractor) [![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) 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). 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 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: ```bash % java -jar target/oshdb-extractor-0.1-SNAPSHOT-jar-with-dependencies.jar --help :( Usage:
[options] Options: --help, -h * -i, --ignite, --ignite-config Path ot ignite-config.xml * -k, --input-keytables input keytables connection, pipe separated: "|||" * -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 ```