[Tile-serving] [openstreetmap/osm2pgsql] What does --middle-with-nodes do exactly? (Discussion #2012)

mboeringa notifications at github.com
Mon Jul 24 15:49:51 UTC 2023


I have been testing with the latest master, which includes the changes for the new 'middle', by setting both:

`--middle-database-format=new`

and 

`--middle-with-nodes`

Now, the osm2pgsql manual is kind of brief and mildly ambiguous regarding the **--middle-with-nodes** option:

https://osm2pgsql.org/doc/manual.html#middle-command-line-options

> Version >= 1.9.0 Used together with the new middle database format when a flat nodes file is used to force storing nodes with tags in the database, too.

Am I right that **--middle-with-nodes** will add any node that is part of a way or relation _if is tagged_ to the 'planet_osm_point' table, where previous versions of osm2pgsql would simply ignore a tagged node if it was part of a way or relation? I vaguely remember reading about this change, but could not find the reference to this new option again.

If this is indeed the case, shouldn't this option be default _if a user specifies the **new** 'middle' format_? The main reason for not storing these nodes was a technical one if I understood it. Now that the technical challenge seems to have been overcome, it seems only logical to have this option on by default, I see little reason not to want to have this option on by default, it just makes the resulting data more complete.

This might even allow dropping the **--middle-with-nodes** command line option altogether from osm2pgsql, saving one extra command line option. 

The only drawback might be that, as I witnessed, one may need extra storage, as I noticed osm2pgsql seems to create the **--flat-nodes** file and **--middle-database-format=new** 'planet_osm_nodes' table in parallel, while previously specifying **--flat-nodes** would prevent the creation of the 'planet_osm_nodes' table.

In terms of performance, the impact of specifying the new 'middle' options, including **--middle-with-nodes** versus 'legacy' seems absolutely minimal. On Planet, it maybe just adds 15 minutes extra import time.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/discussions/2012
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/osm2pgsql/repo-discussions/2012 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20230724/6e379fbc/attachment.htm>


More information about the Tile-serving mailing list