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

PB-1221 : partially out of bound KML was ignored entirely #1139

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

pakb
Copy link
Contributor

@pakb pakb commented Nov 26, 2024

The KML extent detection was not performing as expected with KML that had only one dimension out of LV95 bounds.

To counteract that, I've reverted the logic in the extent calculation, transforming LV95 bounds into WGS84 to do the matching instead of transforming a potentially big WGS84 extent to LV95 (lead to big math error...)

Test link with sample file
Test link

@github-actions github-actions bot added the bug label Nov 26, 2024
Copy link

cypress bot commented Nov 26, 2024

web-mapviewer    Run #3905

Run Properties:  status check passed Passed #3905  •  git commit 42ea977175: PB-1221 : partially out of bound KML was ignored entirely
Project web-mapviewer
Branch Review bug-PB-1221-kml-extent-false-positive
Run status status check passed Passed #3905
Run duration 04m 18s
Commit git commit 42ea977175: PB-1221 : partially out of bound KML was ignored entirely
Committer Pascal Barth
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 21
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 212
View all changes introduced in this branch ↗︎

@pakb pakb force-pushed the bug-PB-1221-kml-extent-false-positive branch from a37210a to 0715a47 Compare November 26, 2024 10:50
@@ -84,26 +84,33 @@ export function getExtentIntersectionWithCurrentProjection(
) {
return null
}
let extentInCurrentProjection = flattenExtent(extent)
let currentProjectionAsExtentProjection = currentProjection.bounds.flatten
let finalExtent = flattenExtent(extent)
Copy link
Contributor

Choose a reason for hiding this comment

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

why declare finalExtent here and not just declare it later with
let finalExtent = getExtentIntersection(flattenExtent(extent), currentProjectionAsExtentProjection)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, now that it's not used in the next if block I could move the declaration further down

The KML extent detection was not performing as expected with KML that had only one dimension out of LV95 bounds.

To counteract that, I've reverted the logic in the extent calculation, transforming LV95 bounds into WGS84 to do the matching instead of transforming a potentially big WGS84 extent to LV95 (lead to big math error...)
@pakb pakb force-pushed the bug-PB-1221-kml-extent-false-positive branch from 0715a47 to 42ea977 Compare November 26, 2024 11:55
@pakb pakb merged commit 9a9c1f6 into develop Nov 26, 2024
6 checks passed
@pakb pakb deleted the bug-PB-1221-kml-extent-false-positive branch November 26, 2024 12:05
Copy link
Contributor

@ltkum ltkum left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants