pnorman created an issue (osm2pgsql-dev/osm2pgsql#2496)
We offer `process_node` and `process_untagged_node` functions because calling
into lua for every untagged node is expensive. This works well, but some work
with two stage processing revealed a weakness.
I want to do second stage processing on all nodes that are members of relations
that meet some criteria. I can easily identify them with
`select_relation_members`, the problem is I don't know if they're tagged.
According to the docs I need to do something like this in *both* `process_node`
and `process_untagged_node`
```lua
if osm2pgsql.stage == 1 then
return
end
if (some logic) then
savedgeom[object.id] = object:as_point()
end
```
and then access savedgeom during stage 2 relation processing.
This will run fine for stage two processing of tagged and untagged nodes
because there aren't that many flagged by select_relation_members. It also work
okay for stage one processing of tagged nodes because it's not doing much more
work than normal. The problem is stage one processing of untagged nodes.
By simply defining the function and having an if statement for every untagged
node it adds work to be done for each untagged node. It isn't much work, but
because there are so many untagged nodes in stage one it adds a good chunk of
time.
I can't think of a good way to handle this. My specific case is also addressed
by https://github.com/osm2pgsql-dev/osm2pgsql/issues/2406, but in general
tagging nodes for stage two processing is going to require doing some stage one
work on every untagged node.
--
Reply to this email directly or view it on GitHub:
https://github.com/osm2pgsql-dev/osm2pgsql/issues/2496
You are receiving this because you are subscribed to this thread.
Message ID: <osm2pgsql-dev/osm2pgsql/issues/[email protected]>_______________________________________________
Tile-serving mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/tile-serving