This adds callbacks `delete_node` \ `delete_way` \ `delete_relation`. They are 
called for every object that is explicitly marked as deleted in a change file. 
The callbacks are not called for objects that are implicitly deleted to make 
room for a new version of the object.

The callbacks receive an OSM object as a single parameter -- just like the 
other callbacks --, only the tags, nodes and member attributes as well as all 
geometry creation functions are disabled. This kind of information is usually 
not available for deleted objects. You can still access meta information like 
version, user etc. and use the object to insert something into a table.

This change required some cleanup to the code that handles untagged nodes. The 
pgsql output has some special handling in that it ignores untagged objects 
unless attribute handling is requested. We've long since removed the 
special handling for flex but the code for filtering was still in osmdata. This 
PR moves the handling into the pgsql output, which is a bit cleaner. This 
changes some of the outcome in the tests. See first commit for details.
You can view, comment on, or merge this pull request online at:

  https://github.com/osm2pgsql-dev/osm2pgsql/pull/2344

-- Commit Summary --

  * move special handling of untagged objects into pgsql output
  * add callbacks for deletion to flex
  * disable tags, nodes, members and geometries for deleted objecs
  * add tests for delete callback

-- File Changes --

    M src/osmdata.cpp (37)
    M src/osmdata.hpp (1)
    M src/output-flex.cpp (109)
    M src/output-flex.hpp (14)
    M src/output-null.hpp (6)
    M src/output-pgsql.cpp (37)
    M src/output-pgsql.hpp (8)
    M src/output.hpp (6)
    A tests/bdd/flex/delete-callbacks.feature (112)
    M tests/test-osm-file-parsing.cpp (18)

-- Patch Links --

https://github.com/osm2pgsql-dev/osm2pgsql/pull/2344.patch
https://github.com/osm2pgsql-dev/osm2pgsql/pull/2344.diff

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

Message ID: <osm2pgsql-dev/osm2pgsql/pull/[email protected]>
_______________________________________________
Tile-serving mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/tile-serving

Reply via email to