├── .gitignore ├── 404.html ├── Gemfile ├── README.md ├── _bin └── check_ids_in_manual.sh ├── _config.yml ├── _data └── dependencies.yml ├── _includes ├── download.html ├── examples.md ├── heading-links.html ├── highlight.css ├── img │ ├── archive.svg │ ├── book.svg │ ├── community.svg │ ├── download.svg │ ├── faq.svg │ ├── features.svg │ ├── from-source.svg │ ├── history.svg │ ├── logo-apple.svg │ ├── logo-docker.svg │ ├── logo-freebsd.svg │ ├── logo-github.svg │ ├── logo-tux.svg │ ├── logo-windows.svg │ ├── manpages.svg │ ├── tutorials.svg │ └── users.svg └── sponsors.md ├── _layouts ├── default.html ├── doc.html ├── examples.html ├── manpage.html ├── post.html └── release.html ├── _manpages ├── osm2pgsql-1.10.0.md ├── osm2pgsql-1.11.0.md ├── osm2pgsql-1.3.0.md ├── osm2pgsql-1.4.0.md ├── osm2pgsql-1.4.1.md ├── osm2pgsql-1.4.2.md ├── osm2pgsql-1.5.0.md ├── osm2pgsql-1.5.1.md ├── osm2pgsql-1.5.2.md ├── osm2pgsql-1.6.0.md ├── osm2pgsql-1.7.0.md ├── osm2pgsql-1.7.1.md ├── osm2pgsql-1.7.2.md ├── osm2pgsql-1.8.0.md ├── osm2pgsql-1.8.1.md ├── osm2pgsql-1.9.0.md ├── osm2pgsql-1.9.1.md ├── osm2pgsql-1.9.2.md ├── osm2pgsql-2.0.0.md ├── osm2pgsql-2.0.1.md ├── osm2pgsql-2.1.0.md ├── osm2pgsql-2.1.1.md ├── osm2pgsql-gen-2.0.0.md ├── osm2pgsql-gen-2.0.1.md ├── osm2pgsql-gen-2.1.0.md └── osm2pgsql-gen-2.1.1.md ├── _manual-v1 ├── 01-intro.md ├── 02-requirements.md ├── 03-database.md ├── 04-geometries.md ├── 05-running.md ├── 06-flex-output.md ├── 07-pgsql-output.md ├── 08-middle.md ├── 09-expire.md ├── 10-generalization.md ├── 11-advanced-topics.md ├── 12-tips-and-tricks.md ├── A-preparing-input-data.md ├── B-lua-lib.md ├── C-options.md ├── D-upgrading.md ├── E-sizing.md └── options │ ├── advanced.md │ ├── database.md │ ├── expire.md │ ├── help-version.md │ ├── input.md │ ├── logging.md │ ├── main.md │ ├── middle.md │ ├── output.md │ └── pgsql.md ├── _manual-v2 ├── 01-intro.md ├── 02-requirements.md ├── 03-database.md ├── 04-geometries.md ├── 05-running.md ├── 06-flex-output.md ├── 07-pgsql-output.md ├── 08-middle.md ├── 09-expire.md ├── 10-generalization.md ├── 11-advanced-topics.md ├── 12-tips-and-tricks.md ├── A-preparing-input-data.md ├── B-lua-lib.md ├── C-options.md ├── D-upgrading.md ├── E-sizing.md └── options │ ├── advanced.md │ ├── database.md │ ├── expire.md │ ├── help-version.md │ ├── input.md │ ├── logging.md │ ├── main.md │ ├── middle.md │ ├── output.md │ └── pgsql.md ├── _posts ├── 2020-07-28-release-1.3.0.md ├── 2020-09-23-new-website.md ├── 2020-10-21-problems-with-postgresql-jit.md ├── 2020-12-07-release-1.4.0.md ├── 2021-01-12-1000-stars.md ├── 2021-01-14-virtual-meetup.md ├── 2021-02-03-release-1.4.1.md ├── 2021-02-07-successful-community-meetup.md ├── 2021-04-07-release-1.4.2.md ├── 2021-05-16-upcoming-talks.md ├── 2021-06-02-release-1.5.0.md ├── 2021-07-29-release-1.5.1.md ├── 2021-09-30-past-and-upcoming-conference-talks.md ├── 2022-01-11-release-1.5.2.md ├── 2022-01-24-release-1.6.0.md ├── 2022-08-15-release-1.7.0.md ├── 2022-08-30-new-test-server.md ├── 2022-09-06-generalization-project-started.md ├── 2022-09-13-security-audit.md ├── 2022-09-22-developer-interview.md ├── 2022-10-04-book-release.md ├── 2022-10-05-release-1.7.1.md ├── 2022-10-23-timings-and-sizes.md ├── 2022-11-10-release-1.7.2.md ├── 2023-01-22-faster-with-postgresql15.md ├── 2023-01-28-release-1.8.0.md ├── 2023-02-13-release-1.8.1.md ├── 2023-07-25-middle-improvements.md ├── 2023-08-16-release-1.9.0.md ├── 2023-08-18-where-we-are-going.md ├── 2023-08-22-release-1.9.1.md ├── 2023-09-04-release-1.9.2.md ├── 2023-09-11-announcing-themepark.md ├── 2023-09-20-new-github-organisation.md ├── 2023-09-25-2nd-virtual-meetup.md ├── 2023-11-07-release-1.10.0.md ├── 2023-12-10-sotm-eu-talk.md ├── 2024-02-12-release-1.11.0.md ├── 2024-04-01-osm2pgsql-goes-ai.md ├── 2024-09-19-release-2.0.0.md ├── 2024-11-21-crunchydata-is-loading-the-world.md ├── 2024-12-02-release-2.0.1.md ├── 2025-02-06-sovereign-tech-fellowship.md ├── 2025-04-07-release-2.1.0.md └── 2025-04-14-release-2.1.1.md ├── _releases ├── 1.0.0.md ├── 1.10.0.md ├── 1.11.0.md ├── 1.2.0.md ├── 1.2.1.md ├── 1.2.2.md ├── 1.3.0.md ├── 1.4.0.md ├── 1.4.1.md ├── 1.4.2.md ├── 1.5.0.md ├── 1.5.1.md ├── 1.5.2.md ├── 1.6.0.md ├── 1.7.0.md ├── 1.7.1.md ├── 1.7.2.md ├── 1.8.0.md ├── 1.8.1.md ├── 1.9.0.md ├── 1.9.1.md ├── 1.9.2.md ├── 2.0.0.md ├── 2.0.1.md ├── 2.1.0.md └── 2.1.1.md ├── _users ├── eifer.md ├── nominatim.md ├── opencampingmap.md ├── osmcarto.md ├── parkraum.md └── thunderforest.md ├── about ├── features │ └── index.md ├── history │ ├── contributors.png │ └── index.md ├── index.md └── users │ ├── eifer.png │ ├── index.md │ ├── nominatim.png │ ├── opencampingmap.png │ ├── osmcarto.png │ ├── parkraum.png │ └── thunderforest.png ├── contribute ├── dependencies.md ├── how-osm2pgsql-processing-works.md ├── index.md ├── project-ideas.md └── road-map.md ├── css ├── main.scss └── ol.css ├── doc ├── community.md ├── faq.md ├── index.md ├── install.md ├── install │ ├── docker.md │ ├── freebsd.md │ ├── linux.md │ ├── macos.md │ ├── source.md │ └── windows.md ├── man │ ├── index.md │ ├── latest.md │ ├── osm2pgsql-replication-1.10.0.md │ ├── osm2pgsql-replication-1.11.0.md │ ├── osm2pgsql-replication-1.6.0.md │ ├── osm2pgsql-replication-1.7.1.md │ ├── osm2pgsql-replication-1.9.0.md │ ├── osm2pgsql-replication-1.9.1.md │ ├── osm2pgsql-replication-1.9.2.md │ ├── osm2pgsql-replication-2.0.0.md │ ├── osm2pgsql-replication-2.0.1.md │ ├── osm2pgsql-replication-2.1.0.md │ └── osm2pgsql-replication-2.1.1.md ├── manual-v1.html ├── manual.html └── tutorials │ ├── index.md │ └── switching-from-add-row-to-insert │ └── index.md ├── examples ├── 3dbuildings │ ├── 3dbuildings-manhatten.png │ ├── 3dbuildings-small.png │ ├── 3dbuildings.lua │ └── index.md ├── antarctica │ ├── antarctica.lua │ ├── antarctica1-small.png │ ├── antarctica1.png │ ├── antarctica2.png │ └── index.md ├── buildings │ ├── brasilia1.png │ ├── brasilia2-small.png │ ├── brasilia2.png │ ├── buildings.lua │ ├── create-building-example.sh │ └── index.md ├── export │ ├── export.svg │ └── index.md ├── index.md ├── poi-db │ ├── index.md │ ├── pois-berlin-small.png │ ├── pois-berlin.png │ └── pois.lua ├── raster-tiles │ ├── index.md │ └── tiles.png ├── raw-data-publication │ ├── data-symbol.svg │ ├── index.md │ ├── indian-restaurants.geojson │ ├── pg_featureserv.jpg │ └── restaurants.lua ├── road-length │ ├── highways.lua │ └── index.md └── vector-tiles │ ├── .gitignore │ ├── Brussels_signs.jpg │ ├── create-vector-tiles-example.sh │ ├── index.md │ ├── streets-of-brussels-small.png │ ├── streets-of-brussels.png │ └── streets.lua ├── favicon.ico ├── fonts ├── Mulish-Bold.woff ├── Mulish-Bold.woff2 ├── Mulish-Medium.woff ├── Mulish-Medium.woff2 ├── Mulish-MediumItalic.woff ├── Mulish-MediumItalic.woff2 ├── Mulish-Regular.woff └── Mulish-Regular.woff2 ├── generalization ├── PrototypeFund-P-Logo.svg ├── bmbf-logo.png └── index.md ├── img ├── apple.png ├── arch.svg ├── debian.svg ├── download.svg ├── fedora.svg ├── feed.svg ├── info.svg ├── infolink.svg ├── linux.png ├── logo-800.png ├── logo-outline.png ├── logo.png ├── mollweide.png ├── news │ └── 1000-stars.png ├── opensuse.svg ├── osm-help.png ├── osm2pgsql-overview.svg ├── plate-carree.jpg ├── postgis.png ├── postgresql.png ├── switch2osm.png ├── ubuntu.png ├── warning.svg ├── web-mercator.jpg ├── windows.png └── wip.png ├── index.md ├── js └── ol.js ├── news └── index.md ├── releases └── index.md ├── robots.txt ├── sponsors ├── fossgis.png ├── geofabrik.svg ├── index.md ├── osmfoundation.png └── sovereign_tech_fellowship.png ├── support └── index.md └── themepark ├── authors-manual.md ├── index.md └── users-manual.md /.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | .sass-cache 3 | contact.md 4 | download 5 | Gemfile.lock 6 | -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Page not found 4 | --- 5 | 6 |

404: Page not found

7 | 8 |

Sorry, we couldn't find the requested page.

9 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | # Hello! This is where you manage which Jekyll version is used to run. 4 | # When you want to use a different version, change it below, save the 5 | # file and run `bundle install`. Run Jekyll with `bundle exec`, like so: 6 | # 7 | # bundle exec jekyll serve 8 | # 9 | # This will help ensure the proper Jekyll version is running. 10 | # Happy Jekylling! 11 | gem "jekyll", "~> 3.8" 12 | gem "kramdown-parser-gfm" 13 | 14 | # This is the default theme for new Jekyll sites. You may change this to anything you like. 15 | gem "minima", "~> 2.0" 16 | 17 | # If you want to use GitHub Pages, remove the "gem "jekyll"" above and 18 | # uncomment the line below. To upgrade, run `bundle update github-pages`. 19 | # gem "github-pages", group: :jekyll_plugins 20 | 21 | # If you have any plugins, put them here! 22 | group :jekyll_plugins do 23 | gem "jekyll-feed", "~> 0.6" 24 | gem "jekyll-last-modified-at" 25 | end 26 | 27 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 28 | gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] 29 | 30 | # Performance-booster for watching directories on Windows 31 | gem "wdm", "~> 0.1.0" if Gem.win_platform? 32 | 33 | gem "webrick", "~> 1.8" 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Website osm2pgsql.org 3 | 4 | This is the source code for the website of the osm2pgsql software at 5 | [osm2pgsql.org](https://osm2pgsql.org). 6 | 7 | It is written using the static web site generator 8 | [Jekyll](https://jekyllrb.com/). 9 | 10 | ## Development 11 | 12 | The code is expected to be run on stable Debian using ruby packages from 13 | the distribution. To install the required packages run: 14 | 15 | ``` 16 | sudo apt install ruby ruby-bundler jekyll jekyll-theme-minima \ 17 | ruby-kramdown-parser-gfm ruby-jekyll-feed \ 18 | ruby-jekyll-last-modified-at 19 | ``` 20 | 21 | Then check out the repository and build the site: 22 | 23 | ``` 24 | git clone https://github.com/osm2pgsql-dev/osm2pgsql-website 25 | cd osm2pgsql-website 26 | touch contact.md 27 | bundle exec jekyll serve 28 | ``` 29 | 30 | You'll then have a local version running on `http://127.0.0.1:4000/`. 31 | 32 | You can also install the ruby packages from gems. Simply run 33 | `gem install bundler jekyll && bundle install` after checking out the code. 34 | Please make sure to not submit any accidental changes to the `Gemfile.lock` 35 | file in PRs, if you compile this way. 36 | 37 | ## Contributing 38 | 39 | Read https://osm2pgsql.org/contribute/ for more about helping out. 40 | 41 | ## Manpages 42 | 43 | To create the osm2pgsql-replication man page call (in the osm2pgsql repo): 44 | 45 | ``` 46 | groff -mandoc -Thtml man/osm2pgsql-replication.1 47 | ``` 48 | 49 | Copy the result into a page similar to `doc/man/osm2pgsql-replication-1.6.0.md` 50 | and add a link to `doc/man/index.md`. 51 | 52 | ## Icons 53 | 54 | Some icons are from [Ionicons](https://github.com/ionic-team/ionicons). 55 | 56 | -------------------------------------------------------------------------------- /_bin/check_ids_in_manual.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Check for non-unique ids in the manual 4 | # 5 | # Run `jekyll build` before calling this. 6 | # 7 | 8 | grep id= _site/doc/manual.html | cut -d\" -f2 | sort | uniq -c | grep -v 1 9 | 10 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Welcome to Jekyll! 2 | # 3 | # This config file is meant for settings that affect your whole blog, values 4 | # which you are expected to set up once and rarely edit after that. If you find 5 | # yourself editing this file very often, consider using Jekyll's data files 6 | # feature for the data you need to update frequently. 7 | # 8 | # For technical reasons, this file is *NOT* reloaded automatically when you use 9 | # 'bundle exec jekyll serve'. If you change this file, please restart the server process. 10 | 11 | # Site settings 12 | # These are used to personalize your new site. If you look in the HTML files, 13 | # you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. 14 | # You can create any custom variable you would like, and they will be accessible 15 | # in the templates via {{ site.myvariable }}. 16 | title: osm2pgsql 17 | description: >- # this means to ignore newlines until "baseurl:" 18 | osm2pgsql 19 | baseurl: "" # the subpath of your site, e.g. /blog 20 | url: "https://osm2pgsql.org" 21 | github: 22 | repository_url: https://github.com/osm2pgsql-dev/osm2pgsql-website 23 | # 24 | # Build settings 25 | markdown: kramdown 26 | plugins: 27 | - jekyll-feed 28 | # 29 | # Exclude from processing. 30 | # The following items will not be processed, by default. Create a custom list 31 | # to override the default setting. 32 | exclude: 33 | - Gemfile 34 | - Gemfile.lock 35 | - node_modules 36 | - vendor/bundle/ 37 | - vendor/cache/ 38 | - vendor/gems/ 39 | - vendor/ruby/ 40 | - _manual-v1/options 41 | - _manual-v2/options 42 | 43 | feed: 44 | path: news/feed.xml 45 | collections: 46 | manpages: 47 | output: true 48 | permalink: doc/man/:name.html 49 | releases: 50 | output: true 51 | permalink: releases/:name.html 52 | manual-v1: 53 | output: false 54 | manual-v2: 55 | output: false 56 | posts: 57 | output: true 58 | permalink: /news/:year/:month/:day/:title:output_ext 59 | users: 60 | output: false 61 | dependencies: 62 | output: false 63 | defaults: 64 | - 65 | scope: 66 | path: "" 67 | values: 68 | layout: default 69 | - 70 | scope: 71 | path: "" 72 | type: releases 73 | values: 74 | layout: release 75 | - 76 | scope: 77 | path: "" 78 | type: manpages 79 | values: 80 | layout: manpage 81 | -------------------------------------------------------------------------------- /_data/dependencies.yml: -------------------------------------------------------------------------------- 1 | repositories: 2 | - id: debian_13 3 | name: Debian Testing 4 | date: (2025) 5 | gs: groupstart 6 | - id: debian_12 7 | name: Debian 12 Bookworm 8 | date: 2023-06-10 9 | - id: debian_11 10 | name: Debian 11 Bullseye 11 | date: 2021-08-14 12 | eol: 2026 13 | - id: debian_10 14 | name: Debian 10 Buster 15 | date: 2019-07-06 16 | eol: 2024 17 | - id: ubuntu_24_04 18 | name: Ubuntu 24.04 (Noble) 19 | date: 2024-04-25 20 | eol: 2029-06 21 | gs: groupstart 22 | - id: ubuntu_22_04 23 | name: Ubuntu 22.04 (Jammy) 24 | date: 2022-04-21 25 | eol: 2027-04 26 | - id: ubuntu_20_04 27 | name: Ubuntu 20.04 (Focal) 28 | date: 2020-04-23 29 | eol: 2025-04 30 | - id: fedora_rawhide 31 | name: Fedora Rawhide 32 | gs: groupstart 33 | - id: fedora_41 34 | name: Fedora 41 35 | date: 2024-10-29 36 | eol: 2025-11-19 37 | - id: fedora_40 38 | name: Fedora 40 39 | date: 2024-04-23 40 | eol: 2025-05-13 41 | - id: fedora_39 42 | name: Fedora 39 43 | date: 2023-11-07 44 | eol: 2024-11-12 45 | - id: fedora_38 46 | name: Fedora 38 47 | date: 2023-04-18 48 | eol: 2024-05-14 49 | - id: centos_8 50 | name: CentOS 8 51 | date: 2019-09-24 52 | eol: 2029-05-31 53 | gs: groupstart 54 | - id: homebrew 55 | name: Homebrew 56 | gs: groupstart 57 | packages: 58 | - osm2pgsql 59 | - postgresql 60 | - postgis 61 | - lua 62 | - cmake 63 | - gcc 64 | - llvm 65 | - python 66 | - boost 67 | - proj 68 | - catch 69 | - fmt 70 | - libosmium 71 | - protozero 72 | - pyosmium 73 | - nlohmann-json 74 | -------------------------------------------------------------------------------- /_includes/download.html: -------------------------------------------------------------------------------- 1 |
2 | Download Lua config 3 |
4 | -------------------------------------------------------------------------------- /_includes/examples.md: -------------------------------------------------------------------------------- 1 | 2 | These examples show some use cases of osm2pgsql and highlight some features. 3 | 4 |
5 | 6 | 7 | 8 |

Raster Tiles

9 |

This is the "classical" job of osm2pgsql: Import OSM data into a 10 | database to create raster tiles from.

11 |
12 | 13 | 14 | 15 |

Vector Tiles

16 |

Osm2pgsql imports OSM data using a very flexible configuration making 17 | it easy to generate any kind of vector tiles.

18 |
19 | 20 | 21 | 22 |

Building Map

23 |

Need only a few feature types? Import only what you need for a quick 24 | map.

25 |
26 | 27 | 28 | 29 |

Antarctica Map

30 |

Osm2pgsql can use many different projections to fit the area covered 31 | and your use case.

32 |
33 | 34 | 35 |

Geospatial Analysis

36 |

An osm2pgsql database is well-suited for geospatial analysis using 37 | the power of the PostGIS database extension.

38 |
39 | 40 | 41 | 42 |

Creating a POI map

43 |

Use osm2pgsql to create a points-of-interest map.

44 |
45 | 46 | 47 | 48 |

3d Buildings

49 |

Use height information on OSM buildings to create a simple 3d map.

50 |
51 | 52 | 53 | 54 |

Exporting OSM Data

55 |

Osm2pgsql and a database can be used as a step in exporting OSM data 56 | into many different GIS formats.

57 |
58 | 59 | 60 | 61 |

Raw Data Publication

62 |

The raw OSM data can be published via a web API using pg_featureserv

63 |
64 | 65 |
66 | -------------------------------------------------------------------------------- /_includes/heading-links.html: -------------------------------------------------------------------------------- 1 | 40 | -------------------------------------------------------------------------------- /_includes/img/archive.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/book.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/community.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/download.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/faq.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/features.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/from-source.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/history.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/logo-apple.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/logo-docker.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/logo-freebsd.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/logo-github.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/logo-windows.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/manpages.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/tutorials.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/img/users.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/sponsors.md: -------------------------------------------------------------------------------- 1 |
2 |
Thunderforest
3 |
FOSSGIS
4 |
Geofabrik
5 |
Sovereign Tech Fellowship
6 |
7 | -------------------------------------------------------------------------------- /_layouts/doc.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |

{{ page.title }}

6 | 7 | {{ content }} 8 | -------------------------------------------------------------------------------- /_layouts/examples.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title_section: Examples 4 | --- 5 |

Example: {{ page.title }}

6 | 7 | {{ content }} 8 | -------------------------------------------------------------------------------- /_layouts/manpage.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: Manpage {{version}} 4 | title_section: Manual pages 5 | program: osm2pgsql 6 | --- 7 |

Manual page: {{ page.program }}(1)

8 |

{{ page.program }} {{ page.version }}

9 | 10 |
11 | {{ content }} 12 |
13 | -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title_section: News 4 | --- 5 | 6 |
7 |

{{ page.title }}

8 | 9 |
{{ page.date | date_to_long_string }}
10 | 11 | {{ content }} 12 |
13 | -------------------------------------------------------------------------------- /_layouts/release.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title_section: Releases 4 | --- 5 | 6 |

{{ page.title }}

7 | 8 |

Released: {{ page.date | date: "%Y-%m-%d" }}

9 | 10 |

11 | Github release page {% include img/logo-github.svg %} 12 |

13 | 14 | {{ content }} 15 | 16 | {% if page.manpages %} 17 |

Man pages

18 | 19 | 30 | {% endif %} 31 | 32 |

Downloads

33 | 34 | 39 | 40 | 51 | -------------------------------------------------------------------------------- /_manual-v1/01-intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | chapter: 1 3 | title: Introduction 4 | --- 5 | 6 | This is the manual for version 1.x.y of osm2pgsql. The manual for the current 7 | version 2 is [here]({% link doc/manual.html %}). 8 | {:.note} 9 | 10 | Osm2pgsql is used to import OSM data into a PostgreSQL/PostGIS database for 11 | rendering into maps and many other uses. Usually it is only part of a 12 | toolchain, for instance other software is needed for the actual rendering 13 | (i.e. turning the data into a map) or delivery of the maps to the user etc. 14 | 15 | Osm2pgsql is a fairly complex piece of software and it interacts with the 16 | database system and other pieces of the toolchain in complex ways. It will take 17 | a while until you get some experience with it. It is strongly recommended that 18 | you try out osm2pgsql with small extracts of the OSM data, for instance the 19 | data for your city. Do not start with importing data for the whole planet, it 20 | is easy to get something wrong and it will break after processing the data for 21 | hours or days. You can save yourself a lot of trouble doing some trial runs 22 | starting with small extracts and working your way up, observing memory and disk 23 | usage along the way. 24 | 25 | It helps to be familiar with the 26 | [PostgreSQL](https://www.postgresql.org/){:.extlink} database system and the 27 | [PostGIS](https://postgis.net/){:.extlink} extension to it as well as the 28 | [SQL](https://en.wikipedia.org/wiki/SQL){:.extlink} database query language. 29 | Some knowledge of the [Lua language](https://www.lua.org/){:.extlink} is also 30 | useful. 31 | 32 | This manual always documents the current version of osm2pgsql. If same 33 | information is only valid in [certain versions]({% link releases/index.md %}), 34 | the section will have a note like this: *Version >= 1.4.0*{: .version} 35 | 36 | Sections labelled *Experimental*{:.experimental} describe new features which 37 | might change at any point without notice. We encourage you to experiment with 38 | them and report how they work for you, but don't rely on them for production 39 | use. 40 | 41 | It is recommended that you always use the newest [released version]({% link 42 | releases/index.md %}) of osm2pgsql. Earlier versions sometimes contain bugs 43 | that have long since been fixed. 44 | 45 | -------------------------------------------------------------------------------- /_manual-v1/C-options.md: -------------------------------------------------------------------------------- 1 | --- 2 | chapter: 22 3 | appendix: C 4 | title: Command Line Options 5 | --- 6 | 7 | This appendix contains an overview of all command line options. 8 | 9 | ### Main Options 10 | 11 | {% include_relative options/main.md %} 12 | 13 | ### Help/Version Options 14 | 15 | {% include_relative options/help-version.md %} 16 | 17 | ### Logging Options 18 | 19 | {% include_relative options/logging.md %} 20 | 21 | ### Database Options 22 | 23 | {% include_relative options/database.md %} 24 | 25 | ### Input Options 26 | 27 | {% include_relative options/input.md %} 28 | 29 | ### Middle Options 30 | 31 | {% include_relative options/middle.md %} 32 | 33 | ### Output Options 34 | 35 | {% include_relative options/output.md %} 36 | 37 | ### Pgsql Output Options 38 | 39 | {% include_relative options/pgsql.md %} 40 | 41 | ### Expire Options 42 | 43 | {% include_relative options/expire.md %} 44 | 45 | ### Advanced Options 46 | 47 | {% include_relative options/advanced.md %} 48 | 49 | -------------------------------------------------------------------------------- /_manual-v1/E-sizing.md: -------------------------------------------------------------------------------- 1 | --- 2 | chapter: 24 3 | appendix: E 4 | title: Sizing 5 | --- 6 | 7 | It is sometimes difficult to figure out how large a machine you need for an 8 | osm2pgsql database import or how long that import will take. This appendix will 9 | give some guidance on that. But remember that each situation is different, 10 | hardware is different, operating systems are different, database versions are 11 | different. And the exact [configuration for the 12 | database](#tuning-the-postgresql-server) and osm2pgsql can play a large role. 13 | So take the numbers here only as some rough first approximations and try it out 14 | yourself. 15 | 16 | Here are the numbers for non-updateable (non-slim) imports: 17 | 18 | | Input file | PBF file size | Import time | Database size | RAM used | 19 | | ----------- | ------------: | --------------: | ------------: | -------: | 20 | | Switzerland | 0.4 GB | 1 to 4 mins | 2 to 3 GB | 3 GB | 21 | | Germany | 4 GB | 18 to 39 mins | 20 to 30 GB | 10 GB | 22 | | Europe | 27 GB | 130 to 240 mins | 140 to 180 GB | 60 GB | 23 | | Planet | 70 GB | 5.5 to 9 hours | 330 to 407 GB | 120 GB | 24 | {:.desc} 25 | 26 | Here are the numbers for updateable (slim with flat nodes) imports: 27 | 28 | | Input file | PBF file size | Import time | Database size | | 29 | | ----------- | ------------: | --------------: | ------------: | -------: | 30 | | Switzerland | 0.4 GB | 3 to 5 mins | 4 to 5 GB | | 31 | | Germany | 4 GB | 20 to 42 mins | 40 to 48 GB | | 32 | | Europe | 27 GB | 150 to 240 mins | 260 to 310 GB | | 33 | | Planet | 70 GB | 6 to 10 hours | 590 to 730 GB | | 34 | {:.desc} 35 | 36 | Imports were run on a machine with AMD Ryzen 9 3900 12-Core Processor, 128 GB 37 | RAM and NVMe SSDs. The database was tuned according [the chapter on server 38 | tuning](#tuning-the-postgresql-server). These values are from osm2pgsql version 39 | 1.7.0 and with PostgreSQL 14 using data from October 2022. 40 | 41 | The imports were run with different configurations, using the pgsql output and 42 | the flex output (with LuaJIT disabled) from simple configurations to complex 43 | ones using the openstreetmap-carto style. RAM use is for osm2pgsql itself only, 44 | the database itself also needs memory. For updatable databases RAM use is 45 | always reported to be around the 80 GB needed for mapping the flat node file 46 | into RAM, but that's not the actual memory used, so these numbers are not shown. 47 | -------------------------------------------------------------------------------- /_manual-v1/options/advanced.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | --------------------------------- | ----------- | 3 | | -I, \--disable-parallel-indexing | Disable parallel clustering and index building on all tables, build one index after the other. | 4 | | \--number-processes=THREADS | Specifies the number of parallel threads used for certain operations. The default is to set this between 1 and 4 depending on the number of CPUs you have. Values up to 32 are possible but probably not useful. Note that each thread opens multiple connections to the database and you will probably reach the limit of allowed database connections. | 5 | | \--with-forward-dependencies=BOOL | *Version >= 1.4.0*{:.version} Propagate changes from nodes to ways and node/way members to relations (Default: `true`). When this is set to `false` on import, any updates need to be run with `false`, too. *Version >= 1.8.0*{:.version} This version is deprecated. | 6 | {: .desc} 7 | -------------------------------------------------------------------------------- /_manual-v1/options/database.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | -------------------- | ----------- | 3 | | -d, \--database=DB | Database name or PostgreSQL conninfo string. | 4 | | -U, \--user=USERNAME | Database user. | 5 | | -W, \--password | Force password prompt. Do not put the password on the command line! | 6 | | -H, \--host=HOST | Database server hostname or unix domain socket location. | 7 | | -P, \--port=PORT | Database server port. | 8 | | \--schema=SCHEMA | *Version >= 1.9.0*{:.version} Default for various schema settings throughout osm2pgsql (default: `public`). The schema must exist in the database and be writable by the database user. | 9 | {: .desc} 10 | -------------------------------------------------------------------------------- /_manual-v1/options/expire.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | --------------------------------------- | ----------- | 3 | | -e, \--expire-tiles=[MIN-ZOOM-]MAX-ZOOM | Create a tile expiry list for zoom level `MAX-ZOOM` or all zoom levels between `MIN-ZOOM` and `MAX-ZOOM` (default is `0` which means the feature is disabled) | 4 | | -o, \--expire-output=FILENAME | Output file name for expired tiles list (default: `dirty_tiles`) | 5 | | \--expire-bbox-size=SIZE | Max width and height for a polygon to expire the whole polygon, not just the boundary (default `20000`) | 6 | {: .desc} 7 | -------------------------------------------------------------------------------- /_manual-v1/options/help-version.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | --------------- | ----------- | 3 | | -h, \--help | Print help. Add `-v, --verbose` for more verbose help. | 4 | | -V, \--version | Print osm2pgsql version. Also prints versions of some libraries used. | 5 | {: .desc} 6 | -------------------------------------------------------------------------------- /_manual-v1/options/input.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | -------------------------- | ----------- | 3 | | -r, \--input-reader=FORMAT | Select format of the input file. Available choices are **auto** (default) for autodetecting the format, **xml** for OSM XML format files, **o5m** for o5m formatted files and **pbf** for OSM PBF binary format. | 4 | | -b, \--bbox=BBOX | Apply a bounding box filter in format `MINLON,MINLAT,MAXLON,MAXLAT` on the imported data. Example: **\--bbox** **-0.5,51.25,0.5,51.75** | 5 | {: .desc} 6 | -------------------------------------------------------------------------------- /_manual-v1/options/logging.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | ----------------------| ----------- | 3 | | \--log-level=LEVEL | *Version >= 1.4.0*{: .version} Set log level (`debug`, `info` (default), `warn`, or `error`). | 4 | | \--log-progress=VALUE | *Version >= 1.4.0*{: .version} Enable (`true`) or disable (`false`) progress logging. Setting this to `auto` will enable progress logging on the console and disable it if the output is redirected to a file. Default: true. | 5 | | \--log-sql | *Version >= 1.4.0*{: .version} Enable logging of SQL commands for debugging. | 6 | | \--log-sql-data | *Version >= 1.4.0*{: .version} Enable logging of all data added to the database. This will write out a huge amount of data! For debugging. | 7 | | -v, \--verbose | *Version >= 1.4.0*{: .version} Same as `--log-level=debug`. | 8 | {: .desc} 9 | -------------------------------------------------------------------------------- /_manual-v1/options/main.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | ---------------- | ----------- | 3 | | -a, \--append | Run in append mode. | 4 | | -c, \--create | Run in create mode (this is the default if `-a, --append` is not used). | 5 | {: .desc} 6 | -------------------------------------------------------------------------------- /_manual-v1/options/output.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | -------------------- | ----------- | 3 | | -O, \--output=OUTPUT | Select the output. Available outputs are: **flex**, **pgsql** (default), **gazetteer**, and **null**. *Version >= 1.9.0*{:.version} You don’t need to add this option any more in append mode, because osm2pgsql will remember it from the import. | 4 | | -S, \--style=STYLE | The style file. This specifies how the data is imported into the database, its format depends on the output. (For the **pgsql** output, the default is `/usr/share/osm2pgsql/default.style`, for other outputs there is no default.) *Version >= 1.9.0*{:.version} You don’t need to add this option any more in append mode, because osm2pgsql will remember it from the import. If you set it in append mode anyway, it will use the new setting for this and future updates. | 5 | {: .desc} 6 | -------------------------------------------------------------------------------- /_manual-v2/01-intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | chapter: 1 3 | title: Introduction 4 | --- 5 | 6 | This is the manual for version 2.x.y of osm2pgsql. If you are running an 7 | older version of osm2pgsql, refer to the [manual v1]({% link doc/manual-v1.html 8 | %}). 9 | {:.note} 10 | 11 | Osm2pgsql is used to import OSM data into a PostgreSQL/PostGIS database for 12 | rendering into maps and many other uses. Usually it is only part of a 13 | toolchain, for instance other software is needed for the actual rendering 14 | (i.e. turning the data into a map) or delivery of the maps to the user etc. 15 | 16 | Osm2pgsql is a fairly complex piece of software and it interacts with the 17 | database system and other pieces of the toolchain in complex ways. It will take 18 | a while until you get some experience with it. It is strongly recommended that 19 | you try out osm2pgsql with small extracts of the OSM data, for instance the 20 | data for your city. Do not start with importing data for the whole planet, it 21 | is easy to get something wrong and it will break after processing the data for 22 | hours or days. You can save yourself a lot of trouble doing some trial runs 23 | starting with small extracts and working your way up, observing memory and disk 24 | usage along the way. 25 | 26 | It helps to be familiar with the 27 | [PostgreSQL](https://www.postgresql.org/){:.extlink} database system and the 28 | [PostGIS](https://postgis.net/){:.extlink} extension to it as well as the 29 | [SQL](https://en.wikipedia.org/wiki/SQL){:.extlink} database query language. 30 | Some knowledge of the [Lua language](https://www.lua.org/){:.extlink} is also 31 | useful. 32 | 33 | This manual always documents the current version of osm2pgsql. If same 34 | information is only valid in [certain versions]({% link releases/index.md %}), 35 | the section will have a note like this: *Version >= 2.0.0*{: .version} 36 | This manual is only for version 2 and above, refer to the 37 | [manual v1]({% link doc/manual-v1.html %}) for older versions. 38 | 39 | Sections labelled *Experimental*{:.experimental} describe new features which 40 | might change at any point without notice. We encourage you to experiment with 41 | them and report how they work for you, but don't rely on them for production 42 | use. 43 | 44 | It is recommended that you always use the newest [released version]({% link 45 | releases/index.md %}) of osm2pgsql. Earlier versions sometimes contain bugs 46 | that have long since been fixed. 47 | 48 | -------------------------------------------------------------------------------- /_manual-v2/C-options.md: -------------------------------------------------------------------------------- 1 | --- 2 | chapter: 22 3 | appendix: C 4 | title: Command Line Options 5 | --- 6 | 7 | This appendix contains an overview of all command line options. 8 | 9 | ### Main Options 10 | 11 | {% include_relative options/main.md %} 12 | 13 | ### Help/Version Options 14 | 15 | {% include_relative options/help-version.md %} 16 | 17 | ### Logging Options 18 | 19 | {% include_relative options/logging.md %} 20 | 21 | ### Database Options 22 | 23 | {% include_relative options/database.md %} 24 | 25 | ### Input Options 26 | 27 | {% include_relative options/input.md %} 28 | 29 | ### Middle Options 30 | 31 | {% include_relative options/middle.md %} 32 | 33 | ### Output Options 34 | 35 | {% include_relative options/output.md %} 36 | 37 | ### Pgsql Output Options 38 | 39 | {% include_relative options/pgsql.md %} 40 | 41 | ### Expire Options 42 | 43 | {% include_relative options/expire.md %} 44 | 45 | ### Advanced Options 46 | 47 | {% include_relative options/advanced.md %} 48 | 49 | -------------------------------------------------------------------------------- /_manual-v2/E-sizing.md: -------------------------------------------------------------------------------- 1 | --- 2 | chapter: 24 3 | appendix: E 4 | title: Sizing 5 | --- 6 | 7 | It is sometimes difficult to figure out how large a machine you need for an 8 | osm2pgsql database import or how long that import will take. This appendix will 9 | give some guidance on that. But remember that each situation is different, 10 | hardware is different, operating systems are different, database versions are 11 | different. And the exact [configuration for the 12 | database](#tuning-the-postgresql-server) and osm2pgsql can play a large role. 13 | So take the numbers here only as some rough first approximations and try it out 14 | yourself. 15 | 16 | Here are the numbers for non-updateable (non-slim) imports: 17 | 18 | | Input file | PBF file size | Import time | Database size | RAM used | 19 | | ----------- | ------------: | --------------: | ------------: | -------: | 20 | | Switzerland | 0.4 GB | 1 to 4 mins | 2 to 3 GB | 3 GB | 21 | | Germany | 4 GB | 18 to 39 mins | 20 to 30 GB | 10 GB | 22 | | Europe | 27 GB | 130 to 240 mins | 140 to 180 GB | 60 GB | 23 | | Planet | 70 GB | 5.5 to 9 hours | 330 to 407 GB | 120 GB | 24 | {:.desc} 25 | 26 | Here are the numbers for updateable (slim with flat nodes) imports: 27 | 28 | | Input file | PBF file size | Import time | Database size | | 29 | | ----------- | ------------: | --------------: | ------------: | -------: | 30 | | Switzerland | 0.4 GB | 3 to 5 mins | 4 to 5 GB | | 31 | | Germany | 4 GB | 20 to 42 mins | 40 to 48 GB | | 32 | | Europe | 27 GB | 150 to 240 mins | 260 to 310 GB | | 33 | | Planet | 70 GB | 6 to 10 hours | 590 to 730 GB | | 34 | {:.desc} 35 | 36 | Imports were run on a machine with AMD Ryzen 9 3900 12-Core Processor, 128 GB 37 | RAM and NVMe SSDs. The database was tuned according [the chapter on server 38 | tuning](#tuning-the-postgresql-server). These values are from osm2pgsql version 39 | 1.7.0 and with PostgreSQL 14 using data from October 2022. 40 | 41 | The imports were run with different configurations, using the pgsql output and 42 | the flex output (with LuaJIT disabled) from simple configurations to complex 43 | ones using the openstreetmap-carto style. RAM use is for osm2pgsql itself only, 44 | the database itself also needs memory. For updatable databases RAM use is 45 | always reported to be around the 80 GB needed for mapping the flat node file 46 | into RAM, but that's not the actual memory used, so these numbers are not shown. 47 | -------------------------------------------------------------------------------- /_manual-v2/options/advanced.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | --------------------------------- | ----------- | 3 | | -I, \--disable-parallel-indexing | Disable parallel clustering and index building on all tables, build one index after the other. | 4 | | \--number-processes=THREADS | Specifies the number of parallel threads used for certain operations. The default is to set this between 1 and 4 depending on the number of CPUs you have. Values up to 32 are possible but probably not useful. Note that each thread opens multiple connections to the database and you will probably reach the limit of allowed database connections. | 5 | {: .desc} 6 | -------------------------------------------------------------------------------- /_manual-v2/options/database.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | -------------------- | ----------- | 3 | | -d, \--database=DB | Database name or PostgreSQL conninfo string. | 4 | | -U, \--user=USERNAME | Database user. | 5 | | -W, \--password | Force password prompt. Do not put the password on the command line! | 6 | | -H, \--host=HOST | Database server hostname or unix domain socket location. | 7 | | -P, \--port=PORT | Database server port. | 8 | | \--schema=SCHEMA | Default for various schema settings throughout osm2pgsql (default: `public`). The schema must exist in the database and be writable by the database user. | 9 | {: .desc} 10 | -------------------------------------------------------------------------------- /_manual-v2/options/expire.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | --------------------------------------- | ----------- | 3 | | -e, \--expire-tiles=[MIN-ZOOM-]MAX-ZOOM | Create a tile expiry list for zoom level `MAX-ZOOM` or all zoom levels between `MIN-ZOOM` and `MAX-ZOOM` (default is `0` which means the feature is disabled) | 4 | | -o, \--expire-output=FILENAME | Output file name for expired tiles list (default: `dirty_tiles`) | 5 | | \--expire-bbox-size=SIZE | Max width and height for a polygon to expire the whole polygon, not just the boundary (default `20000`) | 6 | {: .desc} 7 | -------------------------------------------------------------------------------- /_manual-v2/options/help-version.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | --------------- | ----------- | 3 | | -h, \--help | Print help. Add `-v, --verbose` for more verbose help. | 4 | | -V, \--version | Print osm2pgsql version. Also prints versions of some libraries used. | 5 | {: .desc} 6 | -------------------------------------------------------------------------------- /_manual-v2/options/input.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | -------------------------- | ----------- | 3 | | -r, \--input-reader=FORMAT | Select format of the input file. Available choices are **auto** (default) for autodetecting the format, **xml** for OSM XML format files, **o5m** for o5m formatted files and **pbf** for OSM PBF binary format. | 4 | | -b, \--bbox=BBOX | Apply a bounding box filter in format `MINLON,MINLAT,MAXLON,MAXLAT` on the imported data. Example: **\--bbox** **-0.5,51.25,0.5,51.75** | 5 | {: .desc} 6 | -------------------------------------------------------------------------------- /_manual-v2/options/logging.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | ----------------------| ----------- | 3 | | \--log-level=LEVEL | Set log level (`debug`, `info` (default), `warn`, or `error`). | 4 | | \--log-progress=VALUE | Enable (`true`) or disable (`false`) progress logging. Setting this to `auto` will enable progress logging on the console and disable it if the output is redirected to a file. Default: true. | 5 | | \--log-sql | Enable logging of SQL commands for debugging. | 6 | | \--log-sql-data | Enable logging of all data added to the database. This will write out a huge amount of data! For debugging. | 7 | | -v, \--verbose | Same as `--log-level=debug`. | 8 | {: .desc} 9 | -------------------------------------------------------------------------------- /_manual-v2/options/main.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | ---------------- | ----------- | 3 | | -a, \--append | Run in append mode. | 4 | | -c, \--create | Run in create mode (this is the default if `-a, --append` is not used). | 5 | {: .desc} 6 | -------------------------------------------------------------------------------- /_manual-v2/options/output.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | -------------------- | ----------- | 3 | | -O, \--output=OUTPUT | Select the output. Available outputs are: **flex**, **pgsql** (default), and **null**. You don’t need to add this option in append mode, because osm2pgsql will remember it from the import. | 4 | | -S, \--style=STYLE | The style file. This specifies how the data is imported into the database, its format depends on the output. (For the **pgsql** output, the default is `/usr/share/osm2pgsql/default.style`, for other outputs there is no default.) You don’t need to add this option in append mode, because osm2pgsql will remember it from the import. If you set it in append mode anyway, it will use the new setting for this and future updates. | 5 | {: .desc} 6 | -------------------------------------------------------------------------------- /_manual-v2/options/pgsql.md: -------------------------------------------------------------------------------- 1 | | Option | Description | 2 | | ------------------------------------- | ----------- | 3 | | \--tablespace-main-data=TABLESPC | Store the data tables in the PostgreSQL tablespace `TABLESPC`. | 4 | | \--tablespace-main-index=TABLESPC | Store the indexes in the PostgreSQL tablespace `TABLESPC`. | 5 | | -l, \--latlong | Store coordinates in degrees of latitude & longitude. | 6 | | -m, \--merc | Store coordinates in Spherical Mercator (Web Mercator, EPSG:3857) (the default). | 7 | | -E, \--proj=SRID | Use projection EPSG:`SRID`. | 8 | | -p, \--prefix=PREFIX | Prefix for table names (default: `planet_osm`). This option affects the middle as well as the pgsql output table names. | 9 | | \--tag-transform-script=SCRIPT | Specify a Lua script to handle tag filtering and normalisation. The script contains callback functions for nodes, ways and relations, which each take a set of tags and returns a transformed, filtered set of tags which are then written to the database. | 10 | | -x, \--extra-attributes | Include attributes (user name, user id, changeset id, timestamp and version). This also requires additional entries in your style file. | 11 | | -k, \--hstore | Add tags without column to an additional hstore (key/value) column in the database tables. | 12 | | -j, \--hstore-all | Add all tags to an additional hstore (key/value) column in the database tables. | 13 | | -z, \--hstore-column=PREFIX | Add an additional hstore (key/value) column named `PREFIX` containing all tags that have a key starting with `PREFIX`, eg `\--hstore-column "name:"` will produce an extra hstore column that contains all `name:xx` tags. | 14 | | \--hstore-match-only | Only keep objects that have a value in at least one of the non-hstore columns. | 15 | | \--hstore-add-index | Create indexes for all hstore columns after import. | 16 | | -G, \--multi-geometry | Normally osm2pgsql splits multi-part geometries into separate database rows per part. A single OSM object can therefore use several rows in the output tables. With this option, osm2pgsql instead generates multi-geometry features in the PostgreSQL tables. | 17 | | -K, \--keep-coastlines | Keep coastline data rather than filtering it out. By default objects tagged `natural=coastline` will be discarded based on the assumption that Shapefiles generated by OSMCoastline (https://osmdata.openstreetmap.de/) will be used for the coastline data. | 18 | | \--reproject-area | Compute area column using Spherical Mercator coordinates even if a different projection is used for the geometries. | 19 | | \--output-pgsql-schema=SCHEMA | Use PostgreSQL schema SCHEMA for all tables, indexes, and functions in the pgsql output. The schema must exist in the database and be writable by the database user. By default the schema set with `--schema` is used, or `public` if that is not set. | 20 | {: .desc} 21 | -------------------------------------------------------------------------------- /_posts/2020-09-23-new-website.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: New Website for Osm2pgsql 4 | --- 5 | 6 | Osm2pgsql has been an important part of the OpenStreetMap software stack for a 7 | long time. But its documentation is scattered between the OSM wiki, the Github 8 | repository and other places here or there. Now, thanks to some money the 9 | [OpenStreetMap Foundation](https://osmfoundation.org/) is putting towards 10 | osm2pgsql development, we can unvail a new website for the project allowing us 11 | to bring together all the information about the project. 12 | 13 | Having a proper website for the project should make it much easier for new 14 | users and old hands alike to install, configure, and run osm2pgsql. 15 | 16 | This is only a first step in a bigger task. The website isn't complete yet, 17 | there is a lot of work to do, especially fleshing out the documentation and 18 | adding to the FAQ. This will happen over the next months. Eventually we hope to 19 | consolidate all documentation from the wiki and the repository here. 20 | 21 | We are also looking for examples of osm2pgsql use, tips & tricks, and so on. 22 | If you are using osm2pgsql in some interesting way or want to share some 23 | experiences, contact us. 24 | 25 | -------------------------------------------------------------------------------- /_posts/2020-10-21-problems-with-postgresql-jit.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Problems with PostgreSQL JIT 4 | --- 5 | 6 | Since version 11 PostgreSQL can use [Just-in-Time Compilation 7 | (JIT)](https://www.postgresql.org/docs/current/jit.html) to speed up 8 | processing. But unfortunately using JIT can make osm2pgsql slower. 9 | 10 | If JIT is enabled, there is a problem in how the query planner in PostgreSQL 11 | handles certain queries from osm2pgsql leading to massive slowdowns. This is 12 | only a problem for updates, initial imports are fine. On PostgreSQL 11 JIT is 13 | still disabled by default, so you are not likely to see it there, but since 14 | version 12 JIT is usually enabled. The problem was [noticed and 15 | diagnosed](https://github.com/osm2pgsql-dev/osm2pgsql/issues/1045) and we added 16 | code in release 1.3.0 that was supposed to disable JIT in PostgreSQL for our 17 | database connections. Unfortunately this code had a bug and JIT was never 18 | disabled. 19 | 20 | The next release will have a fix for this, but in the mean time the 21 | recommendation is to manually disable JIT when running osm2pgsql. You can 22 | either do this by setting these in your PostgreSQL config: 23 | 24 | ``` 25 | jit = off 26 | max_parallel_workers_per_gather = 0 27 | ``` 28 | 29 | Or, if you only want to disable this when running osm2pgsql, set the 30 | environment variable `PGOPTIONS` before calling osm2pgsql with something 31 | like this: 32 | 33 | ``` 34 | export PGOPTIONS="-c jit=off -c max_parallel_workers_per_gather=0" 35 | ``` 36 | 37 | -------------------------------------------------------------------------------- /_posts/2021-01-12-1000-stars.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: 1000 Stars on Github 4 | --- 5 | 6 | Github stars 7 | 8 | The [osm2pgsql repository on 9 | Github](https://github.com/osm2pgsql-dev/osm2pgsql) has reached 1000 stars! 10 | Thanks, everybody, for you interest! 11 | 12 | -------------------------------------------------------------------------------- /_posts/2021-01-14-virtual-meetup.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Virtual Meetup on osm2pgsql 4 | --- 5 | 6 | Osm2pgsql development has picked up steam in the last months. Many new features 7 | have been implemented and we have many more ideas. And there are plenty of 8 | issues to work on. But to decide where we are going next and what to 9 | prioritize, we want to hear more from the osm2pgsql users. 10 | 11 | To that end we are planning a virtual meetup. It will take place 12 | [online](https://meet.topf.org/osm2pgsql) on February 2nd, 2021 starting 18:00 13 | UTC. We'll talk a bit about the current state of osm2pgsql and our plans, but 14 | this is mostly for answering any questions you might have and for discussing 15 | ideas on osm2pgsql. Anybody can join, you don't need to register. See you 16 | there! 17 | 18 | -------------------------------------------------------------------------------- /_posts/2021-02-03-release-1.4.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.4.1 4 | --- 5 | 6 | This is a minor release with some bug fixes and internal cleanups and changes, 7 | mostly in the "middle" code and geometry processing. 8 | 9 | We have released all example config files for the flex output into the Public 10 | Domain, so they can be used as widely as possible. 11 | 12 | Fixes: 13 | 14 | * Some MultiLineStrings were not assembled correctly from relations. This 15 | happened when a relation had exactly two member ways forming a closed ring 16 | with the two ways oriented against each other (#1394). 17 | * Long LineStrings can (optionally) be split by osm2pgsql into shorter 18 | segments. In some cases this would produce invalid LineStrings (aee1be1). 19 | * Do not try to display ANSI color codes on Windows terminals which don't 20 | understand them (ab96aeb). 21 | 22 | Other changes: 23 | 24 | * When osm2pgsql is started without any arguments, it now shows the help text 25 | instead of an error. 26 | * Write PostGIS version to output when osm2pgsql starts up and show error 27 | message when a database without PostGIS extension is used (c7927e8, #1400). 28 | * Improved progress output and summary information when processing input files. 29 | * Add log entry with number of threads when thread pool is started (34cf9d8). 30 | * Report overall memory usage at the end of running osm2pgsql. 31 | * Updated included library versions (fmt 7.1.3, libosmium 2.16.0, catch 2.13.4). 32 | 33 | -------------------------------------------------------------------------------- /_posts/2021-02-07-successful-community-meetup.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Successful Community Meetup 4 | author: Jochen Topf 5 | --- 6 | 7 | Last week we had our first virtual osm2pgsql community meetup. There was quite 8 | a bit more interest than we had anticipated. 16 developers and users talked 9 | about plans and ideas and many questions could be answered. 10 | 11 | I started the meeting with a short intro about the development and 12 | documentation work we did in the last year, talked about where we are at the 13 | moment, and where our [current development 14 | priorities](https://osm2pgsql.org/contribute/road-map.html) are. 15 | 16 | After the intro we had a wide-ranging discussion about existing and missing 17 | features in osm2pgsql. One hot topic were geometry transformations and 18 | computing of derived geometries like centroids, merged geometries and 19 | simplified geometries. This is high on our list of things to do, but before 20 | many of these features can be implemented some ground-work needs to be done 21 | cleaning up the geometry-related code. 22 | 23 | Other topics were: tile expiry, multithreading, performance of osm2pgsql and 24 | PostgreSQL, docker scripts, connecting to different types of databases, better 25 | documentation, testing strategies, and many more. 26 | 27 | The meeting showed that we have a diverse community with widely differing use 28 | cases. Some people use osm2pgsql more for ad-hoc imports of small data extracts 29 | to visualize in QGIS or do complex postprocessing on. Others use it to run 30 | planet-wide and minutely updated tile servers. 31 | 32 | I hope the users got their questions answered and we developers certainly got 33 | some good ideas and suggestions from the community. One question that was 34 | discussed is how to best keep an osm2pgsql database up to date. There are 35 | several existing solutions but none of them is really easy to use, so Sarah 36 | wrote a new pyosmium-based script geared towards use with osm2pgsql, the [pull 37 | request](https://github.com/osm2pgsql-dev/osm2pgsql/pull/1411) is currently in 38 | review. 39 | 40 | *Jochen Topf* 41 | 42 | -------------------------------------------------------------------------------- /_posts/2021-04-07-release-1.4.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.4.2 4 | --- 5 | 6 | This is a minor bugfix release that fixes the following issues: 7 | 8 | * Translate empty strings into `NULL` instead of 0.0 for columns of type double. 9 | * Consistently quote table names to handle upper case table prefixes correctly. 10 | * Avoid querying geometries in stage 2 of the flex output when expiry is disabled. 11 | * Fix syntax error in index creation with schema enabled. 12 | 13 | The release also adds a new `osm2pgsql-replication` script to simplify the 14 | process of downloading and applying updates. It requires pyosmium and psycopg2. 15 | See [#1411](https://github.com/osm2pgsql-dev/osm2pgsql/pull/1411){:.extlink} 16 | for more information. 17 | 18 | -------------------------------------------------------------------------------- /_posts/2021-05-16-upcoming-talks.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Upcoming Talks 4 | author: Jochen Topf 5 | --- 6 | 7 | I'll be giving two talks about osm2pgsql soon. Both will be online. The first 8 | is at the German language [FOSSGIS 9 | conference](https://www.fossgis-konferenz.de/) which takes place from June 6th 10 | to June 9th. The second is a the English language [State of The 11 | Map](https://2021.stateofthemap.org/) from July 9th to 11th. Both talks will 12 | focus on new developments in osm2pgsql. You'll need to register with these 13 | events to see the talks, but they will be available for free later. 14 | 15 | *Jochen Topf* 16 | 17 | -------------------------------------------------------------------------------- /_posts/2021-06-02-release-1.5.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.5.0 4 | --- 5 | 6 | This release brings quite a lot of improvements. The most important one: The 7 | flex output which we introduced in version 1.3.0 almost a year ago as a new 8 | experimental feature is now ready for prime time: We are removing the 9 | "experimental" label. There are some small changes you might have to make 10 | to your flex configurations, see the 11 | [Upgrading](https://osm2pgsql.org/doc/manual.html#upgrading) chapter of the 12 | manual for details. We have also introduced a new [`cluster` table 13 | option](https://osm2pgsql.org/doc/manual.html#advanced-table-definition) in 14 | the flex config file which allows you to disable clustering of the table data 15 | by geometry. 16 | 17 | This release brings a complete rewrite of the code used to temporarily store 18 | OSM data in memory while processing the data in non-slim mode, i.e. when you 19 | import data without `--slim`. The new code needs far less memory, this will 20 | speed up imports of smaller extracts and make imports of medium sized extracts 21 | possible that you couldn't do before. Memory requirements are now about 2.5 22 | times the size of the PBF input file, which means most country sized extracts 23 | can quickly be imported on reasonably sized servers. When running with 24 | `--log-level=debug` osm2pgsql will report how much memory it uses for this. 25 | When running in slim mode, memory use for the cache has also been reduced. 26 | 27 | Again this release contains a huge amount of internal cleanups and 28 | restructurings of the code. This makes the code more robust, easier to 29 | understand and change. It also gave us a more solid base for some of the new 30 | features in this release and for more features in the future. 31 | 32 | The multi output which was marked as deprecated in the last versions has now 33 | been removed. 34 | 35 | This is the first release that needs a C++14 compiler. 36 | 37 | There are some further smaller changes: 38 | * Do not try to create indexes for flex output tables without id. 39 | * Added a warning if `--flat-nodes/-F` is used in non-slim mode. 40 | * Added flex config example (`attributes.lua`) showing how to access 41 | OSM object attributes (such as timestamp, user name, etc.) from Lua. 42 | * Report thread number in all log lines when `--log-level=debug` is set. 43 | * Use trigger to check geometry validity on first import instead of only doing 44 | this when copying the data for clustering. In the flex output this validity 45 | check is not used any more for point geometries because they are always 46 | valid anyway. 47 | * The [RapidJSON](https://rapidjson.org) library is now used and included 48 | in the source. 49 | * Now needs [libosmium](https://osmcode.org/libosmium/) 2.17.0 which is 50 | included in the source. 51 | 52 | -------------------------------------------------------------------------------- /_posts/2021-07-29-release-1.5.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.5.1 4 | --- 5 | 6 | This is a bugfix release. It contains some important bug fixes, so everybody is 7 | encouraged to update. 8 | 9 | Here are the changes: 10 | 11 | * When importing a planet file or a huge extract, something with more than 12 | about 1 billion nodes, the new RAM node location store could overflow a 13 | 32bit "offset" value which meant that the node locations would not be found 14 | again. The result were missing features, because osm2pgsql just ignores 15 | features with geometries that can not be built due to missing node 16 | locations. 17 | * Osm2pgsql creates temporary tables as `UNLOGGED` to get better performance. 18 | We fixed a bug where non-temporary output tables were also created as 19 | `UNLOGGED` (when clustering was disabled.) 20 | * In the flex output table columns marked `create_only` are now only created 21 | in final tables, not temporary tables. This avoids some problems, for 22 | instance when using columnn type `SERIAL`. 23 | * Make the input data check more strict: Two versions of same object are not 24 | allowed in the input. 25 | * Remove `IMMUTABLE` volatility classification from validity check trigger 26 | function. 27 | * Make the directory where the config file is available in the flex output 28 | through the `osm2pgsql.config_dir` global Lua variable. 29 | * Update required libosmium version to 2.17.0. The version 1.5.0 already 30 | required this, but it wasn't documented. 31 | 32 | -------------------------------------------------------------------------------- /_posts/2021-09-30-past-and-upcoming-conference-talks.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Past and upcoming conference talks 4 | --- 5 | 6 | The talks by Jochen Topf on osm2pgsql from [FOSSGIS 7 | 2021](https://www.youtube.com/watch?v=XKoNMdtLTbQ) (in German) and [SotM 8 | 2021](https://www.youtube.com/watch?v=20n4thI7YiI) (in English) are now 9 | available online. 10 | 11 | And next week [Ryan Lambert](https://www.rustprooflabs.com/) is giving a 12 | [talk on how to prepare OSM data for routing in PostgreSQL using 13 | osm2pgsql](https://postgresconf.org/conferences/SouthAfrica2021/program/proposals/routing-with-postgis-and-openstreetmap) 14 | at the [Online/South Africa Postgres 15 | Conference](https://postgresconf.org/conferences/SouthAfrica2021). 16 | 17 | More links to talks about osm2pgsql are on our [community documentation 18 | page](https://osm2pgsql.org/doc/community.html). 19 | 20 | -------------------------------------------------------------------------------- /_posts/2022-01-11-release-1.5.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.5.2 4 | --- 5 | 6 | This is a bugfix release with only minor changes. 7 | 8 | Changes: 9 | 10 | * Fix parsing problems in style file reader. Some variables were not 11 | initialized correctly when parsing a style file, which lead to some 12 | surprising behaviour with flags of one config line re-used by the next if the 13 | flags field of that line was empty. This could also have lead to buffer 14 | overflows in the first line being parsed. 15 | * Fix: When there is an active progress display, log messages would show up 16 | after the progress display instead of the next line. 17 | * Release some allocated memory earlier in the processing chain. 18 | * Fix confusing log message: The message "Done postprocessing on table '{}' in 19 | {}" was logged twice when `--drop` is used. This changes one of the log 20 | messages to the more specific "Table '{}' dropped in {}". 21 | * Run ANALYZE on middle tables only in create mode saving some processing time. 22 | * Add 'status' command to `osm2pgsql-replication`. Prints the current 23 | replication status, and with `--json` prints that as JSON data. (thanks 24 | @amandasaurus) 25 | * Needs at least CMake 3.5.0 now. 26 | * Updates the included versions of the catch2, fmt, libosmium, and protozero 27 | libraries to current versions. 28 | 29 | Note that this is the last version which will compile with C++14. The next 30 | version 1.6.0 will need C++17. 31 | -------------------------------------------------------------------------------- /_posts/2022-01-24-release-1.6.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.6.0 4 | --- 5 | 6 | This is a bugfix release with only minor changes. 7 | 8 | Changes: 9 | 10 | * The osm2pgsql-replication script which has been included in the osm2pgsql repository for a while will now be installed together with its man page on "make install". To use it you need Python3, psycopg2 (or psycopg3), and PyOsmium installed. See [the manual](https://osm2pgsql.org/doc/manual.html#keeping-the-database-up-to-date-with-osm2pgsql-replication) for details. 11 | * Ignore relations with more than 32.000 members (which should never happen in real data) instead of failing. 12 | * Removed the dependency on boost::algorithm. 13 | * Included libosmium was updated to newest version 2.17.3 which contains an important fix for a problem which can lead to osm2pgsql locking up. 14 | 15 | Note that this is the last version which will compile with C++14. The next version 1.7.0 will need C++17. (We have postponed the switch to C++17, because we wanted to get these bug fixes out early.) 16 | -------------------------------------------------------------------------------- /_posts/2022-08-15-release-1.7.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.7.0 4 | --- 5 | 6 | We are happy to announce the new release 1.7.0 with some great changes. 7 | 8 | This is the first version of osm2pgsql that needs a C++17 compiler. And there 9 | is a new dependency on the boost::geometry library. 10 | 11 | For this version we rebuilt a lot of the code around geometry processing and 12 | around expire. The different parts -- creation of geometries from OSM data, 13 | transforming geometries (like merging and splitting linestrings) and finally 14 | writing them out in WKB format for import into the database -- are now well 15 | separated and tested on their own. And we added some functions for geometry 16 | processing, too. osm2pgsql can now calculate the centroid of a polygon and 17 | simplify linestrings using the Douglas-Peucker algorithm. 18 | 19 | But the best part is that all of that new geometry goodness is now available 20 | from the Lua config files when using the flex output. There are many new ways 21 | of processing geometries from Lua: 22 | 23 | * The `get_bbox()` is now available for relations, too. 24 | * There are new functions `as_point()`, `as_linestring()`, `as_polygon()`, 25 | `as_multilinestring()`, `as_multipolygon()`, and `as_geometrycollection()` 26 | to create geometries from OSM objects. 27 | * Geometries can be manipulated in Lua with several functions modeled after 28 | the same functions in PostGIS: `area()`, `centroid()`, `geometry_type()`, 29 | `line_merge()`, `num_geometries()`, `segmentize()`, `simplify()`, `srid()`, 30 | and `transform()`. We expect more to come in the future. This way you can do 31 | more geometry processing on import removing the need for some post-processing 32 | in SQL. 33 | * We used to have the somewhat magic handling of geometries with the `add_row()` 34 | function which only allowed a limited set of operations. This function is 35 | still available for backwards compatibility, but there is a new function 36 | `insert()` now which doesn't have this magic. Instead geometries are treated 37 | like any other data type giving you a lot more flexiblity. Check out the 38 | example config files `addresses.lua`, `generic.lua`, `simple.lua` and 39 | `geometries-using-insert.lua` in the `flex-config` directory for some ideas 40 | on what can be done. 41 | 42 | In this version we enabled the bucket index for way nodes by default. This had 43 | been around for a while but you needed a command line option to enable it. 44 | After some positive feedback from the community we decided to make this the new 45 | default. It will be used on new imports (existing databases will keep using the 46 | old index). The new bucket index is much smaller and can save you hundreds of 47 | gigabytes of disk space. See [the 48 | manual](https://osm2pgsql.org/doc/manual.html#bucket-index-for-slim-mode) for 49 | the details. 50 | 51 | And again a lot of code cleanups and some smaller bug fixes went into this 52 | release. To make writing tests easier we added a new BDD testing framework 53 | based on [behave](https://behave.readthedocs.io/) and re-wrote a lot of the 54 | existing tests. Writing tests is now much easier and a lot less tedious. 55 | 56 | There are also a bunch of changes to the osm2pgsql-replication script to make 57 | it easier to use. 58 | 59 | -------------------------------------------------------------------------------- /_posts/2022-08-30-new-test-server.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: New test server 4 | --- 5 | 6 | Any software needs a lot of testing and osm2pgsql is no different. For 7 | development we have automated unit, integration and regression tests, but they 8 | only run on tiny amounts of data. To figure out where performance bottlenecks 9 | are, how different configurations of osm2pgsql or the PostgreSQL database 10 | affect performance, or wether a planet import still works after some major 11 | changes, we need something else. 12 | 13 | Thanks to [FOSSGIS e.V.](https://www.fossgis.de/), the German OSM chapter, we 14 | have a new machine for development and testing now. With an AMD Ryzen 9 3900 15 | 12-Core Processor, 128 GByte RAM, and two 1.9 TByte NVME SSDs the machine is 16 | easily capable enough to run a planet database. This will allow us to do lots 17 | more, larger, and longer running tests in the future. It will also help with 18 | giving users better advice in the manual how to set up their system for 19 | specific use cases. Thank you, FOSSGIS! 20 | 21 | -------------------------------------------------------------------------------- /_posts/2022-09-06-generalization-project-started.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Generalization project started 4 | --- 5 | 6 | OpenStreetMap has quite a lot of very detailed geodata. That's great for 7 | generating very detailed maps. But it is sometimes not so easy to create 8 | overview maps in smaller map scales and for smaller zoom levels. We can't 9 | see the forest for all the trees. 10 | 11 | To solve this a cartographer uses a bunch of techniques, collectively called 12 | *generalization*: You leave out some details, merge several smaller things 13 | into a bigger one, or smooth lines that seem overly wiggely when viewed 14 | from afar. There are many more of these techniques. 15 | 16 | When generating maps automatically based on osm2pgsql we usually use SQL 17 | queries after importing the data, either in some steps after import, or when 18 | using the data, for instance when rendering tiles. This is not simple to do and 19 | often slow because of the complex processing involved. And if you want to 20 | update your database with changes from OSM you have to figure out how to only 21 | update what's needed. 22 | 23 | With all these problems, osm2pgsql could lend a helping hand. This is what the 24 | [generalization project](https://osm2pgsql.org/generalization/) is all about. 25 | We want to implement some of that functionality in osm2pgsql and also make it 26 | easier to access the functionality that the PostgreSQL/PostGIS database already 27 | has through osm2pgsql. 28 | 29 | Thanks to the Prototype Fund and the German Federal Ministry of Education and 30 | Research we got a [research 31 | grant](https://prototypefund.de/project/generalisierung-von-openstreetmap-daten-mit-osm2pgsql/) 32 | to work on this project for half a year starting from now, September 2022. See 33 | [this issue](https://github.com/osm2pgsql-dev/osm2pgsql/issues/1663) for some 34 | of the details we'll be working on. 35 | 36 | -------------------------------------------------------------------------------- /_posts/2022-09-13-security-audit.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Security audit for osm2pgsql 4 | --- 5 | 6 | In the last couple of months the source code of osm2pgsql has gone through 7 | a security audit. This was part of the [NGI Zero prject](https://nlnet.nl/project/Nominatim/) 8 | for Nominatim which uses osm2pgsql for its data import. The audit was done 9 | by the friendly people from 10 | [RadicallyOpenSecurity](https://www.radicallyopensecurity.com/) (ROS). 11 | 12 | Why do we need a security audit? 13 | osm2pgsql processes arbitrary OSM data files, which may come from potentially 14 | untrusted sources. This makes osm2pgsql a potential attack vector for someone 15 | who wants 16 | to take control of a machine through manipulated data files. ROS tested 17 | the importer code through [fuzzing](https://en.wikipedia.org/wiki/Fuzzing) of the import formats `xml`, `pbf` and `o5m`. 18 | In addition they ran a static code analysis to check for common issues and reviewed 19 | our documentation. 20 | 21 | The good news is that none of the tests revealed any severe security issues. 22 | The fuzz testing was not able to crash osm2pgsql. While it does not mean 23 | that the import code is bug free, an attack through manipulated data files 24 | is less likely. 25 | 26 | The static code check revealed two places in the code where it was possible 27 | to inject bad SQL code through command-line parameters. These cases are 28 | already fixed on the master branch 29 | ([#1753](https://github.com/osm2pgsql-dev/osm2pgsql/pull/1753), 30 | [#1758](https://github.com/osm2pgsql-dev/osm2pgsql/pull/1758)). 31 | The security risk for these issues is relatively low because an attacker 32 | would still need access to the command line and credentials to the database to make use of them. 33 | 34 | The largest security risk for `osm2pgsql` is not so much the code itself 35 | but the fact that the tool relies on a properly set-up system environment. 36 | To run osm2pgsql in a secure manner it is vital that it runs with minimal 37 | access to the rest of the system and that PostgreSQL is set up properly. 38 | We have amended the manual further to remind you 39 | of the most important security practises, among them 40 | 41 | * Set up secure authentication for PostgreSQL. Most installations have 42 | sane defaults but you should recheck the settings. 43 | * Handle passwords to the database responsibly. Passwords on the command 44 | line are not secure. Use `pgpass` files instead. 45 | * Give minimal rights to all files used by osm2pgsql: binaries, Lua scripts, 46 | config files. 47 | * Only run Lua scripts from trusted sources. 48 | 49 | As part of the project, ROS has taught us about the fuzzing techniques they 50 | used. That means that regular fuzzing runs will now be part of our testing 51 | strategy next to the growing set of unit and integration tests. For this our 52 | new [test server]({% link _posts/2022-08-30-new-test-server.md %}) has come 53 | in handy which now runs fuzzying tests when not needed otherwise. 54 | -------------------------------------------------------------------------------- /_posts/2022-09-22-developer-interview.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Developer interview 4 | --- 5 | 6 | Our sponsor [Thunderforest](https://www.thunderforest.com/) published [a small 7 | interview](https://www.thunderforest.com/blog/osm2pgsql-sponsorship/) with 8 | osm2pgsql developer [Jochen Topf](https://www.jochentopf.com/). 9 | 10 | -------------------------------------------------------------------------------- /_posts/2022-10-04-book-release.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Book release 4 | --- 5 | 6 | [Ryan Lambert](https://blog.rustprooflabs.com/) just 7 | [announced](https://blog.rustprooflabs.com/2022/10/announce-mastering-postgis-openstreetmap) 8 | the release of his book [Mastering PostGIS and 9 | OpenStreetMap](https://postgis-osm.com/). It explains how to bring 10 | OpenStreetMap data into a PostgreSQL/PostGIS database (using osm2pgsql of 11 | course), cleaning it up in the process, and teaches you the ins and outs of 12 | data processing with PostGIS. Use the code "RPL-FRIENDS" for a 10% discount. 13 | 14 | -------------------------------------------------------------------------------- /_posts/2022-10-05-release-1.7.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.7.1 4 | --- 5 | 6 | The new [release 1.7.1](https://osm2pgsql.org/releases) fixes a few small bugs in osm2pgsql and closes some gaps in the geometry processing code released in 1.7.0. It also contains some security-related fixes as a result of the [security audit](https://osm2pgsql.org/news/2022/09/13/security-audit.html). 7 | 8 | * Added `as_multipoint()` function to complement `as_multilinestring()` and `as_multipolygon()`. 9 | * The functions `as_multipoint()`, `as_multilinestring()`, and `as_multipolygon()` will now always return single geometries if possible. Single geometries are always allowed where multi geometries are allowed, so this does't break anything. 10 | * The `centroid()` function now works for all geometry types. 11 | * New `length()` function to compute the length of a geometry in map units. 12 | * New `reverse()` function to turn geometries around (can be useful for ways tagged with `oneway=-1`). 13 | * The `simplify()` function is now available for multilinestrings, too. (Not for polygons yet.) 14 | * All example code in the `flex-config` directory has been updated for the new geometry handling capabilities. 15 | * Create nicer error messages when trying to access a missing database extension, schema, or tablespace. 16 | * Better checking of names (of tables, schemas, etc.) used in SQL in osm2pgsql and osm2pgsql-replication to avoid potentional SQL injection issues. 17 | * Fix: Make sure relation members show up in the correct order in multi-geometries when using slim mode. 18 | * Fix: Do not try to run `ST_IsValid()` on `create_only` columns. 19 | * osm2pgsql-replication: The database parameter may be empty when connection parameters are supplied via environment variables. 20 | * osm2pgsql-replication: when installed, now runs the osm2pgsql binary that was installed with it to avoid potential security issues through PATH manipulation. 21 | * osm2pgsql-replication: Meaningful error when middle tables do not exist or the prefix is a bad one. 22 | 23 | -------------------------------------------------------------------------------- /_posts/2022-10-23-timings-and-sizes.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Timings and sizes 4 | --- 5 | 6 | When starting out with osm2pgsql there is often the question: How large is 7 | the resulting database going to be and how long will the import take? 8 | 9 | The invariable answer is, of course, "it depends". But that's not very useful. 10 | Using the [new server sponsored by 11 | FOSSGIS](https://osm2pgsql.org/news/2022/08/30/new-test-server.html) we ran 12 | lots of imports with different configurations and different input data from the 13 | Switzerland extract to the full planet and wrote down the results in a new 14 | ["Sizing" appendix in the manual](https://osm2pgsql.org/doc/manual.html#sizing). 15 | This will give you at least some idea on what to expect. 16 | 17 | -------------------------------------------------------------------------------- /_posts/2022-11-10-release-1.7.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.7.2 4 | --- 5 | 6 | The new [release 1.7.2](https://osm2pgsql.org/releases) has some small changes only: 7 | 8 | * The flex output now allows tables with only the id column (or columns). 9 | * The `osm2pgsql-replication` script now always expects the `osm2pgsql` binary to be in same path as itself. 10 | * Adds the flag `--middle-schema=SCHEMA` to the `osm2pgsql-replication` script which allows placing the replication status table in a schema other than PUBLIC (Thanks to @JakobMiksch). 11 | * More tests have been converted to the new BDD format. 12 | * Various code cleanups and refactorings especially in the expire code. 13 | 14 | -------------------------------------------------------------------------------- /_posts/2023-01-22-faster-with-postgresql15.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Faster imports with PostgreSQL 15 4 | --- 5 | 6 | Osm2pgsql recently became a lot faster... And we didn't have to do anything for 7 | it! 8 | 9 | It has been a few months since PostgreSQL 15 [was 10 | released](https://www.postgresql.org/about/news/postgresql-15-released-2526/), 11 | but we only recently got around to doing some benchmarks with it. Among many 12 | other changes it includes improvements to the way GIST indexes are built that 13 | make this process much faster. Building these indexes has always been one of 14 | the most time consuming parts of importing data with osm2pgsql, so these 15 | changes are very welcome. Build time for some indexes has dropped by more than 16 | half! That means that overall osm2pgsql import times can see about 20% 17 | improvements, for a full planet import that can be nearly two hours saved! 18 | 19 | Note that you will only see that kind of improvements on non-slim imports, 20 | because in slim imports building the way nodes index is the bottleneck and that 21 | hasn't become faster. 22 | 23 | If you want to know more about those index changes, watch the talk [GiST Index 24 | Building in PostgreSQL 15](https://www.youtube.com/watch?v=TG28lRoailE) that 25 | goes through all the details and also mentions what motivated those changes: 26 | It was the osm2pgsql imports the speaker has been doing regularly at their 27 | company. Thanks Aliaksandr Kalenik and Kontur for your work! 28 | 29 | So if you haven't updated yet, we recommend you do. (But be aware of some 30 | [changes around schemas and 31 | permissions](https://www.crunchydata.com/blog/be-ready-public-schema-changes-in-postgres-15) 32 | which might affect the way you interact with the database.) 33 | 34 | -------------------------------------------------------------------------------- /_posts/2023-01-28-release-1.8.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.8.0 4 | --- 5 | 6 | We are happy to announce the new [release 7 | 1.8.0](https://github.com/osm2pgsql-dev/osm2pgsql/releases/tag/1.8.0) of 8 | osm2pgsql. 9 | 10 | The largest change is the addition of much more flexible index support in the 11 | flex output. The table definitions have a new (optional) field called `indexes` 12 | now which takes a list of index definitions. If the field is not there, we fall 13 | back to what we did before and create a GIST index on the only/first geometry 14 | column of a table. But you can also define any kind of index you want: define 15 | which index method (BTREE, GIST, ...) to use on which columns, define `WHERE` 16 | clauses and expression indexes and much more. See the `flex-config/indexes.lua` 17 | Lua config for some usage examples and the manual for all the details. You can 18 | also force osm2pgsql to always build the id indexes which are normally only 19 | built in slim mode. 20 | 21 | The gazetteer output and the command line option `--with-forward-dependencies` 22 | are deprecated in this release and will be removed soon. They were only needed 23 | for Nominatim which switched to using the flex output recently. 24 | 25 | Here are the other changes: 26 | 27 | * Fix a problem when using osm2pgsql with a projection other than WGS84 28 | (EPSG:4326) or Web Mercator (EPSG:3857) which made the program really slow. 29 | * New `pole_of_inaccessibility()` Lua function to generate reasonably good 30 | label points from polygons. (This function is currently marked as 31 | experimental, which means it can change without notice at any time.) 32 | * Performance improvement for very small updates. Don't spin up multiple 33 | threads when there are less then 100 objects to process, because the extra 34 | overhead is not worth it. 35 | * Implement and use our own JSON writer. This removes the dependency on 36 | RapidJSON which hasn't seen a new release since 2016. 37 | * Add more checks (or does some checks earlier) to make sure your database uses 38 | UTF-8 encoding and that necessary database extensions are loaded and index 39 | methods, schemas and tablespaces you refer to in the config are actually 40 | available. 41 | * A lot of code needed to be updated so it works correctly with any of the 42 | recent versions of the fmt library. 43 | 44 | As always there were lots of code cleanups across the board, but especially in 45 | code accessing the database and in the C++/Lua glue code to make it more 46 | flexible and easier to use internally. 47 | 48 | -------------------------------------------------------------------------------- /_posts/2023-02-13-release-1.8.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.8.1 4 | --- 5 | 6 | This release contains some fixes and minor changes. 7 | 8 | * Fix `osm2pgsql-replication` script so it works correctly with PostgreSQL schemas. 9 | * Don't process objects without tags in outputs in append mode. This should speed up updates a little bit. 10 | * Count number of inserted rows and rows not inserted because of NOT NULL constraints for each table and log the numbers in debug mode. 11 | * Remove some extra-verbose debug logging when using the `pole_of_inaccessibility()` function. 12 | * Flush output tables generated from nodes and ways tables earlier. 13 | 14 | -------------------------------------------------------------------------------- /_posts/2023-07-25-middle-improvements.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Middle improvements 4 | --- 5 | 6 | In osm2pgsql there is that code that stores the raw data it gets from the input 7 | files and makes it available to other parts of osm2pgsql for further 8 | processing. This code is called, in osm2pgsql-speak, the "middle". Over the 9 | last months we worked on some huge improvements to that code which not only 10 | makes it much faster but also adds some functionality and will allow even more 11 | processing options down the line. You can read about all the details of this 12 | project in [this blog post by Jochen Topf](https://blog.jochentopf.com/2023-07-25-improving-the-middle-of-osm2pgsql.html). 13 | 14 | -------------------------------------------------------------------------------- /_posts/2023-08-18-where-we-are-going.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Where We are Going 4 | --- 5 | 6 | Development of an Open Source project is often driven by the current need for 7 | some features. But we also have frequent discussions about the long-term 8 | development of the project. Where do we need or want to go? How do all the 9 | different features fit together to make a coherent whole? What feature can we 10 | work on now that makes sense on its own but can also later be a part of 11 | something bigger? 12 | 13 | To help with this big-picture view we maintain a kind of [road 14 | map](https://osm2pgsql.org/contribute/road-map.html). It is by no means 15 | complete, and always changing, but it gives you some idea on where we are and 16 | where we want to go. 17 | 18 | For even more "out there" ideas we just added a new [project ideas 19 | list](https://osm2pgsql.org/contribute/project-ideas.html). These are the ideas 20 | we want to work on eventually, but that are too large to do in a few hours here 21 | or there. Maybe you want to help working on one of these? Or help with funding 22 | the development? 23 | 24 | -------------------------------------------------------------------------------- /_posts/2023-08-22-release-1.9.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.9.1 4 | --- 5 | 6 | This [release](https://github.com/osm2pgsql-dev/osm2pgsql/releases/tag/1.9.1) 7 | fixes some small issues with 1.9.0: 8 | 9 | * Fix compatibility of osm2pgsql-replication with psycopg3 10 | * Fix architecture-dependent double to integer conversion 11 | * Some small code cleanups 12 | 13 | -------------------------------------------------------------------------------- /_posts/2023-09-04-release-1.9.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.9.2 4 | --- 5 | 6 | This [release](https://github.com/osm2pgsql-dev/osm2pgsql/releases/tag/1.9.2) 7 | fixes a bug introduced in 1.9.0 with two-stage processing that will lead to 8 | crashes. If you are using any 1.9.x version, please upgrade to 1.9.2. 9 | 10 | In one case we had some performance problems updating an osm2pgsql database 11 | with 1.9.1 due to the PostgreSQL query planning choosing a bad plan. This 12 | release contains a workaround for that problem. 13 | 14 | We also improved the (experimental) generalizer code a bit: 15 | 16 | * More information is shown in log level 'info', including some timing 17 | information. 18 | * The Lua config `run_sql()` command now can have either a single SQL statement 19 | in the `sql` field (as before) or a list of SQL commands. 20 | * For convenience, the Lua config `run_sql()` command now has an optional 21 | `transaction` field which can be set to `true` to wrap the SQL commands in 22 | BEGIN/COMMIT. 23 | * The new `if_has_rows` fields on the `run_sql()` command can be set to string 24 | with an SQL query. If that field is set, the SQL statement(s) in the `sql` 25 | field is only run, if the SQL query returns at least one row. 26 | * Some performance improvements in low-level code in the generalizer. 27 | 28 | -------------------------------------------------------------------------------- /_posts/2023-09-11-announcing-themepark.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Announcing Themepark 4 | --- 5 | 6 | Writing a config file for osm2pgsql from scratch is not easy. And it shouldn't 7 | be something that everybody has to do. Most maps want to do *some* things 8 | different than other maps, but *most* things are probably the same as on many 9 | other maps. [Themepark](https://osm2pgsql.org/themepark) is a framework for 10 | creating osm2pgsql configuration by reusing existing building blocks. You can 11 | mix existing configurations with your special layers. And it all works 12 | together. 13 | 14 | Today we are releasing a beta version of Themepark. It is still somewhat rough 15 | around the edges, but you can play with it and together we'll make it better. 16 | It comes with various more or less experimental themes to get you some ideas. 17 | 18 | It also comes with the configuration to generate vector tiles using the 19 | [Shortbread schema](https://shortbread-tiles.org/). There are two versions, one 20 | without generalization which is really only usable on high zoom levels (12 and 21 | above or so) and one using the new experimental generalization support in 22 | osm2pgsql which can be used as basis for complete vector tile set on all zoom 23 | levels. 24 | 25 | We thank [Sourcepole](https://sourcepole.ch/) for funding part of the work on 26 | the Shortbread configuration. 27 | 28 | You'll find more details at on the [Themepark page on 29 | osm2pgsql.org](https://osm2pgsql.org/themepark), the code is [on 30 | Github](https://github.com/osm2pgsql-dev/osm2pgsql-themepark). 31 | 32 | -------------------------------------------------------------------------------- /_posts/2023-09-20-new-github-organisation.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: New Github Organisation 4 | --- 5 | 6 | Today we switched all osm2pgsql repositories from the "openstreetmap" 7 | organization on Github to a new Github organization called 8 | [osm2pgsql-dev](https://github.com/osm2pgsql-dev/). We want to make it is 9 | easier for our users to find all the pieces in our growing osm2pgsql ecosystem. 10 | There is... 11 | 12 | * the [main osm2pgsql repository](https://github.com/osm2pgsql-dev/osm2pgsql) 13 | with the source code, 14 | * the [website repository](https://github.com/osm2pgsql-dev/osm2pgsql-website) 15 | which contains everything needed to maintain our website and documention, 16 | * and the recently released [Themepark 17 | repository](https://github.com/osm2pgsql-dev/osm2pgsql-themepark). 18 | 19 | All the old links will continue to work. If you access the old repository 20 | links, you will be forwarded to the new places automatically. 21 | 22 | -------------------------------------------------------------------------------- /_posts/2023-09-25-2nd-virtual-meetup.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Second Virtual Meetup on osm2pgsql 4 | --- 5 | 6 | In 2021 we, the osm2pgsql developers and users, had a first virtual meetup. 7 | And now we want to do it again. We want to talk a bit about new features 8 | and chat about where we might want to go. But mostly this is a chance for 9 | osm2pgsql users to get questions answered and their feedback heard. 10 | 11 | The meeting will take place [online](https://meet.topf.org/osm2pgsql) on 12 | October 10th, 2023 starting 18:00 UTC. Anybody can join, you don't need to 13 | register. See you there! 14 | 15 | -------------------------------------------------------------------------------- /_posts/2023-11-07-release-1.10.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.10.0 4 | --- 5 | 6 | This is a relatively small but still important [release](https://github.com/osm2pgsql-dev/osm2pgsql/releases/tag/1.10.0). 7 | 8 | The new middle table format has changed slightly: the `tags` field can now be `NULL`. This makes storage more efficient and indexing faster. The new middle format is now declared stable and production ready. To use it, use the command line option `--middle-database-format=new`, in a future version of osm2pgsql this will become the new default. If you have used this option already with one of the 1.9.x versions of osm2pgsql you have to reload your database or use this SQL command to update the table: `ALTER TABLE ALTER COLUMN tags DROP NOT NULL;`, for `` use `planet_osm_nodes`, `planet_osm_ways`, and `planet_osm_rels` or the equivalents if you are using a different table name prefix. 9 | 10 | Other changes: 11 | 12 | * Emit a warning that the flex output `area` type and the `add_row()` functions are deprecated if you use them. If you get this warning, read https://osm2pgsql.org/doc/tutorials/switching-from-add-row-to-insert/ . 13 | * Add first/last timestamps to expire tables. Having these timestamps allows various expire/updating strategies. 14 | * The `docs` directory is now called `man`, because it only contains the man pages. All other docs are on the project web site. 15 | * Various improvements on the (still experimental) generalization code. The biggest change is that we switch from using the CImg to the OpenCV library which makes the code an order of magnitude faster. 16 | 17 | -------------------------------------------------------------------------------- /_posts/2023-12-10-sotm-eu-talk.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: SOTM-EU talk available 4 | --- 5 | 6 | Paul Norman and Jochen Topf gave a talk "Modern osm2pgsql tricks" at the recent State of the Map Europe (SOTM-EU) conference in Antwerp. It gives an overview about what modern osm2pgsql is all about. 7 | 8 | The talk is now available on [YouTube](https://www.youtube.com/watch?v=wAk_sLOXTT8). 9 | 10 | -------------------------------------------------------------------------------- /_posts/2024-02-12-release-1.11.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 1.11.0 4 | --- 5 | 6 | We are proud to announce version 1.11.0 of osm2pgsql. 7 | 8 | This release makes the [new middle database 9 | format](https://blog.jochentopf.com/2023-07-25-improving-the-middle-of-osm2pgsql.html) 10 | the default. If you have not switched already, you need to reimport your 11 | database to take advantage of that. 12 | 13 | We have changed the way we are parsing the command line options. The new code 14 | uses the [CLI11](https://github.com/CLIUtils/CLI11) library (a copy of which is 15 | included in the repository) and is much cleaner and also much stricter. You now 16 | get warnings (and sometimes errors) for many combinations of options that don't 17 | make sense. Please check the output from osm2pgsql and osm2pgsql-replication 18 | for such messages and fix your command lines accordingly. Note especially that 19 | duplicated options are not allowed any more. This can happen, for instance, 20 | when using osm2pgsql-replication which adds the database connection parameters 21 | (such as `-d`) when it calls osm2pgsql. 22 | 23 | If all goes well this will be the last release starting with a 1. We are 24 | planning for a version 2.0.0 in the second quarter of 2024. In that release we 25 | will remove all the functionality that has been deprecated. We will also remove 26 | support for the legacy database middle format and only support the new format 27 | introduced in version 1.9.0. 28 | 29 | Further changes: 30 | * The number of database connections that osm2pgsql was opening could be quite 31 | large as it was depending on the number of tables. This is no longer the case. 32 | Osm2pgsql is opening far fewer connections now, usually you will not need to 33 | change the PostgreSQL `max_connections` settings any more. 34 | * Osm2pgsql now adds the context (the part of osm2pgsql responsible for a 35 | database connection) and the connection number to the application name 36 | used in the database connection. This allows you to better monitor what 37 | osm2pgsql is doing using the `pg_stat_activity` table in the database. 38 | * Bugfix: Using the new database format with `-x, --extra-attributes` did not 39 | work due to a wrong SQL command. This is fixed now. 40 | 41 | Many thanks to [Thunderforest](https://www.thunderforest.com/) who 42 | supported development of the features in this release. 43 | 44 | -------------------------------------------------------------------------------- /_posts/2024-04-01-osm2pgsql-goes-ai.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Osm2pgsql goes AI 4 | --- 5 | 6 | Looks like Artificial Intelligence (AI) is going to solve all the worlds 7 | problems. And we here at osm2pgsql headquarters certainly don't want to be left 8 | out. Also all the research funding these days goes towards AI and we certainly 9 | don't wan to be left out of that. 10 | 11 | 12 | 13 | So at the last [hack weekend in 14 | Karlsruhe](https://wiki.openstreetmap.org/wiki/Karlsruhe_Hack_Weekend_February_2024) 15 | we asked the younger generation who knows about this AI stuff to help us out 16 | with making osm2pgsql fit for the future. 17 | 18 | Isaac Boates stepped up and talked ChatGPT into working for us. As a promising 19 | first step, the AI helped us solve the biggest problem osm2pgsql had: We didn't 20 | have a logo. The AI came up with [a few logo 21 | ideas](https://github.com/osm2pgsql-dev/osm2pgsql-website/issues/59) for 22 | osm2pgsql. The AI was a bit obsessive about the paintbrush it absolutely wanted 23 | to include in the image, but nothing a bit of fiddling with Gimp couldn't 24 | solve. So now we finally have an official logo for osm2pgsql! This AI 25 | stuff is really neat! 26 | 27 | We are looking forward to all the other great achievements AI has in store for 28 | us! 29 | 30 | -------------------------------------------------------------------------------- /_posts/2024-11-21-crunchydata-is-loading-the-world.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Crunchydata is Loading the World 4 | --- 5 | 6 | A few days ago [Crunchy Data](https://www.crunchydata.com/) published a blog 7 | post [Loading the World! OpenStreetMap Import In Under 4 8 | Hours](https://www.crunchydata.com/blog/loading-the-world-openstreetmap-import-in-under-4-hours) 9 | showing how improvements in PostgreSQL, osm2pgsql, and the hardware in recent 10 | years have improved the performance of loading the OSM planet into a database 11 | significantly leading to an import time for the planet of less than 4 hours. 12 | 13 | They are using some configuration options that are probably not great for 14 | general use, but if you know what you are doing they can give you that extra 15 | edge. 16 | 17 | -------------------------------------------------------------------------------- /_posts/2024-12-02-release-2.0.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 2.0.1 4 | --- 5 | 6 | This release fixes some small issues with 2.0.0: 7 | 8 | * fix forwarding of `--schema` parameter from osm2pgsql-replication to osm2pgsql 9 | * install `osm2pgsql_find_changed_ways` function in the right schema (thanks @falko17) 10 | * install osm2pgsql-gen binary by default 11 | 12 | -------------------------------------------------------------------------------- /_posts/2025-02-06-sovereign-tech-fellowship.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Sovereign Tech Fellowship for osm2pgsql 4 | --- 5 | 6 | We are happy to announce that osm2pgsql maintainer Sarah has been selected as 7 | one of the fellows for the one-year pilot of the 8 | [Sovereign Tech Fellowship programme](https://www.sovereign.tech/news/meet-the-sovereign-tech-fellows) 9 | of the Sovereign Tech Agency. The programme recognises and financially supports 10 | the significant amount of time that goes into the daily maintenance of an 11 | open-source project. Read more about the fellowship in 12 | [Sarah's post over at nominatim.org](https://nominatim.org/2025/02/06/sovereign-tech-fellowship.html). 13 | -------------------------------------------------------------------------------- /_posts/2025-04-07-release-2.1.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 2.1.0 4 | --- 5 | 6 | Today we released version 2.1.0, a bugfix and maintenance release. The main 7 | visible change is that osm2pgsql now works better together with connection 8 | poolers and similar database middleware: prepared statements now use protocol 9 | level prepare instead of `PREPARE` SQL commands and there is a new option to 10 | explicitly create a primary key on flex tables. 11 | 12 | Other fixes and features: 13 | 14 | * check flat node file format for forwards compatibility to prepare for future changes of the flatnode file format 15 | * fix two-stage processing when flat node file is used 16 | * fix getting node locations in slim node with two-stage processing 17 | * updated included libosmium, protozero and fmt libraries 18 | 19 | -------------------------------------------------------------------------------- /_posts/2025-04-14-release-2.1.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: Release 2.1.1 4 | --- 5 | 6 | This is a bug fix release which contains the following: 7 | 8 | * refuse to update database when the flatnode is missing 9 | * fix regression where writing to tables without a managed id column was not possible 10 | 11 | -------------------------------------------------------------------------------- /_releases/1.0.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.0.0 3 | version: 1.0.0 4 | date: 2019-08-29 5 | manpage: false 6 | highlights: 7 | - Drop support for old-style multipolygons 8 | - Use COPY for improved performance 9 | --- 10 | 11 | This release finally drops support for old-style multipolygons. 12 | 13 | Doing so allowed a major overhaul of the processing pipeline. 14 | Imports are now entirely done in the first processing stage. The second, 15 | much slower processing stage is only needed when updating existing 16 | databases. Data is entirely streamed into the database using COPY, which 17 | reduces the number of database connections needed. 18 | 19 | Other major changes include 20 | 21 | - better error handling in Lua backend 22 | - process all OSM objects again when extra attributes are requested 23 | - enable running tests in pg_virtualenv 24 | - add support for configurable Gazetteer style 25 | - allow to disable RAM node cache with -C 0 26 | 27 | -------------------------------------------------------------------------------- /_releases/1.10.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.10.0 3 | version: 1.10.0 4 | date: 2023-11-07 5 | manpages: 6 | - osm2pgsql 7 | - osm2pgsql-replication 8 | highlights: 9 | - Much faster generalization 10 | --- 11 | 12 | This is a relatively small but still important release. 13 | 14 | The new middle table format has changed slightly: the `tags` field 15 | can now be `NULL`. This makes storage more efficient and indexing 16 | faster. The new middle format is now declared stable and production 17 | ready. To use it, use the command line option 18 | `--middle-database-format=new`, in a future version of osm2pgsql 19 | this will become the new default. If you have used this option 20 | already with one of the 1.9.x versions of osm2pgsql you have to 21 | reload your database or use this SQL command to update the table: 22 | `ALTER TABLE ALTER COLUMN tags DROP NOT NULL;`, 23 | for `` use `planet_osm_nodes`, `planet_osm_ways`, 24 | and `planet_osm_rels` or the equivalents if you are using a 25 | different table name prefix. 26 | 27 | Other changes: 28 | 29 | * Emit a warning that the flex output `area` type and the `add_row()` 30 | functions are deprecated if you use them. If you get this warning, 31 | read https://osm2pgsql.org/doc/tutorials/switching-from-add-row-to-insert/ 32 | * Add first/last timestamps to expire tables. Having these timestamps 33 | allows various expire/updating strategies. 34 | * The `docs` directory is now called `man`, because it only contains 35 | the man pages. All other docs are on the project web site. 36 | * Various improvements on the (still experimental) generalization code. 37 | The biggest change is that we switch from using the CImg to the OpenCV 38 | library which makes the code an order of magnitude faster. 39 | 40 | -------------------------------------------------------------------------------- /_releases/1.11.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.11.0 3 | version: 1.11.0 4 | date: 2024-02-12 5 | manpages: 6 | - osm2pgsql 7 | - osm2pgsql-replication 8 | highlights: 9 | - New middle is default 10 | - New command line parser 11 | - Use fewer database connections 12 | --- 13 | 14 | This release makes the 15 | [new middle database format](https://blog.jochentopf.com/2023-07-25-improving-the-middle-of-osm2pgsql.html) 16 | the default. If you have not 17 | switched already, you need to reimport your database to take advantage of that. 18 | 19 | We have changed the way we are parsing the command line options. The new code 20 | uses the [CLI11](https://github.com/CLIUtils/CLI11) library (a copy of which 21 | is included in the repository) and is much cleaner and also much stricter. You 22 | now get warnings (and sometimes errors) for many combinations of options that 23 | don't make sense. Please check the output from osm2pgsql and 24 | osm2pgsql-replication for such messages and fix your command lines accordingly. 25 | Note especially that duplicated options are not allowed any more. This can 26 | happen, for instance, when using osm2pgsql-replication which adds the database 27 | connection parameters (such as `-d`) when it calls osm2pgsql. 28 | 29 | If all goes well this will be the last release starting with a 1. We are 30 | planning for a version 2.0.0 in the second quarter of 2024. In that release 31 | we will remove all the functionality that has been deprecated. We will also remove 32 | support for the legacy database middle format and only support the new format 33 | introduced in version 1.9.0. 34 | 35 | Further changes: 36 | * The number of database connections that osm2pgsql was opening could be quite 37 | large as it was depending on the number of tables. This is no longer the case. 38 | Osm2pgsql is opening far fewer connections now, usually you will not need to 39 | change the PostgreSQL `max_connections` settings any more. 40 | * Osm2pgsql now adds the context (the part of osm2pgsql responsible for a 41 | database connection) and the connection number to the application name 42 | used in the database connection. This allows you to better monitor what 43 | osm2pgsql is doing using the `pg_stat_activity` table in the database. 44 | * Bugfix: Using the new database format with `-x, --extra-attributes` did not 45 | work due to a wrong SQL command. This is fixed now. 46 | 47 | Many thanks to [Thunderforest](https://www.thunderforest.com/) who 48 | supported development of the features in this release. 49 | -------------------------------------------------------------------------------- /_releases/1.2.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.2.0 3 | version: 1.2.0 4 | date: 2019-10-21 5 | manpage: false 6 | highlights: 7 | - Fix out-of-memory issues in slim mode 8 | --- 9 | 10 | This is a bug fix release. 11 | 12 | Changes include 13 | 14 | - limit number of buffers queued for COPYing to PostgreSQL 15 | to avoid out-of-memory issues when importing data in slim 16 | mode without the flatnode option 17 | - reduce default number of threads to 4 to avoid running 18 | out of PostgreSQL connections 19 | - fix import failures when importing large values into 20 | int4 columns 21 | 22 | -------------------------------------------------------------------------------- /_releases/1.2.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.2.1 3 | version: 1.2.1 4 | date: 2019-11-29 5 | manpage: false 6 | highlights: 7 | - Update of bundled libosmium fixes memory bug with complex multipolygons 8 | --- 9 | 10 | This release only updates the bundled version of libosmium. 11 | The new version 2.15.4 fixes an issue with area building where 12 | complex relations would use many GB of memory. 13 | 14 | -------------------------------------------------------------------------------- /_releases/1.2.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.2.2 3 | version: 1.2.2 4 | date: 2020-06-28 5 | manpage: false 6 | highlights: 7 | - Update of bundled libosmium fixes bug with complex multipolygons 8 | --- 9 | 10 | This release only updates the bundled version of libosmium. 11 | The new version 2.15.6 fixes an issue where complicated 12 | multipolygons make osm2pgsql hang. 13 | 14 | -------------------------------------------------------------------------------- /_releases/1.4.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.4.1 3 | version: 1.4.1 4 | date: 2021-02-03 5 | manpages: 6 | - osm2pgsql 7 | highlights: 8 | - Small fixes and improvements only 9 | --- 10 | 11 | This is a minor release with some bug fixes and internal cleanups and changes, 12 | mostly in the "middle" code and geometry processing. 13 | 14 | We have released all example config files for the flex output into the Public 15 | Domain, so they can be used as widely as possible. 16 | 17 | Fixes: 18 | 19 | * Some MultiLineStrings were not assembled correctly from relations. This 20 | happened when a relation had exactly two member ways forming a closed ring 21 | with the two ways oriented against each other (#1394). 22 | * Long LineStrings can (optionally) be split by osm2pgsql into shorter 23 | segments. In some cases this would produce invalid LineStrings (aee1be1b). 24 | * Do not try to display ANSI color codes on Windows terminals which don't 25 | understand them (ab96aebc). 26 | 27 | Other changes: 28 | 29 | * When osm2pgsql is started without any arguments, it now shows the help text 30 | instead of an error. 31 | * Write PostGIS version to output when osm2pgsql starts up and show error 32 | message when a database without PostGIS extension is used (c7927e83, #1400). 33 | * Improved progress output and summary information when processing input files. 34 | * Add log entry with number of threads when thread pool is started (34cf9d8a). 35 | * Report overall memory usage at the end of running osm2pgsql. 36 | * Updated included library versions (fmt 7.1.3, libosmium 2.16.0, catch 2.13.4). 37 | 38 | -------------------------------------------------------------------------------- /_releases/1.4.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.4.2 3 | version: 1.4.2 4 | date: 2021-04-07 5 | manpages: 6 | - osm2pgsql 7 | highlights: 8 | - New osm2pgsql-replication script 9 | - Small fixes and improvements 10 | --- 11 | 12 | This is a minor bugfix release that fixes the following issues: 13 | 14 | * Translate empty strings into `NULL` instead of 0.0 for columns of type double. 15 | * Consistently quote table names to handle upper case table prefixes correctly. 16 | * Avoid querying geometries in stage 2 of the flex output when expiry is disabled. 17 | * Fix syntax error in index creation with schema enabled. 18 | 19 | The release also adds a new `osm2pgsql-replication` script to simplify the process of downloading and applying updates. It requires pyosmium and psycopg2. See #1411 for more information. 20 | 21 | -------------------------------------------------------------------------------- /_releases/1.5.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.5.0 3 | version: 1.5.0 4 | date: 2021-06-02 5 | manpages: 6 | - osm2pgsql 7 | highlights: 8 | - Flex output not experimental any more 9 | - Use much less memory in non-slim mode 10 | --- 11 | 12 | This release brings quite a lot of improvements. We removed the "experimental" 13 | label from the flex output which we introduced in version 1.3.0. There are some 14 | small changes you might have to make to your flex configurations, see the 15 | [Upgrading](https://osm2pgsql.org/doc/manual.html#upgrading) chapter of the 16 | manual for details. 17 | 18 | This release also contains a rewrite of the code used to temporarily store 19 | OSM data in memory while processing the data in non-slim mode, i.e. when you 20 | import data without `--slim`. It now uses much less memory. 21 | 22 | Other changes: 23 | 24 | * The multi output which was marked as deprecated in the last versions has now 25 | been removed. 26 | * This is the first release that needs a C++14 compiler. 27 | * New [`cluster` table 28 | option](https://osm2pgsql.org/doc/manual.html#advanced-table-definition) in 29 | the flex config file which allows you to disable clustering of the table data 30 | by geometry. 31 | * Do not try to create indexes for flex output tables without id. 32 | * Added flex config example (`attributes.lua`) showing how to access 33 | OSM object attributes (such as timestamp, user name, etc.) from Lua. 34 | * Added a warning if `--flat-nodes/-F` is used in non-slim mode. 35 | * Report cache memory usage when running with `--log-level=debug`. 36 | * Report thread number in all log lines when `--log-level=debug` is set. 37 | * Use trigger to check geometry validity on first import instead of only doing 38 | this when copying the data for clustering. In the flex output this validity 39 | check is not used any more for point geometries because they are always 40 | valid anyway. 41 | * The [RapidJSON](https://rapidjson.org) library is now used and included 42 | in the source. 43 | * Now needs [libosmium](https://osmcode.org/libosmium/) 2.17.0 which is 44 | included in the source. 45 | * Lots of internal cleanups and restructurings. 46 | 47 | -------------------------------------------------------------------------------- /_releases/1.5.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.5.1 3 | version: 1.5.1 4 | date: 2021-07-29 5 | manpages: 6 | - osm2pgsql 7 | highlights: 8 | - Fix bug causing data loss in large imports 9 | - Fix bug creating UNLOGGED tables 10 | --- 11 | 12 | This is a bugfix release. It contains some important bug fixes, 13 | so averybody is encouraged to update. 14 | 15 | Here are the changes: 16 | 17 | * When importing a planet file or a huge extract, something with 18 | more than about 1 billion nodes, the new RAM node location 19 | store could overflow a 32bit "offset" value which meant that 20 | the node locations would not be found again. The result were 21 | missing features, because osm2pgsql just ignores features with 22 | geometries that can not be built due to missing node locations. 23 | * Osm2pgsql creates temporary tables as `UNLOGGED` to get better 24 | performance. We fixed a bug where non-temporary output tables 25 | were also created as `UNLOGGED` (when clustering was disabled.) 26 | * In the flex output table columns marked `create_only` are now 27 | only created in final tables, not temporary tables. This avoids 28 | some problems, for instance when using columnn type `SERIAL`. 29 | * Make the input data check more strict: Two versions of same 30 | object are not allowed in the input. 31 | * Remove `IMMUTABLE` volatility classification from validity check 32 | trigger function. 33 | * Make the directory where the config file is available in the 34 | flex output through the `osm2pgsql.config_dir` global Lua variable. 35 | * Update required libosmium version to 2.17.0. The version 1.5.0 36 | already required this, but it wasn't documented. 37 | 38 | -------------------------------------------------------------------------------- /_releases/1.5.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.5.2 3 | version: 1.5.2 4 | date: 2022-01-11 5 | manpages: 6 | - osm2pgsql 7 | highlights: 8 | - Fix bug in style file reader 9 | --- 10 | 11 | This is a bugfix release with only minor changes. 12 | 13 | Changes: 14 | 15 | * Fix parsing problems in style file reader. Some variables were not 16 | initialized correctly when parsing a style file, which lead to some 17 | surprising behaviour with flags of one config line re-used by the next 18 | if the flags field of that line was empty. This could also have lead to 19 | buffer overflows in the first line being parsed. 20 | * Fix: When there is an active progress display, log messages would show up 21 | after the progress display instead of the next line. 22 | * Release some allocated memory earlier in the processing chain. 23 | * Fix confusing log message: The message "Done postprocessing on table '{}' 24 | in {}" was logged twice when `--drop` is used. This changes one of the log 25 | messages to the more specific "Table '{}' dropped in {}". 26 | * Run ANALYZE on middle tables only in create mode saving some processing 27 | time. 28 | * Add 'status' command to `osm2pgsql-replication`. Prints the current 29 | replication status, and with `--json` prints that as JSON data. 30 | * Needs at least CMake 3.5.0 now. 31 | * Updates the included versions of the catch2, fmt, libosmium, and protozero 32 | libraries to current versions. 33 | 34 | Note that this is the last version which will compile with C++14. The next 35 | version 1.6.0 will need C++17. 36 | 37 | -------------------------------------------------------------------------------- /_releases/1.6.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.6.0 3 | version: 1.6.0 4 | date: 2022-01-24 5 | manpages: 6 | - osm2pgsql 7 | - osm2pgsql-replication 8 | highlights: 9 | - Ignore relations with more than 32.000 members 10 | --- 11 | 12 | * The osm2pgsql-replication script which has been included in the osm2pgsql 13 | repository for a while will now be installed together with its man page on 14 | "make install". To use it you need Python3, psycopg2 (or psycopg3), and 15 | PyOsmium installed. 16 | * Ignore relations with more than 32.000 members (which should never happen 17 | in real data) instead of failing. 18 | * Removed the dependency on boost::algorithm. 19 | * Included libosmium was updated to newest version 2.17.3 which contains 20 | an important fix for a problem which can lead to osm2pgsql locking up. 21 | 22 | -------------------------------------------------------------------------------- /_releases/1.7.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.7.1 3 | version: 1.7.1 4 | date: 2022-10-04 5 | manpages: 6 | - osm2pgsql 7 | - osm2pgsql-replication 8 | highlights: 9 | - Many new geometry processing functions 10 | - Fix relation member ordering in multi-geometries 11 | --- 12 | 13 | This release fixes a few small bugs in osm2pgsql and closes some gaps 14 | in the geometry processing code released in 1.7.0. It also contains 15 | some security-related fixes as a result of the 16 | [security audit](https://osm2pgsql.org/news/2022/09/13/security-audit.html). 17 | 18 | * Added `as_multipoint()` function to complement `as_multilinestring()` 19 | and `as_multipolygon()`. 20 | * The functions `as_multipoint()`, `as_multilinestring()`, and 21 | `as_multipolygon()` will now always return single geometries if 22 | possible. Single geometries are always allowed where multi geometries 23 | are allowed, so this does't break anything. 24 | * The `centroid()` function now works for all geometry types. 25 | * New `length()` function to compute the length of a geometry in map units. 26 | * New `reverse()` function to turn geometries around (can be useful for ways 27 | tagged with `oneway=-1`). 28 | * The `simplify()` function is now available for multilinestrings, too. 29 | (Not for polygons yet.) 30 | * All example code in the `flex-config` directory has been updated 31 | for the new geometry handling capabilities. 32 | * Create nicer error messages when trying to access a missing database 33 | extension, schema, or tablespace. 34 | * Better checking of names (of tables, schemas, etc.) used in SQL in 35 | osm2pgsql and osm2pgsql-replication to avoid potentional SQL injection issues. 36 | * Fix: Make sure relation members show up in the correct order in 37 | multi-geometries when using slim mode. 38 | * Fix: Do not try to run `ST_IsValid()` on `create_only` columns. 39 | * osm2pgsql-replication: The database parameter may be empty when 40 | connection parameters are supplied via environment variables. 41 | * osm2pgsql-replication: when installed, now runs the osm2pgsql binary that 42 | was installed with it to avoid potential security issues through 43 | PATH manipulation. 44 | * osm2pgsql-replication: Meaningful error when middle tables do not exist 45 | or the prefix is a bad one. 46 | 47 | -------------------------------------------------------------------------------- /_releases/1.7.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.7.2 3 | version: 1.7.2 4 | date: 2022-11-10 5 | manpages: 6 | - osm2pgsql 7 | highlights: 8 | - Small changes only 9 | --- 10 | 11 | This release has some small changes only: 12 | 13 | * The flex output now allows tables with only the id column (or columns). 14 | * The `osm2pgsql-replication` script now always expects the `osm2pgsql` 15 | binary to be in same path as itself. 16 | * Adds the flag `--middle-schema=SCHEMA` to the `osm2pgsql-replication` 17 | script which allows placing the replication status table in a schema 18 | other than PUBLIC (Thanks to @JakobMiksch). 19 | * More tests have been converted to the new BDD format. 20 | * Various code cleanups and refactorings especially in the expire code. 21 | 22 | -------------------------------------------------------------------------------- /_releases/1.8.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.8.0 3 | version: 1.8.0 4 | date: 2023-01-28 5 | manpages: 6 | - osm2pgsql 7 | highlights: 8 | - More flexible index support in flex output 9 | - Gazetteer output deprecated 10 | - Fix performance problem with projections other than WGS84 and web mercator 11 | - New pole_of_inaccessibility() function 12 | --- 13 | 14 | The largest change is the addition of much more flexible index support in the 15 | flex output. The table definitions have a new (optional) field called `indexes` 16 | now which takes a list of index definitions. If the field is not there, we fall 17 | back to what we did before and create a GIST index on the only/first geometry 18 | column of a table. But you can also define any kind of index you want: define 19 | which index method (BTREE, GIST, ...) to use on which columns, define `WHERE` 20 | clauses and expression indexes and much more. See the `flex-config/indexes.lua` 21 | Lua config for some usage examples and the manual for all the details. You can 22 | also force osm2pgsql to always build the id indexes which are normally only 23 | built in slim mode. 24 | 25 | The gazetteer output and the command line option `--with-forward-dependencies` 26 | are deprecated in this release and will be removed soon. They were only needed 27 | for Nominatim which switched to using the flex output recently. 28 | 29 | Here are the other changes: 30 | 31 | * Fix a problem when using osm2pgsql with a projection other than WGS84 32 | (EPSG:4326) or Web Mercator (EPSG:3857) which made the program really slow. 33 | * New `pole_of_inaccessibility()` Lua function to generate reasonably good 34 | label points from polygons. (This function is currently marked as 35 | experimental, which means it can change without notice at any time.) 36 | * Performance improvement for very small updates. Don't spin up multiple 37 | threads when there are less then 100 objects to process, because the extra 38 | overhead is not worth it. 39 | * Implement and use our own JSON writer. This removes the dependency on 40 | RapidJSON which hasn't seen a new release since 2016. 41 | * Add more checks (or does some checks earlier) to make sure your database 42 | uses UTF-8 encoding and that necessary database extensions are loaded and 43 | index methods, schemas and tablespaces you refer to in the config are 44 | actually available. 45 | * A lot of code needed to be updated so it works correctly with any of the 46 | recent versions of the fmt library. 47 | 48 | As always there were lots of code cleanups across the board, but especially in 49 | code accessing the database and in the C++/Lua glue code to make it more 50 | flexible and easier to use internally. 51 | 52 | -------------------------------------------------------------------------------- /_releases/1.8.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.8.1 3 | version: 1.8.1 4 | date: 2023-02-13 5 | manpages: 6 | - osm2pgsql 7 | highlights: 8 | - Small fixes only 9 | --- 10 | 11 | This release contains some fixes and minor changes. 12 | 13 | * Fix `osm2pgsql-replication` script so it works correctly with 14 | PostgreSQL schemas. 15 | * Don't process objects without tags in outputs in append mode. 16 | This should speed up updates a little bit. 17 | * Count number of inserted rows and rows not inserted because of 18 | NOT NULL constraints for each table and log the numbers in debug mode. 19 | * Remove some extra-verbose debug logging when using the 20 | `pole_of_inaccessibility()` function. 21 | * Flush output tables generated from nodes and ways tables earlier. 22 | 23 | -------------------------------------------------------------------------------- /_releases/1.9.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.9.0 3 | version: 1.9.0 4 | date: 2023-08-15 5 | manpages: 6 | - osm2pgsql 7 | - osm2pgsql-replication 8 | highlights: 9 | - New osm2pgsql_properties table 10 | - New experimental database middle format 11 | - New experimental generalization support 12 | - Schemas are handled differently 13 | --- 14 | 15 | This release brings three new major features: 16 | 17 | * a new osm2pgsql_properties table that saves command line options and reuses 18 | them on updates 19 | * a new database middle saves raw OSM data in JSONB format and is explicitly 20 | designed to be queried by the user 21 | * the new (and still experimental) osm2pgsql-gen adds geometry generalization 22 | to osm2pgsql 23 | 24 | Other changes include: 25 | 26 | * cleanup of schema handling 27 | * tile expiry output into database tables 28 | * a new `spherical_area()` function for flex config files to calculate the area 29 | of a (multi)polygon on the sphere. 30 | * when using the new database middle, the `--middle-with-nodes` option allows 31 | you to store all tagged nodes in the database (with their tags and location). 32 | * several improvements to osm2pgsql-replication to make it more flexible and 33 | better tested (thanks to @amandasaurus and @JakobMiksch) 34 | * don't do multi-statement SQL queries to be compatible with the PgPool-II 35 | connection pooler. 36 | 37 | Please note that this version drops support for implicit DB schema other than 38 | public. If you rely on implict user schemas or custom schema paths, you now 39 | must configure the schema to be used with the `--schema` option. 40 | 41 | For more information on all new features and changes read the more extensive 42 | release notes for 1.9.0 at https://osm2pgsql.org/news/. 43 | 44 | -------------------------------------------------------------------------------- /_releases/1.9.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.9.1 3 | version: 1.9.1 4 | date: 2023-08-22 5 | manpages: 6 | - osm2pgsql 7 | - osm2pgsql-replication 8 | highlights: 9 | - Fix compatibility of osm2pgsql-replication with psycopg3 10 | --- 11 | 12 | * Fix compatibility of osm2pgsql-replication with psycopg3 13 | * Fix architecture-dependent double to integer conversion 14 | * Some small code cleanups 15 | 16 | -------------------------------------------------------------------------------- /_releases/1.9.2.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 1.9.2 3 | version: 1.9.2 4 | date: 2023-09-04 5 | manpages: 6 | - osm2pgsql 7 | - osm2pgsql-replication 8 | highlights: 9 | - Fix bug with two-stage processing 10 | - Improved generalization support 11 | --- 12 | 13 | This release fixes a bug introduced in 1.9.0 with two-stage 14 | processing that will lead to crashes. If you are using any 1.9.x version, 15 | please upgrade to 1.9.2. 16 | 17 | In one case we had some performance problems updating an osm2pgsql 18 | database with 1.9.1 due to the PostgreSQL query planning choosing a bad plan. 19 | This release contains a workaround for that problem. 20 | 21 | We also improved the (experimental) generalizer code a bit: 22 | 23 | * More information is shown in log level 'info', including some timing 24 | information. 25 | * The Lua config `run_sql()` command now can have either a single SQL 26 | statement in the `sql` field (as before) or a list of SQL commands. 27 | * For convenience, the Lua config `run_sql()` command now has an optional 28 | `transaction` field which can be set to `true` to wrap the SQL 29 | commands in BEGIN/COMMIT. 30 | * The new `if_has_rows` fields on the `run_sql()` command can be set 31 | to string with an SQL query. If that field is set, the SQL statement(s) 32 | in the `sql` field is only run, if the SQL query returns at least one row. 33 | * Some performance improvements in low-level code in the generalizer. 34 | 35 | -------------------------------------------------------------------------------- /_releases/2.0.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 2.0.1 3 | version: 2.0.1 4 | date: 2024-12-02 5 | manpages: 6 | - osm2pgsql 7 | - osm2pgsql-gen 8 | - osm2pgsql-replication 9 | highlights: 10 | - Small fixes only 11 | --- 12 | 13 | This release fixes some small issues with 2.0.0: 14 | 15 | * fix forwarding of `--schema` parameter from osm2pgsql-replication to osm2pgsql 16 | * install `osm2pgsql_find_changed_ways` function in the right schema (thanks @falko17) 17 | * install osm2pgsql-gen binary by default 18 | -------------------------------------------------------------------------------- /_releases/2.1.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 2.1.0 3 | version: 2.1.0 4 | date: 2025-04-07 5 | manpages: 6 | - osm2pgsql 7 | - osm2pgsql-gen 8 | - osm2pgsql-replication 9 | highlights: 10 | - Improved compatibility with connection poolers 11 | --- 12 | 13 | This is a bugfix and maintenance release. The main visible change is that 14 | osm2pgsql now works better together with connection poolers and similar 15 | database middleware: prepared statements now use protocol level prepare instead 16 | of PREPARE sql commands and there is a new option to explicitly create a 17 | primary key on flex tables. 18 | 19 | Other fixes and features: 20 | 21 | * check flat node file format for forwards compatibility to prepare for future changes of the flatnode file format 22 | * fix two-stage processing when flat node file is used 23 | * fix getting node locations in slim node with two-stage processing 24 | * updated included libosmium, protozero and fmt libraries 25 | 26 | -------------------------------------------------------------------------------- /_releases/2.1.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Version 2.1.1 3 | version: 2.1.1 4 | date: 2025-04-14 5 | manpages: 6 | - osm2pgsql 7 | - osm2pgsql-gen 8 | - osm2pgsql-replication 9 | highlights: 10 | - Small fixes only 11 | --- 12 | 13 | This is a bug fix release which contains the following: 14 | 15 | * refuse to update database when the flatnode is missing 16 | * fix regression where writing to tables without a managed id column was not possible 17 | 18 | -------------------------------------------------------------------------------- /_users/eifer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: EIfER 3 | order: 6 4 | links: 5 | - href: https://www.eifer.kit.edu/ 6 | title: EIfER - European Institute for Energy Research 7 | tags: 8 | - map 9 | - analysis 10 | --- 11 | 12 | Osm2pgsql is used by the European Institute for Energy Research to process 13 | OpenStreetMap data for various projects involving suitability of sites for 14 | renewable energy projects, urban mobility, and more. They appreciate the 15 | ability to quickly and easily construct customized OpenStreetMap databases that 16 | suit the specific needs of individual projects with the new flex output 17 | feature. 18 | 19 | The image shows geographic buffers calculated on features from an 20 | osm2pgsql-based database to exclude unacceptable areas to construct wind 21 | turbines according to national regulation. 22 | -------------------------------------------------------------------------------- /_users/nominatim.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Nominatim 3 | order: 2 4 | links: 5 | - href: https://nominatim.org/ 6 | title: Nominatim 7 | - href: https://www.openstreetmap.org/ 8 | title: OpenStreetMap 9 | - href: https://nominatim.org/release-docs/latest/admin/Installation/ 10 | title: Nominatim Installation 11 | tags: 12 | - geocoding 13 | - analysis 14 | - open source 15 | --- 16 | 17 | Nominatim uses OpenStreetMap data to find locations on Earth by name and/or 18 | address. This is called geocoding. It can also do the reverse, find an address 19 | for any location on the planet. 20 | 21 | Nominatim powers the search on the official OSM site at openstreetmap.org. It 22 | serves 30 million queries per day on a single server. And it is always kept up 23 | to date using osm2pgsql. Nominatim uses database triggers in the 24 | PostgreSQL/PostGIS database to analyse the data and build a hierarchy of places 25 | from country level, down to state, city, and finally the individual address. 26 | 27 | Nominatim is Open Source and you can set it up for yourself. 28 | -------------------------------------------------------------------------------- /_users/opencampingmap.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: OpenCampingMap 3 | order: 4 4 | links: 5 | - href: https://opencampingmap.org/ 6 | title: OpenCampingMap 7 | - href: https://github.com/giggls/osmpoidb 8 | title: osmpoidb 9 | - href: https://wiki.openstreetmap.org/wiki/Tag:tourism%3Dcamp_site 10 | title: The tag tourism=camp_site 11 | tags: 12 | - map 13 | - analysis 14 | - open source 15 | --- 16 | 17 | The specialized OpenCampingMap shows campsites around the world. It is based on 18 | the osm2pgsql flex output. OSM data about camp sites and other POI data is 19 | updated hourly into PostgreSQL/PostGIS database. 20 | 21 | OpenCampingMap aggregates data from several OSM objects. It uses OSM objects 22 | with the tag `tourism=camp_site` as well as other objects in the vicinity to 23 | analyze which amenities such as toilets, showers, sports facilities, etc. are 24 | available on this camp ground. For this the osm2pgsql Lua config file and 25 | additional SQL commands work together showing the power of having a flexible 26 | relation database for complex OSM data analysis. 27 | -------------------------------------------------------------------------------- /_users/osmcarto.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: OpenStreetMap Carto 3 | order: 1 4 | links: 5 | - href: https://www.openstreetmap.org/ 6 | title: www.openstreetmap.org 7 | - href: https://switch2osm.org/serving-tiles/ 8 | title: Switch2OSM 9 | - href: https://github.com/gravitystorm/openstreetmap-carto 10 | title: OSM Carto 11 | tags: 12 | - raster map 13 | - open source 14 | --- 15 | 16 | This is the original use case for osm2pgsql: Supporting the raster map at 17 | www.openstreetmap.org. The OSM Foundations runs a bunch of servers generating 18 | and distributing the most iconic OSM map called "OpenStreetMap Carto". And 19 | osm2pgsql makes sure this map is updated, usually within minutes of changes 20 | being applied to the OSM database. 21 | 22 | If you want to install such a map yourself, have a look at Switch2OSM and OSM 23 | Carto. By the way: You don't have to use the same map style, there are other 24 | styles around that use the same database layout. 25 | -------------------------------------------------------------------------------- /_users/parkraum.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Parkraumanalyse 3 | order: 5 4 | links: 5 | - href: https://parkraum.osm-verkehrswende.org/ 6 | title: Project page "Parkraumanalyse" 7 | - href: https://tilda-geo.de/regionen/parkraum 8 | title: Map page "Parkraumanalyse" 9 | - href: https://github.com/osmberlin/osm-parking-processing 10 | title: Github project page 11 | tags: 12 | - map 13 | - analysis 14 | - open source 15 | --- 16 | 17 | In the project "Parkraumanalyse" (parking space analysis) OpenStreetMap data 18 | about parking spaces along roads and on parking lots is analysed in incredible 19 | detail. This helps with understanding how much parking is available in specific 20 | areas and how this will be affected by road changes, for instance when new 21 | cycle lanes are introduced. 22 | 23 | The analysis uses osm2pgsql to extract exactly the data needed from OSM and 24 | import it into a database where SQL scripts will do sophisticated processing 25 | to prepare the data for visualization. 26 | 27 | -------------------------------------------------------------------------------- /_users/thunderforest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Thunderforest 3 | order: 3 4 | links: 5 | - href: https://www.thunderforest.com/ 6 | title: Thunderforest 7 | - href: https://www.thunderforest.com/maps/opencyclemap/ 8 | title: OpenCycleMap information 9 | - href: https://www.openstreetmap.org/#layers=C 10 | title: OpenCycleMap on openstreetmap.org 11 | tags: 12 | - raster map 13 | - vector map 14 | --- 15 | 16 | Thunderforest is a commercial service offering raster and vector maps with 17 | custom styles. Their map stack is based on the flex output of osm2pgsql. 18 | 19 | Thunderforest is also the source of the popular OpenCycleMap, which is 20 | available as one of the map choices on www.openstreetmap.org. 21 | 22 | Since 2020 Thunderforest supports osm2pgsql. As well as having paid for the 23 | initial development of the "flex output" they also provide monthly sponsorship 24 | for routine maintainance and feature development. 25 | -------------------------------------------------------------------------------- /about/history/contributors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/about/history/contributors.png -------------------------------------------------------------------------------- /about/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: About 3 | --- 4 | 5 | # About osm2pgsql 6 | 7 | Osm2pgsql is an Open Source tool for importing 8 | [OpenStreetMap](https://www.openstreetmap.org/){:.extlink} (OSM) data into a 9 | PostgreSQL/PostGIS database. Essentially it is a very specialized ETL 10 | (Extract-Transform-Load) tool for OpenStreetMap data. [PostgreSQL 11 | database](https://www.postgresql.org/){:.extlink} is the most advanced Open 12 | Source database, together with the [PostGIS](https://postgis.net/){:.extlink} 13 | extension for handling geographical data it offers an extremely powerful 14 | way of working with OpenStreetMap data. 15 | 16 | Osm2pgsql is an essential part of many services that take OSM data and create 17 | maps from it. It is also used in the Nominatim geocoder and numerous other 18 | applications processing OSM data. 19 | 20 | 35 | 36 | -------------------------------------------------------------------------------- /about/users/eifer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/about/users/eifer.png -------------------------------------------------------------------------------- /about/users/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Who uses osm2pgsql? 3 | --- 4 | 5 | # Who uses osm2pgsql? 6 | 7 | Here is a list of some projects and services using osm2pgsql. This is, of 8 | course, far from complete. Do you have an interesting project and use 9 | osm2pgsql? Give us a shout! 10 | 11 |
12 | {% assign sortedusers = site.users | sort: 'order' -%} 13 | {% for user in sortedusers -%} 14 | {%- assign name = user.path | split: "/" | last | split: "." | first -%} 15 |
16 |
17 |
18 | {% for tag in user.tags -%} 19 | {{ tag }} 20 | {% endfor -%} 21 |
22 |
23 |

{{ user.title }}

24 |
25 | {{ user.content | markdownify }} 26 |
27 |
    28 | {% for link in user.links -%} 29 |
  • {{ link.title }}
  • 30 | {% endfor -%} 31 |
32 |
33 | {% endfor -%} 34 |
35 | -------------------------------------------------------------------------------- /about/users/nominatim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/about/users/nominatim.png -------------------------------------------------------------------------------- /about/users/opencampingmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/about/users/opencampingmap.png -------------------------------------------------------------------------------- /about/users/osmcarto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/about/users/osmcarto.png -------------------------------------------------------------------------------- /about/users/parkraum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/about/users/parkraum.png -------------------------------------------------------------------------------- /about/users/thunderforest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/about/users/thunderforest.png -------------------------------------------------------------------------------- /contribute/dependencies.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Dependencies 3 | --- 4 | 5 | # Dependencies 6 | 7 | This page shows which versions of software osm2pgsql depends on (or that are 8 | otherwise related) are available on popular Linux distributions and macOS. It 9 | sometimes helps maintainers decide what versions need to be supported. 10 | 11 | *See the 12 | [README](https://github.com/osm2pgsql-dev/osm2pgsql/blob/master/README.md) for 13 | a list of actual dependencies.* 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {%- for package in site.data.dependencies.packages -%} 22 | 23 | {%- endfor -%} 24 | 25 | 26 | 27 | {%- for repos in site.data.dependencies.repositories -%} 28 | 29 | 30 | 31 | 32 | {%- for package in site.data.dependencies.packages -%} 33 | 34 | {%- endfor -%} 35 | 36 | {%- endfor -%} 37 | 38 | 39 |
DistributionReleasedEnd of life{{ package }}
{{ repos.name }}{{ repos.date }}{{ repos.eol }}-
40 | 41 | * C++14 should be fully supported from GCC 5, Clang 3.4. It is the default from GCC 6.1 to GCC 10 and since Clang 6. 42 | * C++17 should be fully supported from GCC 7, Clang 5. It is the default from GCC 11. 43 | 44 | See also: 45 | 46 | * [C++ Standards Support in GCC](https://gcc.gnu.org/projects/cxx-status.html) 47 | * [C++ Implementation Status in libstdc++](https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html) 48 | * [C++ Support in Clang](https://clang.llvm.org/cxx_status.html) 49 | * [C++ Support in libc++](https://libcxx.llvm.org/) 50 | 51 | 72 | -------------------------------------------------------------------------------- /doc/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Documentation 3 | --- 4 | 5 | # Osm2pgsql Documentation 6 | 7 | 61 | 62 |
63 | 64 | ## Related Documentation 65 | 66 | 93 |
94 | 95 | -------------------------------------------------------------------------------- /doc/install.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: Installation 4 | --- 5 | 6 | Osm2pgsql works on Linux, Windows, macOS, and other systems. We recommend you 7 | always use the latest [released version]({% link releases/index.md %}), 8 | currently {{ site.releases | sort: 'date' | map: "version" | last }}. 9 | 10 | [![Packaging status](https://repology.org/badge/tiny-repos/osm2pgsql.svg)](https://repology.org/project/osm2pgsql/versions) 11 | [![latest packaged version(s)](https://repology.org/badge/latest-versions/osm2pgsql.svg)](https://repology.org/project/osm2pgsql/versions) 12 | 13 | 21 | 22 | ## Upgrading an Existing Installation 23 | 24 | Usually you can upgrade an existing installation of osm2pgsql to a new version 25 | without worries. But sometimes the database format or something like it changes 26 | and you have to re-import the OSM data, create a new index or so. Please read 27 | the release information carefully. There is also an appendix in the manual with 28 | [upgrading information](manual.html#upgrading). 29 | 30 | -------------------------------------------------------------------------------- /doc/install/docker.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: Installing with Docker 4 | --- 5 | 6 | Docker images for the latest and many earlier versions of osm2pgsql are 7 | available from [Dockerhub](https://hub.docker.com/r/iboates/osm2pgsql) 8 | 9 | ```sh 10 | docker pull iboates/osm2pgsql:latest 11 | ``` 12 | 13 | You can then generally run the image by passing the same arguments to `docker 14 | run iboates/osm2pgsql` as you would to `osm2pgsql` itself. It is a little bit 15 | more subtle than that (especially regarding `osm2pgsql-replication`), see the 16 | [readme](https://github.com/iboates/osm-utilities-docker/tree/master/osm2pgsql) 17 | for more info. There are also more examples, including one using `docker 18 | compose`. 19 | 20 | Note that these docker images are maintained externally. If you have any 21 | questions or bug reports [contact the 22 | maintainer](https://github.com/iboates/osm-utilities-docker/issues). 23 | -------------------------------------------------------------------------------- /doc/install/freebsd.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: Installing on FreeBSD 4 | --- 5 | 6 | ![FreeBSD port](https://repology.org/badge/version-for-repo/freebsd/osm2pgsql.svg) 7 | 8 | Osm2pgsql is available in [FreeBSD 9 | Ports](https://ports.freebsd.org/cgi/ports.cgi?query=osm2pgsql){:.extlink}. 10 | Install with: 11 | 12 | ```sh 13 | pkg install converters/osm2pgsql 14 | ``` 15 | -------------------------------------------------------------------------------- /doc/install/linux.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: Installing on Linux 4 | --- 5 | 6 | There are [packages of 7 | osm2pgsql](https://repology.org/project/osm2pgsql/versions){:.extlink} 8 | available for many different Linux distributions. Some of them are quite old, 9 | though, and have known bugs. If the current release is not available for your 10 | distribution, consider installing the current release from source. 11 | 12 | ### Installing on Ubuntu 13 | 14 | ![Ubuntu 20.04 package](https://repology.org/badge/version-for-repo/ubuntu_20_04/osm2pgsql.svg) 15 | ![Ubuntu 22.04 package](https://repology.org/badge/version-for-repo/ubuntu_22_04/osm2pgsql.svg) 16 | ![Ubuntu 24.04 package](https://repology.org/badge/version-for-repo/ubuntu_24_04/osm2pgsql.svg) 17 | 18 | For Ubuntu installation is usually as simple as 19 | 20 | ```sh 21 | apt install osm2pgsql 22 | ``` 23 | 24 | ### Installing on Debian 25 | 26 | ![Debian 11 (Bullseye) package](https://repology.org/badge/version-for-repo/debian_11/osm2pgsql.svg) 27 | ![Debian 11 (Bullseye) Backports package](https://repology.org/badge/version-for-repo/debian_11_backports/osm2pgsql.svg) 28 | ![Debian 12 (Bookworm) package](https://repology.org/badge/version-for-repo/debian_12/osm2pgsql.svg) 29 | ![Debian Testing package](https://repology.org/badge/version-for-repo/debian_13/osm2pgsql.svg) 30 | 31 | For Debian installation is usually as simple as 32 | 33 | ```sh 34 | apt install osm2pgsql 35 | ``` 36 | 37 | If you are using Debian Stable, we recommend using the packages from 38 | [backports](https://backports.debian.org/){:.extlink}. Debian maintainers are 39 | really good at keeping these up-to-date. 40 | 41 | ### Installing on Fedora 42 | 43 | ![Fedora 37 package](https://repology.org/badge/version-for-repo/fedora_37/osm2pgsql.svg) 44 | ![Fedora 38 package](https://repology.org/badge/version-for-repo/fedora_38/osm2pgsql.svg) 45 | ![Fedora Rawhide package](https://repology.org/badge/version-for-repo/fedora_rawhide/osm2pgsql.svg) 46 | 47 | Fedora has packages of osm2pgsql available. Install with 48 | 49 | ```sh 50 | dnf install osm2pgsql 51 | ``` 52 | 53 | ### Installing on openSUSE 54 | 55 | First add the "Geo" package repository (adapt URL to the openSUSE version you 56 | use): 57 | 58 | ```sh 59 | zypper ar https://download.opensuse.org/repositories/Application:/Geo/openSUSE_Leap_15.2/ "Geo" 60 | zypper refresh 61 | ``` 62 | 63 | Then install osm2pgsql: 64 | 65 | ```sh 66 | zypper install osm2pgsql 67 | ``` 68 | 69 | ### Installing on Arch Linux 70 | 71 | ![AUR package](https://repology.org/badge/version-for-repo/aur/osm2pgsql.svg) 72 | 73 | Build the 74 | [osm2pgsql-git](https://aur.archlinux.org/packages/osm2pgsql-git){:.extlink} 75 | package from the 76 | [AUR](https://wiki.archlinux.org/title/Arch_User_Repository){:.extlink}. 77 | (Download the tarball and compile/install with `makepkg`, or use an AUR helper 78 | such as `yaourt`.) 79 | 80 | -------------------------------------------------------------------------------- /doc/install/macos.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: Installing on macOS 4 | --- 5 | 6 | ![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/osm2pgsql.svg) 7 | 8 | Osm2pgsql is [available on 9 | Homebrew](https://formulae.brew.sh/formula/osm2pgsql){:.extlink}. Install with 10 | 11 | ```sh 12 | brew install osm2pgsql 13 | ``` 14 | 15 | -------------------------------------------------------------------------------- /doc/install/source.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: Installing from Source 4 | --- 5 | 6 | If you can't use the packaged version of osm2pgsql for your distribution, you 7 | can always install from source. 8 | 9 | * To install the latest release, download the 10 | [latest release](https://github.com/osm2pgsql-dev/osm2pgsql/releases/latest) 11 | as `tar.gz` or `zip` file and unpack it. 12 | * To install a version from git, get it with `git clone 13 | https://github.com/osm2pgsql-dev/osm2pgsql`. 14 | 15 | See the *Building* section in the 16 | [`README.md`](https://github.com/osm2pgsql-dev/osm2pgsql/blob/master/README.md) 17 | for a list of dependencies and build instructions. 18 | 19 | -------------------------------------------------------------------------------- /doc/install/windows.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: Installing on Windows 4 | --- 5 | 6 | ### Using prebuilt binaries 7 | 8 | You can [download prebuilt binaries](/download/windows/). Unpack the ZIP file 9 | and you can immediately use osm2pgsql. 10 | 11 | ### Compiling from source 12 | 13 | For native Windows compilation you need a C++17-compatible compiler. Follow the 14 | usual steps for compiling CMake projects. 15 | 16 | -------------------------------------------------------------------------------- /doc/man/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: Manual Pages 4 | --- 5 | 6 |
7 | 8 |
9 | 10 |

osm2pgsql

11 | 12 | {% assign dev = site.manpages | where: "version", "Development version" | first -%} 13 |
    14 | {% assign sortedreleases = site.releases | sort: 'date' | reverse %} 15 | {% for release in sortedreleases -%} 16 | {% if release.manpages -%} 17 |
  • Version {{ release.version }}
  • 18 | {%- endif %} 19 | {% endfor -%} 20 |
21 | 22 |
23 |
24 | 25 |

osm2pgsql-gen

26 | 27 |

This man page is only available for newer versions of osm2pgsql.

28 | 29 | {% assign dev = site.manpages | where: "version", "Development version" | first -%} 30 |
    31 | {% assign sortedreleases = site.releases | where_exp:"item", "item.manpages contains 'osm2pgsql-gen'" | sort: 'date' | reverse %} 32 | {% for release in sortedreleases -%} 33 | {% if release.manpages -%} 34 |
  • Version {{ release.version }}
  • 35 | {%- endif %} 36 | {% endfor -%} 37 |
38 | 39 |
40 |
41 | 42 |

osm2pgsql-replication

43 | 44 |

This man page is only available for newer versions of osm2pgsql.

45 | 46 | {% comment %} 47 | Create man pages with: groff -mandoc -Thtml man/osm2pgsql-replication.1 48 | {% endcomment %} 49 | 50 | 60 | 61 |
62 |
63 | 64 | -------------------------------------------------------------------------------- /doc/man/latest.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: manpage 3 | title: Latest version 4 | --- 5 | {% assign latest = site.manpages | where_exp: "item", "item.version != 'Development version'" | sort: "version" | last %} 6 | 7 | {{ latest.content }} 8 | -------------------------------------------------------------------------------- /doc/manual-v1.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: Osm2pgsql v1 Manual 4 | --- 5 | 6 | {%- assign chapters = site.manual-v1 | sort: 'chapter' -%} 7 | 8 | ▲ ToC 9 | 10 |
11 |

Table of Contents

12 | 13 | {% for oc in chapters %} 14 | {%- if oc.appendix -%} 15 | 16 | 17 | 18 | 22 | 23 | {%- else -%} 24 | 25 | 26 | 27 | 31 | 32 | {%- endif -%} 33 | {% endfor -%} 34 |
{{ oc.appendix }} 19 | {{ oc.title }} 20 |
    21 |
    {{ oc.chapter }} 28 | {{ oc.title }} 29 |
      30 |
      35 |
      36 | 37 |
      38 | {% for oc in chapters %} 39 |
      40 |

      {{ oc.title }}

      41 | 42 | {{ oc.content }} 43 |
      44 | {% endfor %} 45 |
      46 | 47 | {% include heading-links.html %} 48 | -------------------------------------------------------------------------------- /doc/manual.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc 3 | title: Osm2pgsql v2 Manual 4 | --- 5 | 6 | {%- assign chapters = site.manual-v2 | sort: 'chapter' -%} 7 | 8 | ▲ ToC 9 | 10 |
      11 |

      Table of Contents

      12 | 13 | {% for oc in chapters %} 14 | {%- if oc.appendix -%} 15 | 16 | 17 | 18 | 22 | 23 | {%- else -%} 24 | 25 | 26 | 27 | 31 | 32 | {%- endif -%} 33 | {% endfor -%} 34 |
      {{ oc.appendix }} 19 | {{ oc.title }} 20 |
        21 |
        {{ oc.chapter }} 28 | {{ oc.title }} 29 |
          30 |
          35 |
          36 | 37 |
          38 | {% for oc in chapters %} 39 |
          40 |

          {{ oc.title }}

          41 | 42 | {{ oc.content }} 43 |
          44 | {% endfor %} 45 |
          46 | 47 | {% include heading-links.html %} 48 | -------------------------------------------------------------------------------- /doc/tutorials/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Tutorials 3 | --- 4 | 5 | # Osm2pgsql Tutorials 6 | 7 |

          Tutorials help new and advanced users with specific tasks around 8 | osm2pgsql.

          9 | 10 | * [Switching from `add_row()` to `insert()`]({% link doc/tutorials/switching-from-add-row-to-insert/index.md %}) 11 | 12 | -------------------------------------------------------------------------------- /examples/3dbuildings/3dbuildings-manhatten.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/3dbuildings/3dbuildings-manhatten.png -------------------------------------------------------------------------------- /examples/3dbuildings/3dbuildings-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/3dbuildings/3dbuildings-small.png -------------------------------------------------------------------------------- /examples/3dbuildings/3dbuildings.lua: -------------------------------------------------------------------------------- 1 | 2 | local buildings = osm2pgsql.define_area_table('buildings', { 3 | -- Define an autoincrementing id column, QGIS likes a unique id on the table 4 | { column = 'id', sql_type = 'serial', create_only = true }, 5 | { column = 'height', type = 'real', not_null = true }, 6 | { column = 'geom', type = 'polygon', not_null = true }, 7 | }) 8 | 9 | -- calculate the height of the building from the tags 10 | function calc_height(tags) 11 | -- if an explicit 'height' tag is available use that 12 | -- could be extended to also allow height in feet 13 | if tags.height then 14 | local h = tonumber(tags.height) 15 | if h and h > 0 and h < 900 then 16 | return h 17 | end 18 | end 19 | 20 | -- use 'building:levels' tag and assume each level is 4 meters high 21 | local levels = tags['building:levels'] 22 | if levels then 23 | local l = tonumber(levels) 24 | if l and l > 0 and l < 200 then 25 | return l * 4 26 | end 27 | end 28 | 29 | -- fall back to default height if we can't find any useful tags 30 | return 12 31 | end 32 | 33 | function add_building(tags, geom) 34 | buildings:insert({ 35 | height = calc_height(tags), 36 | geom = geom 37 | }) 38 | end 39 | 40 | function osm2pgsql.process_way(object) 41 | if object.is_closed and object.tags.building then 42 | add_building(object.tags, object:as_polygon()) 43 | end 44 | end 45 | 46 | function osm2pgsql.process_relation(object) 47 | if object.tags.type == 'multipolygon' and object.tags.building then 48 | geom = object:as_multipolygon() 49 | for g in geom:geometries() do 50 | add_building(object.tags, g) 51 | end 52 | end 53 | end 54 | 55 | -------------------------------------------------------------------------------- /examples/3dbuildings/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: examples 3 | title: 3D Building Map 4 | --- 5 | 6 | 3D map of lower Manhatten 7 | {:.flright} 8 | 9 | *You need at least osm2pgsql version 1.7.0 for this example.* 10 | 11 | For some buildings OSM data contains height information. Sometimes it is 12 | specified directly in the 13 | [`height`](https://taginfo.openstreetmap.org/keys/height) tag, usually in 14 | meters. If not, we can have a look at the 15 | [`building:levels`](https://taginfo.openstreetmap.org/keys/building:levels) tag 16 | which sometimes contains the number of levels a building has. Assuming a level 17 | is on average 4 meters high, we can estimate the building height from that. 18 | 19 | In a real world application you'd have to look into more details of those and 20 | other tags, the height is sometimes given in feet for instance. But for this 21 | demo this simplified setup should suffice. 22 | 23 | To get some nice sample data, lets look at New York. You can use the [OSM by 24 | the slice download service](https://slice.openstreetmap.us/) to get the extract. 25 | Zoom to New York and draw a polygon around the tip of Manhattan, add the name 26 | "newyork" and click on "Create Extract". In a few seconds you'll get a download 27 | button to download a file `newyork.osm.pbf`. 28 | 29 | Create a database `buildings` and import the data: 30 | 31 | ```sh 32 | osm2pgsql -d buildings -O flex -S 3dbuildings.lua newyork.osm.pbf 33 | ``` 34 | 35 | You can visualize this with QGIS by adding the `buildings` layer as usual, 36 | then choosing "2.5 D" as symbolization in the layers Symbology dialog. Choose 37 | the "height" attribute in the "Height" dropdown and play around with the rest 38 | of the settings. 39 | 40 | Here is the configuration file you'll need: 41 | 42 | {% include download.html file="3dbuildings.lua" %} 43 | 44 | ```lua 45 | {%- include_relative 3dbuildings.lua -%} 46 | ``` 47 | 48 | -------------------------------------------------------------------------------- /examples/antarctica/antarctica.lua: -------------------------------------------------------------------------------- 1 | 2 | local tables = {} 3 | 4 | tables.places = osm2pgsql.define_node_table('places', { 5 | { column = 'tags', type = 'jsonb' }, 6 | { column = 'place', type = 'text' }, 7 | { column = 'name', type = 'text' }, 8 | { column = 'geom', type = 'point', projection = 3031 }, 9 | }) 10 | 11 | tables.coastlines = osm2pgsql.define_way_table('coastlines', { 12 | { column = 'geom', type = 'linestring', projection = 3031 }, 13 | }) 14 | 15 | tables.ice_shelves = osm2pgsql.define_way_table('ice_shelves', { 16 | { column = 'geom', type = 'linestring', projection = 3031 }, 17 | }) 18 | 19 | -- These are the value of the "place" tag we are interested in. 20 | local check_place = osm2pgsql.make_check_values_func({ 'hamlet', 'isolated_dwelling', 'locality', 'town', 'village' }) 21 | 22 | function osm2pgsql.process_node(object) 23 | local place = object.tags.place 24 | 25 | if check_place(place) then 26 | tables.places:insert({ 27 | tags = object.tags, 28 | place = place, 29 | name = object.tags.name, 30 | geom = object:as_point() 31 | }) 32 | end 33 | end 34 | 35 | function osm2pgsql.process_way(object) 36 | -- For historical reasons OSM has ways tagged "natural=coastline" inside 37 | -- Antarctica that are not coastlines. Those have the additional tag 38 | -- "coastline=bogus", which allows us to make an exception for them. 39 | if object.tags.natural == 'coastline' and object.tags.coastline ~= 'bogus' then 40 | tables.coastlines:insert({ geom = object:as_linestring() }) 41 | end 42 | if object.tags['glacier:edge'] == 'grounding_line' then 43 | tables.ice_shelves:insert({ geom = object:as_linestring() }) 44 | end 45 | end 46 | 47 | -------------------------------------------------------------------------------- /examples/antarctica/antarctica1-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/antarctica/antarctica1-small.png -------------------------------------------------------------------------------- /examples/antarctica/antarctica1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/antarctica/antarctica1.png -------------------------------------------------------------------------------- /examples/antarctica/antarctica2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/antarctica/antarctica2.png -------------------------------------------------------------------------------- /examples/antarctica/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: examples 3 | title: Antarctica Map 4 | --- 5 | 6 | Map of McMurdo Sound in Antarctica 7 | {:.flright} 8 | 9 | *You need at least osm2pgsql version 1.7.0 for this example.* 10 | 11 | Typical maps on the web these days use the Mercator projection. And osm2pgsql 12 | uses that as the default projection, too. But osm2pgsql can handle basically 13 | any projection out there. It does this by leveraging the capabilities of the 14 | [PROJ](https://proj.org/){:.extlink} library. (Osm2pgsql must be compiled with 15 | PROJ support for this to work. This should be the case for most versions of 16 | osm2pgsql you encounter.) 17 | 18 | In this example we'll use an Antarctic polar [stereographic 19 | projection](https://en.wikipedia.org/wiki/Stereographic_projection){:.extlink} 20 | ([EPSG 3031](https://epsg.io/3031){:.extlink}), a special projection suitable 21 | for showing Antarctica. 22 | 23 | ## Getting and Preparing the Data 24 | 25 | Getting the data needed is easy, because Geofabrik offers an Antarctica extract 26 | for download: 27 | [antarctica-latest.osm.pbf](https://download.geofabrik.de/antarctica-latest.osm.pbf){:.extlink} 28 | 29 | ## Running Osm2pgsql 30 | 31 | OpenStreetMap contains data about coastlines, ice shelf boundaries as well as 32 | research stations and other details in Antarctica. We use this here for a rough 33 | outline of the continent and some red dots where stations and other important 34 | features are. (See [the OSM 35 | wiki](https://wiki.openstreetmap.org/wiki/Antarctica/Tagging){:.extlink} for 36 | more information about special tags for Antarctica.) 37 | 38 | As usual with OSM, the tagging is a bit inconsistent, some stations are tagged 39 | with `place=hamlet` or `place=town`, others as `place=locality`. But some 40 | glaciers are also tagged `place=locality`. This is certainly something that 41 | could be improved in OSM data as well as the osm2pgsql config script, but 42 | for our purposes here, this should be good enough. 43 | 44 | Here is the style config. Note the `projection = 3031` option on all the tables 45 | we define. 46 | 47 | {% include download.html file="antarctica.lua" %} 48 | 49 | ```lua 50 | {%- include_relative antarctica.lua -%} 51 | ``` 52 | 53 | Map of Antarctica with stations 54 | -------------------------------------------------------------------------------- /examples/buildings/brasilia1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/buildings/brasilia1.png -------------------------------------------------------------------------------- /examples/buildings/brasilia2-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/buildings/brasilia2-small.png -------------------------------------------------------------------------------- /examples/buildings/brasilia2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/buildings/brasilia2.png -------------------------------------------------------------------------------- /examples/buildings/buildings.lua: -------------------------------------------------------------------------------- 1 | 2 | local buildings = osm2pgsql.define_area_table('buildings', { 3 | -- Define an autoincrementing id column, QGIS likes a unique id on the table 4 | { column = 'id', sql_type = 'serial', create_only = true }, 5 | { column = 'geom', type = 'polygon', not_null = true }, 6 | }, { indexes = { 7 | -- So we get an index on the id column 8 | { column = 'id', method = 'btree', unique = true }, 9 | -- If we define any indexes we don't get the default index on the geometry 10 | -- column, so we add it here. 11 | { column = 'geom', method = 'gist' } 12 | }}) 13 | 14 | function osm2pgsql.process_way(object) 15 | if object.is_closed and object.tags.building then 16 | buildings:insert({ 17 | geom = object:as_polygon() 18 | }) 19 | end 20 | end 21 | 22 | function osm2pgsql.process_relation(object) 23 | if object.tags.type == 'multipolygon' and object.tags.building then 24 | -- From the relation we get multipolygons... 25 | local mp = object:as_multipolygon() 26 | -- ...and split them into polygons which we insert into the table 27 | for geom in mp:geometries() do 28 | buildings:insert({ 29 | geom = geom 30 | }) 31 | end 32 | end 33 | end 34 | 35 | -------------------------------------------------------------------------------- /examples/buildings/create-building-example.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget https://download.geofabrik.de/south-america/brazil/centro-oeste-latest.osm.pbf 4 | 5 | wget -O federal-district.osm https://www.openstreetmap.org/api/0.6/relation/421151/full 6 | 7 | osmium extract -p federal-district.osm -o brasilia.osm.pbf centro-oeste-latest.osm.pbf 8 | 9 | osm2pgsql -d mbuildings -O flex -S buildings.lua brasilia.osm.pbf 10 | 11 | psql mbuildings -c "CREATE UNIQUE INDEX ON buildings (id);" 12 | 13 | -------------------------------------------------------------------------------- /examples/buildings/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: examples 3 | title: Building Map 4 | --- 5 | 6 | Map with buildings of a section of Brasília 7 | {:.flright} 8 | 9 | *You need at least osm2pgsql version 1.7.0 for this example.* 10 | 11 | You don't always have to load all the OSM data into the database to create 12 | something useful (or beautiful). In this example we take the data from a city 13 | and only load the building footprints into the database. The whole process only 14 | takes a few seconds and we can show a pretty map. 15 | 16 | As example city we are using 17 | [Brasília](https://en.wikipedia.org/wiki/Bras%C3%ADlia) here, the capital of 18 | Brazil. As I write this, it isn't fully mapped yet, some buildings are missing. 19 | But the distinctive shape of this planned city shows up nevertheless. 20 | 21 | ## Getting and Preparing the Data 22 | 23 | First, we need some data. The smallest extract available from the [Geofabrik 24 | Download server](https://download.geofabrik.de/) containing the city is the 25 | "centro-oeste" region. Let's download that: 26 | 27 | ```sh 28 | wget https://download.geofabrik.de/south-america/brazil/centro-oeste-latest.osm.pbf 29 | ``` 30 | 31 | A quick search on the OSM web site find the [Distrito 32 | Federal](https://www.openstreetmap.org/relation/421151) as a good boundary 33 | of the area of interest. If we scroll down to the end of the box on the left 34 | side of that page we find a link "Download XML". We get the URL from that 35 | and add "/full" to the end. Downloading that gives us the relation containing 36 | the boundary including all ways and nodes needed: 37 | 38 | ```sh 39 | wget -O federal-district.osm https://www.openstreetmap.org/api/0.6/relation/421151/full 40 | ``` 41 | 42 | We can now use [Osmium](https://osmcode.org/osmium-tool/) to create an extract 43 | containing only the data inside the Distrito Federal from the "centro-oeste" 44 | region: 45 | 46 | ```sh 47 | osmium extract -p federal-district.osm -o brasilia.osm.pbf centro-oeste-latest.osm.pbf 48 | ``` 49 | 50 | The result is the file `brasilia.osm.pbf` containing all OSM data for the 51 | federal district. 52 | 53 | ## Running Osm2pgsql 54 | 55 | Now we import this data into the database with osm2pgsql. First we need a 56 | style file for the flex output that only imports the buildings. We need a 57 | single table with a polygon geometry. Because we don't need any tags in the 58 | database, we don't import them. 59 | 60 | {% include download.html file="buildings.lua" %} 61 | 62 | ```lua 63 | {%- include_relative buildings.lua -%} 64 | ``` 65 | 66 | Now we load the data: 67 | 68 | ```sh 69 | osm2pgsql -d mbuildings -O flex -S buildings.lua brasilia.osm.pbf 70 | ``` 71 | 72 | ## Visualizing 73 | 74 | There are many ways to visualize the data now. In this case I loaded the data 75 | into [QGIS](https://qgis.org) which has excellent support for 76 | PostgreSQL/PostGIS layers. After a few clicks loading the database table and 77 | changing the style, I got this: 78 | 79 | Building map of Brasília 80 | 81 | -------------------------------------------------------------------------------- /examples/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Examples 3 | --- 4 | 5 | # Examples 6 | 7 | {%- include examples.md -%} 8 | 9 | -------------------------------------------------------------------------------- /examples/poi-db/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: examples 3 | title: Creating a POI map 4 | --- 5 | 6 | *You need at least osm2pgsql version 1.7.0 for this example.* 7 | 8 | Points of Interest (POI) such as restaurants, shops, etc. can be mapped in OSM 9 | in two different ways. Either as nodes, i. e. as a single point, or as closed 10 | ways, usually with an additional `building` tag. When you want to show POIs on 11 | the map you often don't need to render the buildings they are in, you just need 12 | a single location where to put an icon. 13 | 14 | With osm2pgsql this is easily done. Here is the Lua configuration: 15 | 16 | {% include download.html file="pois.lua" %} 17 | 18 | ```lua 19 | {%- include_relative pois.lua -%} 20 | ``` 21 | 22 | Building map of Brasília 23 | {:.flright} 24 | 25 | We define a single table called `pois` with a point geometry column, a column 26 | for the name of the POI and class and subclass columns for the type. Most 27 | POIs will either have an `amenity` or a `shop` tag, the tag key will be written 28 | to the `class` column of the table, the tag value to the `subclass` column. 29 | You can extend this with other POI types or filter the data as needed. 30 | 31 | For nodes we get the point geometry directly. For ways we get the polygon 32 | geometry and calculate the centroid (center point) from it. If something 33 | fails, because the way is not a valid polygon, the geometry will be null 34 | and nothing is written to the database because of the `NOT NULL` declaration 35 | of the geometry column. 36 | 37 | To load the data, create a PostGIS database `pois` as usual and then run 38 | osm2pgsql with some OSM data extract or the planet file: 39 | 40 | ```sh 41 | osm2pgsql -d pois -O flex -S pois.lua input.osm.pbf 42 | ``` 43 | 44 | For the image on the right we used an extract of the city of Berlin using 45 | different colored dots for the different types of POIs. In a real map you'll 46 | probably use icons of course. 47 | 48 | -------------------------------------------------------------------------------- /examples/poi-db/pois-berlin-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/poi-db/pois-berlin-small.png -------------------------------------------------------------------------------- /examples/poi-db/pois-berlin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/poi-db/pois-berlin.png -------------------------------------------------------------------------------- /examples/poi-db/pois.lua: -------------------------------------------------------------------------------- 1 | 2 | local pois = osm2pgsql.define_table({ 3 | name = 'pois', 4 | ids = { type = 'any', type_column = 'osm_type', id_column = 'osm_id' }, 5 | columns = { 6 | { column = 'name' }, 7 | { column = 'class', not_null = true }, 8 | { column = 'subclass' }, 9 | { column = 'geom', type = 'point', not_null = true }, 10 | }}) 11 | 12 | function process_poi(object, geom) 13 | local a = { 14 | name = object.tags.name, 15 | geom = geom 16 | } 17 | 18 | if object.tags.amenity then 19 | a.class = 'amenity' 20 | a.subclass = object.tags.amenity 21 | elseif object.tags.shop then 22 | a.class = 'shop' 23 | a.subclass = object.tags.shop 24 | else 25 | return 26 | end 27 | 28 | pois:insert(a) 29 | end 30 | 31 | function osm2pgsql.process_node(object) 32 | process_poi(object, object:as_point()) 33 | end 34 | 35 | function osm2pgsql.process_way(object) 36 | if object.is_closed and object.tags.building then 37 | process_poi(object, object:as_polygon():centroid()) 38 | end 39 | end 40 | 41 | -------------------------------------------------------------------------------- /examples/raster-tiles/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: examples 3 | title: Raster Tiles 4 | css: 5 | - /css/ol.css 6 | javascript: 7 | - /js/ol.js 8 | --- 9 | 10 | This is the "classical" job of osm2pgsql: Import data into a database, then use 11 | Mapnik or another rendering engine to create raster tiles from the data. 12 | 13 | The "standard" OSM map you see below and on 14 | [openstreetmap.org](https://www.openstreetmap.org/){:.extlink} uses osm2pgsql, 15 | the [Mapnik](https://mapnik.org){:.extlink} renderer and the [OpenStreetMap 16 | Carto](https://github.com/gravitystorm/openstreetmap-carto){:.extlink} style. 17 | Some more information about it is [on the OSM 18 | wiki](https://wiki.openstreetmap.org/wiki/Standard_tile_layer){:.extlink}. Many 19 | other maps use a similar setup. 20 | 21 | To learn more about how to set up a raster tile server see 22 | [switch2osm](https://switch2osm.org/serving-tiles/){:.extlink}. 23 | 24 |
          25 | 40 | -------------------------------------------------------------------------------- /examples/raster-tiles/tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/raster-tiles/tiles.png -------------------------------------------------------------------------------- /examples/raw-data-publication/indian-restaurants.geojson: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "type": "FeatureCollection", 4 | "features": [ 5 | { 6 | "type": "Feature", 7 | "geometry": { 8 | "type": "Point", 9 | "coordinates": [ 10 | 8.6927426, 11 | 49.4136089 12 | ] 13 | }, 14 | "properties": { 15 | "cuisine": "indian", 16 | "name": "Moghul Tandoori Restaurant", 17 | "osm_id": 364775613 18 | } 19 | }, 20 | { 21 | "type": "Feature", 22 | "geometry": { 23 | "type": "Point", 24 | "coordinates": [ 25 | 8.6894351, 26 | 49.3813154 27 | ] 28 | }, 29 | "properties": { 30 | "cuisine": "indian", 31 | "name": "Indian Palace", 32 | "osm_id": 767280961 33 | } 34 | }, 35 | { 36 | "type": "Feature", 37 | "geometry": { 38 | "type": "Point", 39 | "coordinates": [ 40 | 8.6916832, 41 | 49.4060867 42 | ] 43 | }, 44 | "properties": { 45 | "cuisine": "indian", 46 | "name": "Saffron", 47 | "osm_id": 309437260 48 | } 49 | }, 50 | { 51 | "type": "Feature", 52 | "geometry": { 53 | "type": "Point", 54 | "coordinates": [ 55 | 8.6667154, 56 | 49.3779958 57 | ] 58 | }, 59 | "properties": { 60 | "cuisine": "indian", 61 | "name": "Athidhi Heidelberg", 62 | "osm_id": 4367363371 63 | } 64 | }, 65 | { 66 | "type": "Feature", 67 | "geometry": { 68 | "type": "Point", 69 | "coordinates": [ 70 | 8.6735594, 71 | 49.4081527 72 | ] 73 | }, 74 | "properties": { 75 | "cuisine": "indian", 76 | "name": "Taj Mahal", 77 | "osm_id": 269790792 78 | } 79 | } 80 | ], 81 | "numberReturned": 5, 82 | "timeStamp": "2023-10-01T12:47:52+02:00", 83 | "links": [ 84 | { 85 | "href": "http://localhost:9000/collections/public.restaurants/items", 86 | "rel": "self", 87 | "type": "application/json", 88 | "title": "This document as JSON" 89 | }, 90 | { 91 | "href": "http://localhost:9000/collections/public.restaurants/items.html", 92 | "rel": "alternate", 93 | "type": "text/html", 94 | "title": "This document as HTML" 95 | } 96 | ] 97 | } 98 | -------------------------------------------------------------------------------- /examples/raw-data-publication/pg_featureserv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/raw-data-publication/pg_featureserv.jpg -------------------------------------------------------------------------------- /examples/raw-data-publication/restaurants.lua: -------------------------------------------------------------------------------- 1 | 2 | local restaurants = osm2pgsql.define_table({ 3 | name = 'restaurants', 4 | ids = { type = 'any', id_column = 'osm_id' }, 5 | columns = { 6 | { column = 'name', type = 'text' }, 7 | { column = 'cuisine', type = 'text' }, 8 | { column = 'geom', type = 'point', projection = 4326, not_null = true } 9 | } 10 | }) 11 | 12 | function osm2pgsql.process_node(object) 13 | if object.tags.amenity == 'restaurant' then 14 | restaurants:insert( 15 | { 16 | name = object.tags.name, 17 | cuisine = object.tags.cuisine, 18 | geom = object:as_point() 19 | } 20 | ) 21 | end 22 | end 23 | 24 | function osm2pgsql.process_way(object) 25 | if object.tags.amenity == 'restaurant' and object.is_closed then 26 | restaurants:insert( 27 | { 28 | name = object.tags.name, 29 | cuisine = object.tags.cuisine, 30 | geom = object:as_polygon():centroid() 31 | } 32 | ) 33 | end 34 | end 35 | 36 | function osm2pgsql.process_relation(object) 37 | if object.tags.amenity == 'restaurant' and object.tags.type == 'multipolygon' then 38 | restaurants:insert( 39 | { 40 | name = object.tags.name, 41 | cuisine = object.tags.cuisine, 42 | geom = object:as_multipolygon():centroid() 43 | } 44 | ) 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /examples/road-length/highways.lua: -------------------------------------------------------------------------------- 1 | 2 | local tables = {} 3 | 4 | tables.highways = osm2pgsql.define_way_table('highways', { 5 | { column = 'type', type = 'text' }, 6 | { column = 'geom', type = 'linestring', projection = 4326 }, 7 | }) 8 | 9 | tables.boundaries = osm2pgsql.define_area_table('boundaries', { 10 | { column = 'tags', type = 'jsonb' }, 11 | { column = 'geom', type = 'geometry', projection = 4326 }, 12 | }) 13 | 14 | function osm2pgsql.process_way(object) 15 | if object.tags.highway then 16 | tables.highways:insert{ 17 | type = object.tags.highway, 18 | geom = object:as_linestring() 19 | } 20 | end 21 | end 22 | 23 | function osm2pgsql.process_relation(object) 24 | if object.tags.boundary == 'administrative' then 25 | tables.boundaries:insert{ 26 | tags = object.tags, 27 | geom = object:as_multipolygon() 28 | } 29 | end 30 | end 31 | 32 | -------------------------------------------------------------------------------- /examples/vector-tiles/.gitignore: -------------------------------------------------------------------------------- 1 | tiles 2 | -------------------------------------------------------------------------------- /examples/vector-tiles/Brussels_signs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/vector-tiles/Brussels_signs.jpg -------------------------------------------------------------------------------- /examples/vector-tiles/create-vector-tiles-example.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget https://download.geofabrik.de/europe/belgium-latest.osm.pbf 4 | 5 | osmium extract -b 4.29,50.815,4.47,50.90 belgium-latest.osm.pbf -o brussels.osm.pbf 6 | 7 | osm2pgsql -d brussels -O flex -S streets.lua brussels.osm.pbf 8 | 9 | -------------------------------------------------------------------------------- /examples/vector-tiles/streets-of-brussels-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/vector-tiles/streets-of-brussels-small.png -------------------------------------------------------------------------------- /examples/vector-tiles/streets-of-brussels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/examples/vector-tiles/streets-of-brussels.png -------------------------------------------------------------------------------- /examples/vector-tiles/streets.lua: -------------------------------------------------------------------------------- 1 | 2 | local streets = osm2pgsql.define_way_table('streets', { 3 | { column = 'type', type = 'text' }, 4 | { column = 'name', type = 'text' }, 5 | { column = 'name_fr', type = 'text' }, 6 | { column = 'name_nl', type = 'text' }, 7 | { column = 'tags', type = 'jsonb' }, 8 | { column = 'geom', type = 'linestring' }, 9 | }) 10 | 11 | local get_highway_value = osm2pgsql.make_check_values_func({ 12 | 'motorway', 'trunk', 'primary', 'secondary', 'tertiary', 13 | 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link', 14 | 'unclassified', 'residential', 'pedestrian' 15 | }) 16 | 17 | function osm2pgsql.process_way(object) 18 | local highway_type = get_highway_value(object.tags.highway) 19 | 20 | if not highway_type then 21 | return 22 | end 23 | 24 | if object.tags.area == 'yes' then 25 | return 26 | end 27 | 28 | streets:insert({ 29 | type = highway_type, 30 | tags = object.tags, 31 | name = object.tags.name, 32 | name_fr = object.tags['name:fr'], 33 | name_nl = object.tags['name:nl'], 34 | geom = object:as_linestring(), 35 | }) 36 | end 37 | 38 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/favicon.ico -------------------------------------------------------------------------------- /fonts/Mulish-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/fonts/Mulish-Bold.woff -------------------------------------------------------------------------------- /fonts/Mulish-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/fonts/Mulish-Bold.woff2 -------------------------------------------------------------------------------- /fonts/Mulish-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/fonts/Mulish-Medium.woff -------------------------------------------------------------------------------- /fonts/Mulish-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/fonts/Mulish-Medium.woff2 -------------------------------------------------------------------------------- /fonts/Mulish-MediumItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/fonts/Mulish-MediumItalic.woff -------------------------------------------------------------------------------- /fonts/Mulish-MediumItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/fonts/Mulish-MediumItalic.woff2 -------------------------------------------------------------------------------- /fonts/Mulish-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/fonts/Mulish-Regular.woff -------------------------------------------------------------------------------- /fonts/Mulish-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/fonts/Mulish-Regular.woff2 -------------------------------------------------------------------------------- /generalization/bmbf-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/generalization/bmbf-logo.png -------------------------------------------------------------------------------- /img/apple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/apple.png -------------------------------------------------------------------------------- /img/arch.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 55 | 59 | 60 | -------------------------------------------------------------------------------- /img/download.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | download 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /img/feed.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /img/info.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /img/infolink.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /img/linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/linux.png -------------------------------------------------------------------------------- /img/logo-800.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/logo-800.png -------------------------------------------------------------------------------- /img/logo-outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/logo-outline.png -------------------------------------------------------------------------------- /img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/logo.png -------------------------------------------------------------------------------- /img/mollweide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/mollweide.png -------------------------------------------------------------------------------- /img/news/1000-stars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/news/1000-stars.png -------------------------------------------------------------------------------- /img/osm-help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/osm-help.png -------------------------------------------------------------------------------- /img/plate-carree.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/plate-carree.jpg -------------------------------------------------------------------------------- /img/postgis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/postgis.png -------------------------------------------------------------------------------- /img/postgresql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/postgresql.png -------------------------------------------------------------------------------- /img/switch2osm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/switch2osm.png -------------------------------------------------------------------------------- /img/ubuntu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/ubuntu.png -------------------------------------------------------------------------------- /img/warning.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /img/web-mercator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/web-mercator.jpg -------------------------------------------------------------------------------- /img/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/windows.png -------------------------------------------------------------------------------- /img/wip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/img/wip.png -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Home 3 | --- 4 | 5 | # osm2pgsql 6 | 7 |
          8 |

          News

          9 | Atom Feed 10 | 11 | {%- for post in site.posts limit: 5 %} 12 | 13 | 14 | {%- endfor %} 15 |
          {{ post.date | date_to_string }}:{{ post.title }}
          16 |
          17 | 18 |
          19 | ## About 20 | 21 | Osm2pgsql is an Open Source tool for importing 22 | [OpenStreetMap](https://www.openstreetmap.org/){:.extlink} (OSM) data into a 23 | PostgreSQL/PostGIS database. Essentially it is a very specialized ETL 24 | (Extract-Transform-Load) tool for OpenStreetMap data. [PostgreSQL 25 | database](https://www.postgresql.org/){:.extlink} is the most advanced Open 26 | Source database, together with the [PostGIS](https://postgis.net/){:.extlink} 27 | extension for handling geographical data it offers an extremely powerful 28 | way of working with OpenStreetMap data. 29 | 30 | Osm2pgsql is an essential part of many services that take OSM data and create 31 | maps from it. It is also used in the Nominatim geocoder and numerous other 32 | applications processing OSM data. 33 | 34 | [More about osm2pgsql:]({% link about/index.md %}) 35 | * [Features]({% link about/features/index.md %}) 36 | * [Project history]({% link about/history/index.md %}) 37 | * [Who is using osm2pgsql?]({% link about/users/index.md %}) 38 |
          39 | 40 |
          41 | 42 | ## Examples 43 | 44 | {%- include examples.md -%} 45 | 46 |
          47 | 48 |
          49 | 50 | ## Sponsors 51 | 52 | Developing and supporting osm2pgsql takes a huge amount of effort. We thank the 53 | following companies and organizations for their support: 54 | 55 | {% include sponsors.md %} 56 | 57 |
          58 | -------------------------------------------------------------------------------- /news/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: News 3 | --- 4 | 5 | Atom Feed 6 | {:.flright} 7 | 8 | # News 9 | 10 |
          11 | {% for post in site.posts %} 12 | 20 | {% endfor %} 21 |
          22 | -------------------------------------------------------------------------------- /releases/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Releases 3 | --- 4 | 5 | # Releases 6 | 7 |
          8 | {% assign sortedreleases = site.releases | sort: 'date' | reverse %} 9 | {% for release in sortedreleases -%} 10 |
          11 | Release {{ release.version }} ({{ release.date | date: "%Y-%m-%d" }}) 12 |
            13 | {% for hl in release.highlights -%} 14 |
          • {{ hl }}
          • 15 | {% endfor -%} 16 |
          17 |
          18 | {% endfor -%} 19 |
          20 | 21 |
          22 | 23 | ## Older Releases 24 | 25 | For older releases see [the Github releases 26 | page](https://github.com/osm2pgsql-dev/osm2pgsql/releases){:.extlink}. 27 | 28 |
          29 | 30 | -------------------------------------------------------------------------------- /robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /css 3 | Disallow: /img 4 | Disallow: /contribute/dependencies.html 5 | -------------------------------------------------------------------------------- /sponsors/fossgis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/sponsors/fossgis.png -------------------------------------------------------------------------------- /sponsors/geofabrik.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sponsors/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Sponsors 3 | --- 4 | 5 | # Sponsors 6 | 7 | Developing and supporting osm2pgsql takes a huge amount of effort. We thank the 8 | following companies and organizations for their support: 9 | 10 |
          11 | {% include sponsors.md %} 12 |
          13 | 14 | We need more and ongoing sponsorship to keep osm2pgsql as a reliable and modern 15 | software. If you want to help, contact a developer of your choice directly 16 | ([see under Commercial Support](/support#commercial-support)). We can discuss 17 | options with you. 18 | 19 | We are currently not set up to receive small donations. If you want to donate 20 | small amounts of money, we suggest you support the [OpenStreetMap 21 | Foundation](https://osmfoundation.org/){:.extlink} or one of its local chapters. 22 | 23 | Former Sponsors: 24 | 25 | * 2020: OpenStreetMap Foundation 26 | 27 | -------------------------------------------------------------------------------- /sponsors/osmfoundation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/sponsors/osmfoundation.png -------------------------------------------------------------------------------- /sponsors/sovereign_tech_fellowship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osm2pgsql-dev/osm2pgsql-website/d6f82f6f649fa0b26027e6c2052e111db80cb6b0/sponsors/sovereign_tech_fellowship.png --------------------------------------------------------------------------------