Skip to content

Commit 181d2cf

Browse files
committed
merge with develop
2 parents 2ea304d + 25029a2 commit 181d2cf

5 files changed

Lines changed: 359 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
- Native GLB generation in Rust through `cityjson-convert`.
88
- Optional intermediary tile materialization in CityJSONSeq format for debugging.
9+
- Opt-in `--include-parent-attributes` handling for 3DBAG/roofer-style parent-child datasets, copying inherited parent attributes onto geometry-bearing CityObjects before GLB export.
910
- Support for regular CityJSON documents, CityJSONSeq documents, and the legacy CityJSONFeature-files as input, via the `cityjson-index` crate.
1011
- A `just ci-check` recipe and a GitHub Actions workflow that runs it.
1112
- ADRs and supporting documentation for the new `cityjson-index`/CityJSONSeq input model and grid traversal changes.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,15 @@ For example:
248248

249249
`tyler … --object-attribute bouwjaar:int --object-attribute objectid:int --object-attribute bagpandid:string --object-attribute bgt_type:string`
250250

251+
Some datasets, such as 3DBAG or roofer exports, store the attributes on a parent `Building`
252+
while the geometry lives on the child `BuildingPart`. In that case, enable
253+
`--include-parent-attributes` so Tyler copies inherited parent attributes onto the
254+
geometry-bearing child before GLB conversion.
255+
256+
For example:
257+
258+
`tyler … --object-type Building --object-type BuildingPart --include-parent-attributes`
259+
251260
#### Colors
252261

253262
Colors on the glTF features are set with the `--color-<cityobject type>` arguments.

justfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ test:
2828
cargo test --workspace --all-targets --all-features
2929

3030
# Clean the workspace by removing all build artifacts and test artifacts.
31-
clean:
31+
clean: clean-output
3232
cargo clean
33+
34+
# Clean the test output directories.
35+
clean-output:
3336
rm -rf tests/output
3437
rm -rf cityjson-convert/tests/output
3538

src/cli.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ pub struct Cli {
103103
/// Write the per-tile CityJSONFeature streams used for GLB conversion to output/inputs/.
104104
#[arg(long)]
105105
pub debug_tile_inputs: bool,
106+
/// Copy inherited parent attributes onto geometry-bearing CityObjects before GLB conversion.
107+
/// This is useful for 3DBAG/roofer-style parent-child models where attributes live on the parent.
108+
#[arg(long)]
109+
pub include_parent_attributes: bool,
106110
/// Maximum error that is allowed in mesh simplification to reduce the number of vertices. Value should be a float that represents that maximum allowed error in meters. Ignored for building object types.
107111
#[arg(long, default_value = "1.0")]
108112
pub simplification_max_error: Option<f64>,
@@ -363,6 +367,15 @@ mod tests {
363367
assert!(otypes.contains(&crate::parser::CityObjectType::PlantCover));
364368
}
365369

370+
#[test]
371+
fn verify_include_parent_attributes_flag() {
372+
let dataset_dir = legacy_dataset_dir();
373+
let mut args = required_args(&dataset_dir);
374+
args.push("--include-parent-attributes".to_string());
375+
let cli = Cli::try_parse_from(args).unwrap();
376+
assert!(cli.include_parent_attributes);
377+
}
378+
366379
#[test]
367380
fn verify_single_input_arg_for_dataset_root() {
368381
let cli = Cli::try_parse_from(dataset_args()).unwrap();

0 commit comments

Comments
 (0)