Repository navigation
feat(data): city-model readers give each object's base_height above its topmost object (#1269) - #1974
Conversation
…ts topmost object (opengeos#1269)
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewI found no correctness bugs. I checked the grounds propagation, the group filter, the basement case, the three-level chain and the cycle case by hand against the test fixtures. I could not compile or run the tests, since there is no Bash tool here, so formatting and compilation are unverified. No earlier review threads existed, so nothing was skipped as already raised. Bugs
Security
Performance
Quality
AGENTS.md
Left alone: none. Both threads are new. Change sizeCompared with the base branch (merge base 11622d9 to PR head 00e565b). Sizes are file sizes, not line counts.
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. |
Code reviewBugs
I checked the rest of the new logic and found no other defects: the group filter, the bounded rounds, the overflow handling ( Security
Performance
Quality
AGENTS.md
Earlier concerns
I could not run Change sizeCompared with
|
…base_height leaves it out (opengeos#1269)
Code reviewBugs
Security
Performance
Quality
AGENTS.md
Checked and not raised
Earlier concerns left alone: 5. The silent-zero parent concern (addressed by the new notice), the test-gap thread (resolved), and three quality points from the earlier thread (the Change sizeCompared with
|
… reads in a depth system (opengeos#1269)
Code reviewI read the diff, the staged metadata, the four prior review threads, and the surrounding code in Bugs
Security
Performance
Quality
AGENTS.md
Already raised (left alone)
Change sizeCompared: the whole PR against main (merge base 11622d9 to PR head 4f9f4e9).
|
| counts.ground_rounds = set_grounds(&mut built, MAX_PARENT_VISITS).unwrap_or(0); | ||
| counts.unknown_parents = { | ||
| let ids: HashSet<&str> = built.iter().map(|b| b.id.as_str()).collect(); | ||
| built.iter().filter(|b| b.parent_ids.iter().any(|p| !ids.contains(p.as_str()))).count() |
There was a problem hiding this comment.
The "name a parent that isn't in the file" count also takes in group parents, and TINRelief parents. set_grounds never links a child to a CityObjectGroup, so a member whose group couldn't be read gets the same base_height either way, yet this count sends it into the notice "their base_height leaves it out". A TINRelief parent is in the file, not unreadable. Confidence: low (about 40%). The fix needs the parent's type, which an unreadable group doesn't have, so this may be worth a reworded notice rather than a code change.
Code reviewI found no crash, panic or data-loss bug in the new code. The bounds, the cycle handling and the overflow checks hold up on reading. Two notice-accuracy findings remain, and I posted one of them inline. The second could not be posted inline because its line is outside the diff, so it is listed here only. Bugs
Security
Performance
QualityThese may wait for the release quality pass.
AGENTS.md
Earlier concerns left aloneI left 5 existing review threads alone because they were already raised:
Change sizeCompared with the base branch (merge base 11622d9 to PR head 4f9f4e9).
|
Summary
Pull request 1 of 3 for the extrusion base height (plan): the data. The renderers and the Style › Extrusion › Base menu come next.
z_minis absolute (sea level, NAP), so it can't be an extrusion's base: a town at 500 m would float 500 m up. The CityJSON and CityGML readers now add abase_heightfield: how far an object's lowest point is above the lowest point of the topmost object it is part of.CityObjectGroup) aren't containers: a group's members are measured from their own building, not from the group.Never silent:
base_heightholds.base_heighttoo large to be a number is left empty and counted in the existing overflow notice, now "their height or base_height is left empty".raise_parentsstop there with their own notice: "some parts' base_height is measured from a parent, not from the topmost object they are part of".A visible change:
base_heightjoinsz_min,z_maxandheightas a reserved name, so a file's own attribute namedbase_heightis renamedbase_height_1, with the existing renaming notice.Not in this pull request:
base_heightholds where a part starts until pull request 2 uses it.base_height; pull request 2 will take a missing base as 0.raise_parentsandset_grounds; sharing it is a small change I left out to keep this one to the readers.Followed no other project's code.
Testing
a_part_starts_at_its_height_above_its_building(CityJSON): a building with a raised part, a group whose members are 40 m apart (both 0), a building with a basement (its part gets 3), and a three-level chain listed child first (the grandchild gets 8, not 5). It fails if the group filter is removed orset_groundsruns one round.setting_grounds_is_bounded: a 20-object chain stops at the bound and settles with room; a cycle settles.a_part_above_its_building_starts_there(CityGML): an inline part and one linked byxlink:href7 m up; a group member gets 0, not 40. It fails without the group filter.base_height.cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo nextest run --workspace, doctests andcargo xtask layerson macOS: all pass, 6259 tests.base_height0 and 6.UI evidence
No visible UI change: city-model layers have one more field in the attribute table.
Related issue
Part of #1269
Summary by CodeRabbit
base_height, measured relative to the lowest point of their topmost containing building. Buildings have a base height of zero; building parts account for building elevation and basements.