osm2pgsql
News
02 Dec 2024: | Release 2.0.1 |
21 Nov 2024: | Crunchydata is Loading the World |
19 Sep 2024: | Release 2.0.0 |
01 Apr 2024: | Osm2pgsql goes AI |
12 Feb 2024: | Release 1.11.0 |
About
Osm2pgsql is an Open Source tool for importing OpenStreetMap (OSM) data into a PostgreSQL/PostGIS database. It is an essential part of many rendering toolchains, the Nominatim geocoder and other applications processing OSM data.
Who is using osm2pgsql? Find out.
Features
- Flexible configuration
-
Clean up and convert the OSM data in any way you like before importing into the database. Database table names, column structure, data types, can all be configured the way your application or style needs it.
- Stay up-to-date with OSM
-
An osm2pgsql database can be updated from OSM change files. If you want to, you can keep your database current with only a few minutes delay from the main OSM database.
- Valid Geometries
-
Osm2pgsl creates point, line, polygon, and multipolygon geometries from OSM data and makes sure they are always valid.
- Portable
-
Osm2pgsql is a command line program written in portable C++. It works on Linux, Windows, and macOS.
- Many OSM input formats
-
Process OSM files of any type (in XML, PBF, or O5M format).
- Any Projection
-
Import geometries in Lon/Lat (WGS84), Web Mercator (most popular format for map tiles), or any other projection.
- Support for json, jsonb and hstore columns
-
Use
json
,jsonb
, andhstore
PostgreSQL data types to store the complete set of tags of an OSM object in a single database column. - Resource friendly
-
You can run a database with all OpenStreetMap data for the whole planet on a single, reasonable-sized machine.
Examples
These examples show some use cases of osm2pgsql and highlight some features.
Raster Tiles
This is the "classical" job of osm2pgsql: Import OSM data into a database to create raster tiles from.
Vector Tiles
Osm2pgsql imports OSM data using a very flexible configuration making it easy to generate any kind of vector tiles.
Building Map
Need only a few feature types? Import only what you need for a quick map.
Antarctica Map
Osm2pgsql can use many different projections to fit the area covered and your use case.
Geospatial Analysis
An osm2pgsql database is well-suited for geospatial analysis using the power of the PostGIS database extension.
Creating a POI map
Use osm2pgsql to create a points-of-interest map.
3d Buildings
Use height information on OSM buildings to create a simple 3d map.
Exporting OSM Data
Osm2pgsql and a database can be used as a step in exporting OSM data into many different GIS formats.
Raw Data Publication
The raw OSM data can be published via a web API using pg_featureserv
Sponsors
Developing and supporting osm2pgsql takes a huge amount of effort. We thank the following companies and organizations for their support: