https://github.com/osmzoso/osm2sqlite
A command line tool for reading OpenStreetMap XML data into a SQLite database.
https://github.com/osmzoso/osm2sqlite
openstreetmap openstreetmap-data osm sqlite xml
Last synced: 17 days ago
JSON representation
A command line tool for reading OpenStreetMap XML data into a SQLite database.
- Host: GitHub
- URL: https://github.com/osmzoso/osm2sqlite
- Owner: osmzoso
- License: gpl-3.0
- Created: 2020-08-25T06:15:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-10T13:28:08.000Z (about 1 year ago)
- Last Synced: 2024-04-10T15:26:57.396Z (about 1 year ago)
- Topics: openstreetmap, openstreetmap-data, osm, sqlite, xml
- Language: Python
- Homepage:
- Size: 520 KB
- Stars: 12
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# osm2sqlite
A simple command line tool for reading OpenStreetMap XML data into a SQLite database.
```
Usage:
osm2sqlite DATABASE [OPTION ...]Options:
read FILE Reads FILE into the database
(When FILE is -, read stdin)
rtree Add R*Tree indexes
addr Add address tables
graph Add graph table
```The command
```
osm2sqlite test.db read country.osm
```
reads the [OSM XML](https://wiki.openstreetmap.org/wiki/OSM_XML) file **country.osm**
and creates in the database **test.db** the tables.Some options can be used to create additional data.
The tables are described in the [documentation](doc/doc_osm2sqlite.md).
OSM data can be obtained from a provider such as [Geofabrik](https://download.geofabrik.de).
There are two program versions:
- a Python version in a single file as a prototype
- a version in C(see ./tools/osm2sqlite.py and [compilation notes](doc/compile-osm2sqlite.md))
Runtime for a 700 MByte OSM file:
Python : 2 minutes 36 seconds
C : 47 seconds|[**Download the latest version**](https://github.com/osmzoso/osm2sqlite/releases/latest)|
|----------------------------------------------------------------------------------------|