<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://osm2pgsql.org/news/feed.xml" rel="self" type="application/atom+xml" /><link href="https://osm2pgsql.org/" rel="alternate" type="text/html" /><updated>2026-02-22T10:09:56+01:00</updated><id>https://osm2pgsql.org/news/feed.xml</id><title type="html">osm2pgsql</title><subtitle>osm2pgsql</subtitle><entry><title type="html">Test Your Styles with the New Style Tester</title><link href="https://osm2pgsql.org/news/2025/12/04/style-tester.html" rel="alternate" type="text/html" title="Test Your Styles with the New Style Tester" /><published>2025-12-04T00:00:00+01:00</published><updated>2025-12-04T16:24:43+01:00</updated><id>https://osm2pgsql.org/news/2025/12/04/style-tester</id><content type="html" xml:base="https://osm2pgsql.org/news/2025/12/04/style-tester.html"><![CDATA[<p>Styles (configurations) for osm2pgsql are written in the Lua programming
language. And they are becoming more complex. Users have been asking for a long
time for some way of testing those styles to help with writing and debugging
the Lua code. We now have a solution for you.</p>

<p>We have had tests for osm2pgsql, the software, for a long time. This includes
tests that run osm2pgsql with certain inputs and parameters and check that
osm2pgsql produces the correct output, including checks that make sure the
correct information ends up in the correct database tables. These kinds of
tests are really similar to what users need, but the tests were deeply
integrated with the rest of the osm2pgsql testing system, they were hard to
use, and they were not documented.</p>

<p>We have polished that testing framework, documented it and made it work on its
own and are now making it available for osm2pgsql users. So you can now use the
same testing engine used for internal testing to test your style sheets. The
test code builds upon the Python BDD <a href="https://behave.readthedocs.io/">behave</a>
testing framework, and adds all sorts of useful features to the tests. OSM test
data can be integrated in various ways, inline in the test file or as external
data. And we have added various handy features for testing database content.</p>

<p>Style testing will be available in the next version of osm2pgsql, but you can
already try it out. You only need to download a <a href="https://github.com/osm2pgsql-dev/osm2pgsql/blob/master/scripts/osm2pgsql-test-style">single
file</a>
from the current master and can use that with any reasonably modern version
of osm2pgsql. Find the full documentation in <a href="https://osm2pgsql.org/doc/manual.html#style-testing">the
manual</a>.</p>

<p>We’d love it if you tried the new style tester and tell us what you think. We
are sure there will be some teething problems you can help us find and fix
before the next release.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Styles (configurations) for osm2pgsql are written in the Lua programming language. And they are becoming more complex. Users have been asking for a long time for some way of testing those styles to help with writing and debugging the Lua code. We now have a solution for you.]]></summary></entry><entry><title type="html">Release 2.2.0</title><link href="https://osm2pgsql.org/news/2025/09/17/release-2.2.0.html" rel="alternate" type="text/html" title="Release 2.2.0" /><published>2025-09-17T00:00:00+02:00</published><updated>2025-09-17T20:23:21+02:00</updated><id>https://osm2pgsql.org/news/2025/09/17/release-2.2.0</id><content type="html" xml:base="https://osm2pgsql.org/news/2025/09/17/release-2.2.0.html"><![CDATA[<p>We are excited to publish version 2.2.0 of osm2pgsql. This release adds two powerful building blocks that can be used to implement all sorts of new features. The new “Locators” and the “deleted callbacks” features seem simple by themselves, but they can be used as basis for many features that have been requested for years.</p>

<h2 id="new-locator-feature">New Locator feature</h2>

<p>This release introduces a new feature: Locators. They help with a common problem, namely how to quickly find out in which region an OSM object is. The region can be a country or any other area. A locator is initialized with one or more regions, each region has a name and a polygon or bounding box. A geometry of an OSM object can then be checked against this region list to figure out in which region(s) it is located. This check is much faster than it would be to do this inside the database after import.</p>

<p>Locators can be used for all sorts of interesting features, for instance:</p>

<ul>
  <li>Read larger OSM file but import only data inside some area.</li>
  <li>Annotate each OSM object with the country (or other region) it is in. This can then, for instance, be used to show special highway shields for each country.</li>
  <li>Use the information which region the data is in for further processing, for instance setting of default values for the speed limit or using special language transliterations rules based on country.</li>
</ul>

<p>For details see the <a href="https://osm2pgsql.org/doc/manual.html#locators">manual</a> and look at the example config files provided in the flex-config/locator directory.</p>

<h2 id="callbacks-for-deleted-objects">Callbacks for deleted objects</h2>

<p>The Lua callback functions <code class="language-plaintext highlighter-rouge">process_node()</code>, <code class="language-plaintext highlighter-rouge">process_way()</code>, and <code class="language-plaintext highlighter-rouge">process_relation()</code> (and their <code class="language-plaintext highlighter-rouge">untagged</code> companions) only get called for new or changed OSM objects. Deleted objects are usually handled behind the scenes and for most use cases this is enough.</p>

<p>But sometimes it is useful to also know when an object was deleted. That’s why we have new <code class="language-plaintext highlighter-rouge">process_deleted_node/way/relation()</code> callbacks now. These open up a lot of new processing options for working with changes. Some users do advanced processing of OSM data inside the database after the data is imported with osm2pgsql. This is much easier now because you don’t need database triggers anymore to detect and process deleted objects.</p>

<h2 id="new-osm2pgsql-expire-command">New osm2pgsql-expire command</h2>

<p>We have added a osm2pgsql-expire command. It is currently marked as experimental so it might change without notice. You can use it to turn entries in expire files (that look like <code class="language-plaintext highlighter-rouge">ZOOM/X/Y</code>) into a GeoJSON file visualizing the tiles. When given an OSM data file it can generate the tile output (in expire file format or as GeoJSON). This tool is intended as a debugging aid.</p>

<h2 id="other-features-and-fixes">Other features and fixes</h2>

<ul>
  <li>Fix: Ways and relations that didn’t change themselves but were processed due to some of their members changing were always send to the normal <code class="language-plaintext highlighter-rouge">process_node/way/relation()</code> callback even if they had no tags. This is now fixed, the <code class="language-plaintext highlighter-rouge">process_untagged_*()</code> callbacks are called instead.</li>
  <li>Fix problem when detecting PostGIS version at the start of osm2pgsql. If the PostGIS version can not be detected, we report that properly.</li>
  <li>Allow both <code class="language-plaintext highlighter-rouge">--username</code> and <code class="language-plaintext highlighter-rouge">--user</code> command line options in all commands, there was an inconsistency between osm2pgsql and osm2pgsql-replication before.</li>
  <li>When using the RAM middle, untagged nodes that were members of a relation were not found when building the geometry for that relation. This is now fixed and MultiPoint and GeometryCollection geometries are built correctly.</li>
  <li>Fixed bounding box calculation for relations with node members.</li>
  <li>Reworked README.md, CONTRIBUTING.md and Contribution Guide on the website.</li>
  <li>Refactored a lot of the boilerplate code handling the Lua integration. This code is now shorter and easier to understand and maintain.</li>
  <li>Fixed bugs in wildcard matching of old C transforms.</li>
  <li>Fixed and improved tests around index creation.</li>
  <li>Finally fixed the last warnings reported by clang-tidy, see https://osm2pgsql.org/news/2025/08/21/zero-warnings.html, from now on new code is only allowed in if it checks cleanly with clang-tidy.</li>
  <li>Various cleanups in flex example config files.</li>
  <li>Lots of code cleanups, mainly to bring naming and formatting to a consistent state.</li>
  <li>As always, some code was refactored and there were many small fixes to the code and docs.</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[We are excited to publish version 2.2.0 of osm2pgsql. This release adds two powerful building blocks that can be used to implement all sorts of new features. The new “Locators” and the “deleted callbacks” features seem simple by themselves, but they can be used as basis for many features that have been requested for years.]]></summary></entry><entry><title type="html">Updated Contributor Docs</title><link href="https://osm2pgsql.org/news/2025/08/25/developer-docs-updated.html" rel="alternate" type="text/html" title="Updated Contributor Docs" /><published>2025-08-25T00:00:00+02:00</published><updated>2025-08-25T16:06:17+02:00</updated><id>https://osm2pgsql.org/news/2025/08/25/developer-docs-updated</id><content type="html" xml:base="https://osm2pgsql.org/news/2025/08/25/developer-docs-updated.html"><![CDATA[<p>Over the last few weeks we have updated and overhauled the “Contributing”
section on the osm2pgsql website. We want to make it easier for users and
contributors to understand what our plans are for osm2pgsql, what are the
open issues and what you can do to help.</p>

<p>The new <a href="/contribute/">Contributing Overview</a> no longer
focuses on coding because there are so many more ways to help the project
than with code. Whether you are a user, have ideas on improving the
documentation, or want to show your use case, everything helps to make
osm2pgsql better.</p>

<p>We have also updated the <a href="/about/road-map.html">road map</a> with the
most important milestones for getting to the next major release 3. If you
are looking at a concrete project to work on, have a look at the updated
<a href="/contribute/project-ideas.html">project ideas</a>.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[Over the last few weeks we have updated and overhauled the “Contributing” section on the osm2pgsql website. We want to make it easier for users and contributors to understand what our plans are for osm2pgsql, what are the open issues and what you can do to help.]]></summary></entry><entry><title type="html">Achievement unlocked: Zero Warnings</title><link href="https://osm2pgsql.org/news/2025/08/21/zero-warnings.html" rel="alternate" type="text/html" title="Achievement unlocked: Zero Warnings" /><published>2025-08-21T00:00:00+02:00</published><updated>2025-08-21T11:21:38+02:00</updated><id>https://osm2pgsql.org/news/2025/08/21/zero-warnings</id><content type="html" xml:base="https://osm2pgsql.org/news/2025/08/21/zero-warnings.html"><![CDATA[<p>New code will probably have some errors, the compiler finds some of them and
refuses to produce the final program. So far so good. But code also contains
lots of issues that are not outright errors, they just look “suspicious” to the
compiler in one way or another. Some of them turn out to be actual errors, but
sometimes the code is totally okay in the specific context. The compiler can’t
tell for sure, so it emits a warning and keeps going. Different compilers and
different versions of those compilers print different warnings.</p>

<p>And then there are things that are not problems by themselves, they just make
the code harder to read, possibly leading to more problems down the line. Or
sometimes a tool can detect that you are using an “old-fashioned” way of doing
things and there is a better, more modern or more efficient way, to achieve the
same thing. Some of these issues are also detected by the compiler, but for
most programming languages there are extra tools, so called “linters”, that
find those issues. For C++ “clang-tidy” is such a tool.</p>

<p>We have been compiling with lots of warnings enabled for years now. And we have
also been running “clang-tidy” regularly for a long time, chipping away at the
problems mentioned. Some warnings are easily dealt with, but others are more
complicated and need more code changes for a good solution. And in some cases,
after careful consideration, warnings have to be disabled, either for the whole
code or for specific places in the code. Osm2pgsql is 19 years old now, the
first implementation was written in C, along the way we switched to C++98, then
C++11, C++14 and then C++17. So the way things can and should be done changed
over time. New versions of compilers and new versions of clang-tidy came up
with new warnings. As part of our work on osm2pgsql we looked at those warnings
whenever there was time and fixed something here or there. But there was always
another warning, another sometimes very old and sometimes newly introduced
problem. Until now.</p>

<p>For a long time now our code has compiled cleanly with the GCC and Clang
compilers, today we reached the point where it also compiles cleanly on MSVC.
And it passes all checks configured in clang-tidy. To “lock in” that
achievement we have changed the CI settings so that any warnings will show up
as errors blocking us from merging the code. This way we can be sure to keep
the “zero warnings” achievement.</p>

<p>Full disclosure: For some legacy code we have disabled a few warnings. That
part of osm2pgsql is already deprecated and will be removed, it just doesn’t
make sense to spend time fixing code that’s more than a decade old when that
code is going away anyway. Especially as fixing warnings can sometimes
introduce new bugs in the process.</p>

<p>For clang-tidy we enable all checks by default and then selectively disable all
checks that don’t make sense for us. The clang-tidy config file contains
comments explaining why the checks are disabled. We will probably revisit some
decisions on what checks to disable in the future as our code improves further.</p>

<p>This is not the end of our journey to improve the osm2pgsql code, there is
plenty more to do. But it is a major milestone in that it makes sure we are not
sliding back behind what we have already achieved, regardless of any new
changes we make.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[New code will probably have some errors, the compiler finds some of them and refuses to produce the final program. So far so good. But code also contains lots of issues that are not outright errors, they just look “suspicious” to the compiler in one way or another. Some of them turn out to be actual errors, but sometimes the code is totally okay in the specific context. The compiler can’t tell for sure, so it emits a warning and keeps going. Different compilers and different versions of those compilers print different warnings.]]></summary></entry><entry><title type="html">Release 2.1.1</title><link href="https://osm2pgsql.org/news/2025/04/14/release-2.1.1.html" rel="alternate" type="text/html" title="Release 2.1.1" /><published>2025-04-14T00:00:00+02:00</published><updated>2025-04-14T11:39:46+02:00</updated><id>https://osm2pgsql.org/news/2025/04/14/release-2.1.1</id><content type="html" xml:base="https://osm2pgsql.org/news/2025/04/14/release-2.1.1.html"><![CDATA[<p>This is a bug fix release which contains the following:</p>

<ul>
  <li>refuse to update database when the flatnode is missing</li>
  <li>fix regression where writing to tables without a managed id column was not possible</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[This is a bug fix release which contains the following:]]></summary></entry><entry><title type="html">Release 2.1.0</title><link href="https://osm2pgsql.org/news/2025/04/07/release-2.1.0.html" rel="alternate" type="text/html" title="Release 2.1.0" /><published>2025-04-07T00:00:00+02:00</published><updated>2025-04-07T16:38:05+02:00</updated><id>https://osm2pgsql.org/news/2025/04/07/release-2.1.0</id><content type="html" xml:base="https://osm2pgsql.org/news/2025/04/07/release-2.1.0.html"><![CDATA[<p>Today we released version 2.1.0, a bugfix and maintenance release. The main
visible change is that osm2pgsql now works better together with connection
poolers and similar database middleware: prepared statements now use protocol
level prepare instead of <code class="language-plaintext highlighter-rouge">PREPARE</code> SQL commands and there is a new option to
explicitly create a primary key on flex tables.</p>

<p>Other fixes and features:</p>

<ul>
  <li>check flat node file format for forwards compatibility to prepare for future changes of the flatnode file format</li>
  <li>fix two-stage processing when flat node file is used</li>
  <li>fix getting node locations in slim node with two-stage processing</li>
  <li>updated included libosmium, protozero and fmt libraries</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[Today we released version 2.1.0, a bugfix and maintenance release. The main visible change is that osm2pgsql now works better together with connection poolers and similar database middleware: prepared statements now use protocol level prepare instead of PREPARE SQL commands and there is a new option to explicitly create a primary key on flex tables.]]></summary></entry><entry><title type="html">Sovereign Tech Fellowship for osm2pgsql</title><link href="https://osm2pgsql.org/news/2025/02/06/sovereign-tech-fellowship.html" rel="alternate" type="text/html" title="Sovereign Tech Fellowship for osm2pgsql" /><published>2025-02-06T00:00:00+01:00</published><updated>2025-02-06T14:37:31+01:00</updated><id>https://osm2pgsql.org/news/2025/02/06/sovereign-tech-fellowship</id><content type="html" xml:base="https://osm2pgsql.org/news/2025/02/06/sovereign-tech-fellowship.html"><![CDATA[<p>We are happy to announce that osm2pgsql maintainer Sarah has been selected as
one of the fellows for the one-year pilot of the
<a href="https://www.sovereign.tech/news/meet-the-sovereign-tech-fellows">Sovereign Tech Fellowship programme</a>
of the Sovereign Tech Agency. The programme recognises and financially supports
the significant amount of time that goes into the daily maintenance of an
open-source project. Read more about the fellowship in
<a href="https://nominatim.org/2025/02/06/sovereign-tech-fellowship.html">Sarah’s post over at nominatim.org</a>.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[We are happy to announce that osm2pgsql maintainer Sarah has been selected as one of the fellows for the one-year pilot of the Sovereign Tech Fellowship programme of the Sovereign Tech Agency. The programme recognises and financially supports the significant amount of time that goes into the daily maintenance of an open-source project. Read more about the fellowship in Sarah’s post over at nominatim.org.]]></summary></entry><entry><title type="html">Release 2.0.1</title><link href="https://osm2pgsql.org/news/2024/12/02/release-2.0.1.html" rel="alternate" type="text/html" title="Release 2.0.1" /><published>2024-12-02T00:00:00+01:00</published><updated>2024-12-02T09:29:20+01:00</updated><id>https://osm2pgsql.org/news/2024/12/02/release-2.0.1</id><content type="html" xml:base="https://osm2pgsql.org/news/2024/12/02/release-2.0.1.html"><![CDATA[<p>This release fixes some small issues with 2.0.0:</p>

<ul>
  <li>fix forwarding of <code class="language-plaintext highlighter-rouge">--schema</code> parameter from osm2pgsql-replication to osm2pgsql</li>
  <li>install <code class="language-plaintext highlighter-rouge">osm2pgsql_find_changed_ways</code> function in the right schema (thanks @falko17)</li>
  <li>install osm2pgsql-gen binary by default</li>
</ul>]]></content><author><name></name></author><summary type="html"><![CDATA[This release fixes some small issues with 2.0.0:]]></summary></entry><entry><title type="html">Crunchydata is Loading the World</title><link href="https://osm2pgsql.org/news/2024/11/21/crunchydata-is-loading-the-world.html" rel="alternate" type="text/html" title="Crunchydata is Loading the World" /><published>2024-11-21T00:00:00+01:00</published><updated>2024-11-21T10:58:16+01:00</updated><id>https://osm2pgsql.org/news/2024/11/21/crunchydata-is-loading-the-world</id><content type="html" xml:base="https://osm2pgsql.org/news/2024/11/21/crunchydata-is-loading-the-world.html"><![CDATA[<p>A few days ago <a href="https://www.crunchydata.com/">Crunchy Data</a> published a blog
post <a href="https://www.crunchydata.com/blog/loading-the-world-openstreetmap-import-in-under-4-hours">Loading the World! OpenStreetMap Import In Under 4
Hours</a>
showing how improvements in PostgreSQL, osm2pgsql, and the hardware in recent
years have improved the performance of loading the OSM planet into a database
significantly leading to an import time for the planet of less than 4 hours.</p>

<p>They are using some configuration options that are probably not great for
general use, but if you know what you are doing they can give you that extra
edge.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[A few days ago Crunchy Data published a blog post Loading the World! OpenStreetMap Import In Under 4 Hours showing how improvements in PostgreSQL, osm2pgsql, and the hardware in recent years have improved the performance of loading the OSM planet into a database significantly leading to an import time for the planet of less than 4 hours.]]></summary></entry><entry><title type="html">Release 2.0.0</title><link href="https://osm2pgsql.org/news/2024/09/19/release-2.0.0.html" rel="alternate" type="text/html" title="Release 2.0.0" /><published>2024-09-19T00:00:00+02:00</published><updated>2024-09-19T15:52:09+02:00</updated><id>https://osm2pgsql.org/news/2024/09/19/release-2.0.0</id><content type="html" xml:base="https://osm2pgsql.org/news/2024/09/19/release-2.0.0.html"><![CDATA[<p>The day has finally arrived where we are releasing version 2.0.0. of osm2pgsql, five years after the release of 1.0.0.</p>

<p>This release marks a milestone in modernizing osm2pgsql. We removed a lot of accumulated cruft from more than a decade of development. This makes osm2pgsql easier to understand for users and for developers. And it has allowed us to solve some long-standing issues and will allow further improvements in the future.</p>

<p>Major breaking changes:</p>

<ul>
  <li>The legacy format for the middle tables has been removed as well as the old non-bucket way node index.</li>
  <li>The gazetteer output (used by Nominatim) has been removed.</li>
  <li>Several command line options have been removed and others are checked more strictly.</li>
  <li>There are some new library requirements and Lua is not optional any more.</li>
  <li>The <code class="language-plaintext highlighter-rouge">add_row()</code> function in the flex Lua config has been removed, use <code class="language-plaintext highlighter-rouge">insert()</code> instead.</li>
  <li>Check that Lua functions on OSM object are called correctly using the colon-syntax.</li>
  <li>Handling of untagged objects and object attributes has changed.</li>
</ul>

<p>Please see the <a href="https://osm2pgsql.org/doc/manual.html#upgrading">Upgrading appendix</a> in the manual for the details of these changes. We suggest you update to version 1.11.0 first and resolve any issues you see there before upgrading to version 2.0.0.</p>

<p>This is the first release that deprecates the “pgsql” output, please start moving towards the “flex” output instead. See <a href="https://osm2pgsql.org/doc/faq.html#the-pgsql-output-is-deprecated-what-does-that-mean">this FAQ entry</a> for the details.</p>

<p>New features in the flex output:</p>

<ul>
  <li>Two-stage processing now also supports node members of relations, not only way members</li>
  <li>Optionally build id index as unique index</li>
  <li>Allow setting the names of indexes in the database</li>
  <li>
    <table>
      <tbody>
        <tr>
          <td>New after_nodes</td>
          <td>ways</td>
          <td>relations() processing functions in flex Lua config files</td>
        </tr>
      </tbody>
    </table>
  </li>
  <li>Make osm2pgsql properties available in Lua in osm2pgsql.properties table</li>
  <li>Add get_bbox() function to geometries in Lua</li>
  <li>Allow empty config file in flex output, useful for some corner uses</li>
</ul>

<p>Changes in the generalization code:</p>

<ul>
  <li>Add tile-based generalizer calling SQL commands</li>
  <li>Fix: Do not run ANALYZE in append mode, autovacuum will do that for us</li>
  <li>Fix: Handle errors in threads correctly stopping the program with an error message</li>
</ul>

<p>Other fixes and features:</p>

<ul>
  <li>Make –flat-nodes also work in non-slim mode, useful if memory is tight</li>
  <li>Fix off-by-one error in expire code generating out of bounds tiles</li>
  <li>Property changes are stored later to database to avoid changing the database if anything breaks</li>
  <li>Report (up to 100) missing nodes in the input file (in debug log)</li>
  <li>Simplified code for area assembly from multipolygon relations</li>
  <li>Replication: guess state from file when state info is not available</li>
  <li>Flush and close COPYs after nodes, ways, and relations in flex output avoid COPYs that are open for a long time</li>
  <li>Remove special case for old PostGIS versions when clustering</li>
  <li>Avoid looking for parents of new nodes and ways in the database middle speeding up changes</li>
  <li>As always: Lots of code cleanups, refactorings and small fixes</li>
</ul>

<p>Many thanks to <a href="https://www.thunderforest.com/">Thunderforest</a> for their
continued support.</p>]]></content><author><name></name></author><summary type="html"><![CDATA[The day has finally arrived where we are releasing version 2.0.0. of osm2pgsql, five years after the release of 1.0.0.]]></summary></entry></feed>