Skip to content

Reading CityGML fails if file has a <cityObjectMember> only containing ignored elements #92

@mlavik1

Description

@mlavik1

When parsing a node we always create a new CityObjectElementParser.

This causes an exception to be thrown in CityGMLElementParser::endElement (see citygmlelementparser.cpp) if the only contains children that are ignored (because they haven't been implemented, etc.).

I've created a test file (modified version FZK-Haus) that shows the problem:
ignore-test.zip

This is the model where I first encountered this problem (because it uses "grp:CityObjectGroup", which is not implemented):
LoD3_Railway.city.zip
I've encountered the same issue on other models too.

I suggest replacing that error with a warning, and instead handling this case. I can create a PR for that. Though, please correct me if you think that would be a bad idea 😅

In the case of a container element containing a child element with an xlink, it should also be safe to continue parsing - but it's fair to print a warning, since that element won't be parsed. I noticed once case where that happens (tran:intersection with an xlink - which isn't handled at the moment). I might make a bug/PR for that too.

And by the way, thanks a lot for making this amazing library!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions