LidarPointStats: more robust determination of row/col position of points #275
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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.