README.md 3.43 KB
Newer Older
1
2
3
4
5
# 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)
Johannes Visintini's avatar
Johannes Visintini committed
6
[![LICENSE](https://img.shields.io/badge/license-GPL--v3-orange)](COPYING)
7

Martin Raifer's avatar
Martin Raifer committed
8
9


Johannes Visintini's avatar
Johannes Visintini committed
10
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).
Martin Raifer's avatar
Martin Raifer committed
11

Johannes Visintini's avatar
Johannes Visintini committed
12
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).
Martin Raifer's avatar
Martin Raifer committed
13

Johannes Visintini's avatar
Johannes Visintini committed
14
15
16
## Usage

Build the jar using `mvn package`. The jar can be used as follows:
17
```bash
Johannes Visintini's avatar
Johannes Visintini committed
18
19
20
# bounding box
export BBOX=8.67,49.39,8.71,49.42

21
# change the following variables to your settings
Johannes Visintini's avatar
Johannes Visintini committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
Martin Raifer's avatar
Martin Raifer committed
44
45
```

Johannes Visintini's avatar
Johannes Visintini committed
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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
```