Skip to content

Make reconstruction deterministic and harden LoD 1.1 fallback#165

Merged
Ylannl merged 4 commits into
mainfrom
fix/missingbuildings
Jun 22, 2026
Merged

Make reconstruction deterministic and harden LoD 1.1 fallback#165
Ylannl merged 4 commits into
mainfrom
fix/missingbuildings

Conversation

@rijos

@rijos rijos commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Kadaster observed run-to-run variance in roofer while generating the national 3DBAG. The same input could produce different output across runs.

  • Pointcloud density check now uses an absolute threshold. Previously the minimum density was a calculated relative value, which itself varied between runs. This caused buildings with sufficient point density to be skipped non-deterministically. The check now compares against a fixed absolute value.
  • Region growing no longer enforces a per-footprint time limit. The previous limit_n_milliseconds cutoff meant a footprint could be abandoned simply because the scheduler hadn't granted the process enough CPU time, leading to starvation-driven variance.
  • Solve run to run variance by doing a proper pointcloud_insufficient.clear(); after each tile. Preventing invalid lod11 fallbacks.

Before merging the pull request, I'd like to confirm the following:
We've set the floor to 1 point/m², Roofer has mainly been validated on AHN (~10 points/m²), so a higher floor like 5 points/m² may be more appropriate.

We're dropping limit_n_milliseconds entirely. How should we handle existing configs that set it, show a warning or show a configuration error?

@rijos rijos requested a review from Ylannl June 4, 2026 07:24
@rijos

rijos commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Possible regression when processing individual footprints, we see possibly unjustified LOD 1.2 fallbacks in our national run. Will investigate further.

@rijos rijos marked this pull request as draft June 9, 2026 12:12
@Ylannl

Ylannl commented Jun 15, 2026

Copy link
Copy Markdown
Member

We've set the floor to 1 point/m², Roofer has mainly been validated on AHN (~10 points/m²), so a higher floor like 5 points/m² may be more appropriate.

A default of 5 seems reasonable. And maybe we should make this optional, as to not have 'hidden' filters enabled by default that may be confusing to new users (as we have now).
I also want to add an option for the minimum footprint coverage fraction. Together this covers the cases for which the relative density offset was originally implemented.

We're dropping limit_n_milliseconds entirely. How should we handle existing configs that set it, show a warning or show a configuration error?

I agree it would be best to drop this feature given the problem that you see with it. We can simply remove it, and users will see an error if they still try it (don't expect there to be many users that would see this).

Comment thread apps/roofer-app/config.hpp
Comment thread apps/roofer-app/config.hpp Outdated
"fallback to LoD 1.1 extrusion. This plane count is the deterministic "
"complexity cutoff that bounds reconstruction time per building.",
cfg_.lod11_fallback_planes, {check::HigherThan<int>(0)});
reconstruction.add(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Remove the deprecated notification.

Comment thread apps/roofer-app/config.hpp Outdated
}
}
}
} else if (key == "lod11-fallback-time") {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Scrap

Comment thread src/extra/io/StreamCropper.cpp
@rijos rijos force-pushed the fix/missingbuildings branch from 99c8cf4 to c1f7575 Compare June 17, 2026 09:03
@rijos

rijos commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Hi @Ylannl, we've completed a test run using this version of roofer, because we're confident that this version works, I have the following requests:

  • Let's keep the abs guard, even though it was proven that it should be technically impossible, it now acts as an additional guard.
  • Dropped lod11-fallback-time as requested.
  • Keep min_building_density at 1.0, as without it, we won't have a graceful lod11_fallback. I think it can be any positive float, but it's really data dependent.

The new min_building_density should also help with:

@rijos rijos changed the title [WIP] Make reconstruction deterministic and harden LoD 1.1 fallback Make reconstruction deterministic and harden LoD 1.1 fallback Jun 17, 2026
@rijos rijos marked this pull request as ready for review June 17, 2026 09:42
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