Skip to content

brthanmathwoag/osmosis-writesqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

osmosis-writesqlite

build status

This is an Osmosis plugin for storing OpenStreetMap data in an Sqlite database.

Make note that if you simply want to load an xml or pbf dump without any filtering/transformation it would probably be faster and less resource-heavy if you used spatialite_osm_raw or spatialite_osm_map from the spatialite-tools package instead.

Prerequisites

The plugin requires spatialite installed as a dynamically-loaded plugin which may be packaged separately from a statically-linked cli executable. Look for mod_spatialite.so file in your distro's package documentation. On Ubuntu you will need libsqlite3-mod-spatialite. On Arch it is libspatialite.

Installation

You can grab the latest version from here (SHA1: fadd6585bc02837af479014fcf084d31900afab4). Put it in ~/.openstreetmap/osmosis/plugins/ and you are ready to go.

To build it yourself, run:

git clone https://github.com/brthanmathwoag/osmosis-writesqlite.git
cd osmosis-writesqlite
mvn install

Usage

You can reference the plugin in your workflow with the write-sqlite alias.

osmosis --read-pbf germany-latest.osm.pbf \
    --write-sqlite output.db recreateSchema=true
Option Description Valid values Default value
recreateSchema Whether you want to truncate an existing database. yes, no, true, false false
batchSize Number of rows inserted in a single transaction. Set to -1 to commit after all rows are inserted. Set to 0 to not use transactions at all. -1, 0, 1, ... -1
journalMode SQLite journal mode OFF, DELETE, MEMORY, PERSIST, TRUNCATE DELETE
synchronousMode SQLite synchronous mode OFF, NORMAL, FULL FULL
cacheSize SQLite cache size (in pages). Set 0 to use SQLite default. 0, 1, ... 0

Schema

The schema closely resembles the Osmosis' pgsimple PostgreSQL schema. Timestamps are stored as unixtimestamps in int columns; Node geometries are stored as spatialite geometries with WGS84 srid.

Acknowledgements

This plugin uses Taro L. Saito's sqlite-jdbc as the database driver.

About

An sqlite sink plugin for Osmosis

Topics

Resources

License

MIT and 2 other licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE.xerial
BSD-2-Clause
LICENSE.zentus

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages