Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recalculate bbox when LoD filter is used for CityGML exports #239

Merged
merged 2 commits into from
Feb 4, 2022

Conversation

clausnagel
Copy link
Member

This PR addresses #104.

@clausnagel clausnagel requested a review from yaozhihang February 4, 2022 07:03
@@ -184,6 +190,11 @@ private void doWork(DBSplittingResult work) {
AbstractGML object = exporter.exportObject(work.getId(), work.getObjectType());
if (object instanceof AbstractFeature) {
feature = (AbstractFeature) object;

if (useLodFilter && feature.isSetBoundedBy()) {
feature.setBoundedBy(feature.calcBoundedBy(bboxOptions));
Copy link
Member

Choose a reason for hiding this comment

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

The feature here is top-level. How about sub-features, should their bbox also be recalculated?

Copy link
Member Author

Choose a reason for hiding this comment

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

@yaozhihang
Copy link
Member

There is an option generalOptions.getEnvelope().isUseEnvelopeOnCityModel(). Maybe it should also be taken into account.

@clausnagel
Copy link
Member Author

clausnagel commented Feb 4, 2022

There is an option generalOptions.getEnvelope().isUseEnvelopeOnCityModel(). Maybe it should also be taken into account.

Well, this option controls whether a gml:Envelope shall be created for the root <CityModel> in the export dataset. Since <CityModel> is the first line written to the dataset, we cannot compute its envelope based on the exported city objects but only on the envelopes stored in the database.

Or did you mean something else?

@yaozhihang
Copy link
Member

Yes, that is what I mean. OK, it sounds impossible to reccalculate the CityModel envelope based on the LOD filter.

@clausnagel
Copy link
Member Author

clausnagel commented Feb 4, 2022

Well, not impossible in general. But this would require changing the dataset after it has been written. This cannot be done if we write to a stream though. In such cases, we would need some temporary export dataset which is only sent to the stream once it has been adapted. Thus, the stream would have to wait long for a response... Anyway, at least no easy and nice solution in any case.

@yaozhihang
Copy link
Member

yes, we could improve this in future in a separate PR once we find a better solution.

@clausnagel clausnagel merged commit 2e1dc63 into master Feb 4, 2022
@clausnagel clausnagel deleted the feature-recalculate-bbox branch February 4, 2022 10:58
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