Skip to content

Round elevation and degrees before casting to int, fix barrier edge artifacts - #3011

Merged
easbar merged 2 commits into
masterfrom
deg_ele_conversion
May 16, 2024
Merged

easbar merged 2 commits into
masterfrom
deg_ele_conversion

Conversation

@easbar

@easbar easbar commented May 16, 2024

Copy link
Copy Markdown
Member

When we create barrier edges we copy existing nodes. For this we first read the coordinates and the elevation from the storage and then write the same values into the storage for the new node. The way we currently convert the integer representation of the lat/lon degrees and the elevation to a double value and back to the integer representation this can result in a small offset between the coordinates. For this reason there are barrier edges for which the base and adj node coordinates aren't identical. This looks like this when we zoom in:

image

Here I added a call to Math.round before we cast the scaled double value to int to fix this.

@easbar easbar added this to the 10.0 milestone May 16, 2024
@easbar easbar changed the title Round elevation and degrees before casting to int Round elevation and degrees before casting to int, fix barrier edge artifacts May 16, 2024
@easbar easbar added the bug label May 16, 2024

@karussell karussell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@easbar
easbar merged commit 7c74a93 into master May 16, 2024
@easbar
easbar deleted the deg_ele_conversion branch May 16, 2024 13:32
@karussell

Copy link
Copy Markdown
Member

In master there seems to be test failures

Error:    GraphHopperTest.legDistanceWithDuplicateEndpoint:2834 expected: <40.075> but was: <40.080087630127124>
Error:    GraphHopperTest.legDistanceWithDuplicateEndpoint:2834 expected: <40.075> but was: <40.080087630127124>

Is this something problematic or does it need just a minor adaptation?

@easbar

easbar commented May 16, 2024

Copy link
Copy Markdown
Member Author

No, this is only because of a marginal elevation change due to #3011. I just fixed this.

@karussell

Copy link
Copy Markdown
Member

Thanks!

This branch was previously deployed

1 inactive deployment
benchmarks — b97153d2 Deployed May 16, 2024 by easbar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants