Skip to content

Conversation

@joto
Copy link
Collaborator

@joto joto commented Aug 11, 2025

When we introduced the "untagged" callbacks in bc87ea2, we did not call the process_untagged_way/relation callbacks for untagged ways/relations in stage 1b and 1c, but called the normal process_way/relation callbacks. That's not correct. So this is changed in this commit.

For stage2 processing the answer which callback to call is a bit more complicated: On first glance we should also call the "untagged" function for untagged objects. But if we call the "untagged" function in that case, we would have to implement that function and it would be called for the millions of untagged objects we are not interested in. So it is arguably better to call the normal processing functions here. After all we explicitly requested the processing function to be called with the select_relation_members() call. So we are keeping this behaviour.

@joto joto changed the title Process untagged ways/relations in stage 1c/2 correctly Process untagged ways/relations in stage 1b/c correctly Aug 11, 2025
@joto joto force-pushed the fix-untagged-later-stages branch from 80a31ce to 0f9110b Compare August 11, 2025 20:59
Copy link
Collaborator

@lonvia lonvia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really should have tests for that.

}

get_mutex_and_call_lua_function(m_process_way, m_way_cache.get());
get_mutex_and_call_lua_function(func, m_way_cache.get());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the code simpler (also below):

    if (func) {
        get_mutex_and_call_lua_function(func, m_way_cache.get());
    }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@joto joto force-pushed the fix-untagged-later-stages branch from 1ac2376 to 12fb9d0 Compare August 19, 2025 12:43
@joto
Copy link
Collaborator Author

joto commented Aug 19, 2025

Added tests and rebased and squashed commits.

@joto joto force-pushed the fix-untagged-later-stages branch from 12fb9d0 to 67d867c Compare August 19, 2025 12:56
When we introduced the "untagged" callbacks in
bc87ea2, we did not call the
process_untagged_way/relation callbacks for untagged ways/relations  in
stage 1b and 1c, but called the normal process_way/relation callbacks.
That's not correct. So this is changed in this commit.

For stage2 processing the answer which callback to call is a bit more
complicated: On first glance we should also call the "untagged" function
for untagged objects. But if we call the "untagged" function in that
case, we would have to implement that function and it would be called
for the millions of untagged objects we are not interested in. So it is
arguably better to call the normal processing functions here. After all
we explicitly requested the processing function to be called with the
select_relation_members() call. So we are keeping this behaviour.
@joto joto force-pushed the fix-untagged-later-stages branch from 67d867c to cc6ebce Compare August 19, 2025 16:31
@lonvia lonvia merged commit 88e973f into osm2pgsql-dev:master Aug 19, 2025
24 checks passed
@joto joto deleted the fix-untagged-later-stages branch August 21, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants