cjio
cjio copied to clipboard
LoD metadata info for 2nd level objects
The cityfeaturemetadata and the presentlods don't have the correct counts with 2nd level object, such as BuildingPart.
Reproduce with multi-lod 3D BAG data:
cjio 3dbag_v210908_fd2cee53_5786.json subset --id "NL.IMBAG.Pand.0518100000285075-0" --id NL.IMBAG.Pand.0518100000285075 save --indent one.json
Then one.json
contains:
"cityfeatureMetadata": {
"Building": {
"uniqueFeatureCount": 1,
"aggregateFeatureCount": 1,
"presentLoDs": {
"0": 1
},
"BuildingParts": 1
}
},
"presentLoDs": {
"0": 1
},
This shows that there is only LoD0 in the file. However, the file still had LoD0, 1.2, 1.3, 2.2 for the Building and its BuildingPart.
I encountered a similar problem that when city_model.update_metadata()
is invoked, only LoD0 is added to the PresentLoDs. I think the root of the problem is in the following lines, where all Parts are deleted from the c_o_p list:
https://github.com/cityjson/cjio/blob/d9b4636287563df8cb9cc6c868df407a21ed67c2/cjio/metadata.py#L99
Following, only the parent IDs are checked for LoDs, while the LoDs from children are never added to the parents' LoDs: https://github.com/cityjson/cjio/blob/d9b4636287563df8cb9cc6c868df407a21ed67c2/cjio/metadata.py#L114-L126