[Tile-serving] [osm2pgsql-dev/osm2pgsql] How can I figure out exactly what ways (roads, tracks) have changed based on an OSC OsmChange file? (Discussion #2144)

Jochen Topf notifications at github.com
Thu Mar 21 21:51:40 UTC 2024


Osm2pgsql already has the logic to detect what kind of changes need to be done based on the changes of the diff file. You don't want to reimplement that. Unfortunately there is currently no good support in osm2pgsql for your use case where osm2pgsql isn't doing all the processing but some extra processing needs to be done. But you are not the first one who asked for something like this. Someday we'll find somebody who is willing to pay to build better support for that into osm2pgsql, but until that happens you can do something like this:

Create a table in osm2pgsql that you fill with data as normal. Everthing that's in there you need to run through your postprocessing. Delete everything in the table after that. Then when a change comes in you'll get new entries in that table that you have to postprocess again. You also have to create a trigger in the database that triggers on DELETE of that table and changes the DELETE into an INSERT of a second table. You can use the contents of that table to trigger deletions in your postprocessing tool chain. I you want to detect actual changes instead of treating a change as a delete plus insert, it becomes a bit more complicated. You can also do this for many tables of course and other variants are possible.

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

Message ID: <osm2pgsql-dev/osm2pgsql/repo-discussions/2144/comments/8871305 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20240321/0df97dde/attachment-0001.htm>


More information about the Tile-serving mailing list