16.4.6. OpenStreetMap Data¶
OpenStreetMap is a free, editable map of the whole world that is being built by volunteers largely from scratch and released with an open-content license.
22.214.171.124. Getting OSM data¶
Various slices of data are available to download here in either XML or the binary PBF format.
126.96.36.199. Nodes vs Ways¶
OSM files include two data types - nodes and ways. Nodes are point features; ways are line strings composed of several nodes. In order to ingest ways, the relevant nodes must be stored temporarily. By default, the OSM converter will use a file-based H2 database for storing nodes. This may not be sufficient for large files, however. See Ingest Configuration below for details.
188.8.131.52. Installing OSM Converter¶
The OSM converter does not ship with the GeoMesa tools by default, due to some dependency conflicts. To install it currently requires the source distribution and Maven. Download or clone the project from Github. Ensure that the version matches your GeoMesa tools version, either by checking out the correct Git branch, or by downloading the appropriate tag. Run the following commands:
mvn clean install -DskipTests mvn dependency:copy-dependencies -pl geomesa-convert/geomesa-convert-osm/ \ -DincludeScope=compile -DoutputDirectory=$GEOMESA_HOME/lib cp geomesa-convert/geomesa-convert-osm/target/geomesa-convert-osm_2.11-$version.jar \ $GEOMESA_HOME/lib
Check that the
osm-ways simple feature types are available on the GeoMesa
geomesa env | grep osm-nodes geomesa env | grep osm-ways
184.108.40.206. Ingest Configuration¶
The OSM converters and simple feature types are defined in
$GEOMESA_HOME/conf/sfts/osm/reference.conf. To ingest
XML files instead of PBF, you will need to change the
format field to
xml. For ingesting OSM ways,
you may also specify a JDBC connection string for storing nodes. Note that you will need the appropriate JDBC
driver JAR in
220.127.116.11. Ingest Commands¶
Run the ingest. You may optionally point to a different accumulo
-z options. See
geomesa help ingest
for more detail.
geomesa ingest -u USERNAME -c CATALOGNAME -s osm-nodes -C osm-nodes test.osm