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

LidarPointStats: more robust determination of row/col position of points #275

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jfbourdon
Copy link
Contributor

Fix #273

The current way of determining the row/col position of each point wasn't reliable resulting in some points contributing to an adjacent pixel. The proposed method is more robust, but only as long as the extent in the LAS header really contains all points.

The new method also changes the way points exactly on the edge of a pixel are treated:
image
No way is better than the other, it's just a by-product of the method I used (it could be tweak to give the same result as before). As a side note, LAStools includes points on the left and bottom edges while excluding points on the right and top edges.

Last note, I chose to force points sitting on the easternmostedge of the extent to fall in last column of the raster and in the same way, I force points sitting on the southernmost edge of the extent to fall in the last row. I don't think that's ideal as it breaks the normal way of determining the row/col position. It would also add a small error in the case of tiled files as some points could potentially be counted twice depending on how the tiling has been done.

@jfbourdon
Copy link
Contributor Author

jfbourdon commented Sep 8, 2022

Just made a small to reuse the public functions get_column_from_x() and get_row_from_y() instead of rewriting those. It doesn't change the behaviour of the first commit.

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.

Raster shift in LidarPointStats?
1 participant