[Tile-serving] [openstreetmap/osm2pgsql] Can stage 2 flex processing dissolve line geometries? (Discussion #1595)

mboeringa notifications at github.com
Tue Dec 21 18:27:17 UTC 2021


Hi @joto,

Thanks. After re-reading the documentation, I realized this as well. 

I have now been able though, using the information of the osm2pgsql manual, to adjust the osm2pgsql Lua flex style file, to have osm2pgsql output an extra column in the 'planet-osm-admin' table, that now includes the OSM IDs of the two boundary relations making up a border line. See the attached image, where the column highlighted in red contains a semi-colon concatenated list of the corresponding OSM IDs. This actually makes the **multiple_relations** boolean column, that Paul initially added, superfluous, and I will probably drop it in favor of the new more informative column.

The blue highlighted section, shows the ways conforming to the Liechtenstein (OSM ID '1155955') and Switzerland (OSM ID '51701') border, also see the second image for the selection displayed spatially.

This means it should now be a breeze to dissolve the lines by simply selecting the **relation_ids** column as input for the dissolve process.

It actually cost me two days to figure out how to do it, as I was initially mis-interpreting the documentation and how osm2psql processes the data and Lua file, and the Lua flex style code, thinking it would require adjustments to the **osm2pgsql.process_relation()** function, while in the end, it turned out to only require minimal changes to Paul's well structured work, and the addition of just a few lines of code in a few specific places.

![afbeelding](https://user-images.githubusercontent.com/7635726/146978320-de4725e6-bcd0-4c91-93ba-cc161dd1c5b9.png)

![afbeelding](https://user-images.githubusercontent.com/7635726/146979007-49fea72b-4293-4051-b801-b3ad1de6b092.png)



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

Message ID: <openstreetmap/osm2pgsql/repo-discussions/1595/comments/1854351 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20211221/539981a2/attachment.htm>


More information about the Tile-serving mailing list