All Projects → openstreetmap → Osm2pgsql

openstreetmap / Osm2pgsql

Licence: gpl-2.0
OpenStreetMap data to PostgreSQL converter

Projects that are alternatives of or similar to Osm2pgsql

cloud-tileserver
Serve mapbox vectortiles via AWS stack
Stars: ✭ 48 (-95.39%)
Mutual labels:  openstreetmap, postgis
Terrain Classic
World-wide CartoCSS port of Stamen's classic terrain style
Stars: ✭ 110 (-89.44%)
Mutual labels:  postgis, openstreetmap
Baremaps
Custom vector tiles from OpenStreetMap and other data sources.
Stars: ✭ 100 (-90.4%)
Mutual labels:  postgis, openstreetmap
Docker Osm
A docker compose project to setup an OSM PostGIS database with automatic updates from OSM periodically
Stars: ✭ 172 (-83.49%)
Mutual labels:  postgis, openstreetmap
osmot
Preprocessor for make public transit maps from Openstreetmap data
Stars: ✭ 14 (-98.66%)
Mutual labels:  openstreetmap, postgis
tilekiln
No description or website provided.
Stars: ✭ 3 (-99.71%)
Mutual labels:  openstreetmap, postgis
Mapwarper
free open source public map georeferencer, georectifier and warper
Stars: ✭ 152 (-85.41%)
Mutual labels:  postgis, openstreetmap
psycopgr
A Python wrapper of pgRouting for routing from nodes to nodes on real map.
Stars: ✭ 24 (-97.7%)
Mutual labels:  openstreetmap, postgis
Tasking Manager
Tasking Manager - The tool to team up for mapping in OpenStreetMap
Stars: ✭ 328 (-68.52%)
Mutual labels:  postgis, openstreetmap
Wikimama
Scripts to help matching OSM features to Wikidata items
Stars: ✭ 8 (-99.23%)
Mutual labels:  openstreetmap
Streetcomplete Mapstyle
🌎 Simple, minimalist yet modern mapstyle
Stars: ✭ 21 (-97.98%)
Mutual labels:  openstreetmap
Osm2geojson
Convert OSM and Overpass JSON to GeoJSON
Stars: ✭ 25 (-97.6%)
Mutual labels:  openstreetmap
Osmium Filter
Fast filter for OSM data
Stars: ✭ 9 (-99.14%)
Mutual labels:  openstreetmap
Osmbc
Open Street Map Blog Collector
Stars: ✭ 21 (-97.98%)
Mutual labels:  openstreetmap
Geography for hackers
Geography for Hackers - Teaching all how to hack geography, use GIS, and think spatially
Stars: ✭ 25 (-97.6%)
Mutual labels:  postgis
Mapbox Gl Js
Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
Stars: ✭ 8,017 (+669.39%)
Mutual labels:  openstreetmap
Osm Testdata
OpenStreetMap Test Data.
Stars: ✭ 24 (-97.7%)
Mutual labels:  openstreetmap
Postgis
PostGIS spatial database extension to PostgreSQL [mirror]
Stars: ✭ 925 (-11.23%)
Mutual labels:  postgis
Osmnet
Tools for the extraction of OpenStreetMap street network data
Stars: ✭ 39 (-96.26%)
Mutual labels:  openstreetmap
Osmquery
Query OSM data and add results to your ArcGIS project
Stars: ✭ 33 (-96.83%)
Mutual labels:  openstreetmap

osm2pgsql

https://osm2pgsql.org

osm2pgsql is a tool for loading OpenStreetMap data into a PostgreSQL / PostGIS database suitable for applications like rendering into a map, geocoding with Nominatim, or general analysis.

See the documentation for instructions on how to install and run osm2pgsql.

Appveyor Build Status Github Actions Build Status Packaging Status

Features

  • Converts OSM files to a PostgreSQL DB
  • Conversion of tags to columns is configurable in the style file
  • Able to read .gz, .bz2, .pbf and .o5m files directly
  • Can apply diffs to keep the database up to date
  • Support the choice of output projection
  • Configurable table names
  • Gazetteer back-end for Nominatim
  • Support for hstore field type to store the complete set of tags in one database field if desired

Installing

Most Linux distributions include osm2pgsql. It is available on macOS with Homebrew and Windows builds are also available. See https://osm2pgsql.org/doc/install.html for details.

Building

The latest source code is available in the osm2pgsql git repository on GitHub and can be downloaded as follows:

git clone git://github.com/openstreetmap/osm2pgsql.git

Osm2pgsql uses the cross-platform CMake build system to configure and build itself.

Required libraries are

It also requires access to a database server running PostgreSQL 9.3+ and PostGIS 2.2+.

Make sure you have installed the development packages for the libraries mentioned in the requirements section and a C++ compiler which supports C++11. GCC 5 and later and Clang 3.5 and later are known to work.

To rebuild the included man page you'll need the pandoc tool.

First install the dependencies.

On a Debian or Ubuntu system, this can be done with:

sudo apt-get install make cmake g++ libboost-dev libboost-system-dev \
  libboost-filesystem-dev libexpat1-dev zlib1g-dev \
  libbz2-dev libpq-dev libproj-dev lua5.3 liblua5.3-dev pandoc

On a Fedora system, use

sudo dnf install cmake make gcc-c++ boost-devel expat-devel zlib-devel \
  bzip2-devel postgresql-devel proj-devel proj-epsg lua-devel pandoc

On RedHat / CentOS first run sudo yum install epel-release then install dependencies with:

sudo yum install cmake make gcc-c++ boost-devel expat-devel zlib-devel \
  bzip2-devel postgresql-devel proj-devel proj-epsg lua-devel pandoc

On a FreeBSD system, use

pkg install devel/cmake devel/boost-libs textproc/expat2 \
  databases/postgresql94-client graphics/proj lang/lua52

On Alpine, use

apk --update-cache add cmake make g++ boost-dev expat-dev \
  bzip2-dev zlib-dev libpq proj-dev lua5.3-dev postgresql-dev

Once dependencies are installed, use CMake to build the Makefiles in a separate folder:

mkdir build && cd build
cmake ..

If some installed dependencies are not found by CMake, more options may need to be set. Typically, setting CMAKE_PREFIX_PATH to a list of appropriate paths is sufficient.

When the Makefiles have been successfully built, compile with

make

The man page can be rebuilt with:

make man

The compiled files can be installed with

sudo make install

By default, the Release build with debug info is created and no tests are compiled. You can change that behavior by using additional options like following:

cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON

Using the PROJ library

Osm2pgsql has builtin support for the Latlong (WGS84, EPSG:4326) and the WebMercator (EPSG:3857) projection. If you need other projections you have to compile with the PROJ library.

Both the older API (PROJ version 4) and the newer API (PROJ version 6.1 and above) are supported. Usually the CMake configuration will find a suitable version and use it automatically, but you can set the USE_PROJ_LIB CMake cache variable to choose between the following behaviours:

  • 4: Look for PROJ library with API version 4. If it is not found, stop with error.
  • 6: Look for PROJ library with API version 6. If it is not found, stop with error.
  • off: Build without PROJ library.
  • auto: Choose API 4 if available, otherwise API 6. If both are not available build without PROJ library. (This is the default.)

Using LuaJIT

To speed up Lua tag transformations, LuaJIT can be optionally enabled on supported platforms. This can speed up processing considerably.

On a Debian or Ubuntu system install the LuaJIT library:

sudo apt-get install libluajit-5.1-dev

Configuration parameter WITH_LUAJIT=ON needs to be added to enable LuaJIT. Otherwise make and installation steps are identical to the description above.

cmake -D WITH_LUAJIT=ON ..

Use osm2pgsql --version to verify that the build includes LuaJIT support. The output should show something like

Lua 5.1.4 (LuaJIT 2.1.0-beta3)

Help/Support

If you have problems with osm2pgsql or want to report a bug, go to https://osm2pgsql.org/support/ .

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Contributing

We welcome contributions to osm2pgsql. See CONTRIBUTING.md and https://osm2pgsql.org/contribute/ for information on how to contribute.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].