-
-
Notifications
You must be signed in to change notification settings - Fork 369
r.in.pdal: fix reported data extent when CRS doesn't match #6465
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
base: main
Are you sure you want to change the base?
Conversation
The reprojected extent is slightly different on macOS, not sure what to make out of it:
|
raster/r.in.pdal/info.cpp
Outdated
#include "projection.h" | ||
} | ||
|
||
#ifdef PDAL_USE_NOSRS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is. It prevents failures when run with older PDAL versions. We can remove this option when we explicitly state PDAL minimum version being >=2.4.3.
Feel free to rename it, as it is defined in local header file:
Line 34 in a92a3a0
#define PDAL_USE_NOSRS 1 |
} | ||
} | ||
|
||
void get_reprojected_extent(pdal::SpatialReference &spatial_reference, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to document this either with function doc or in-code comments just to provide a quick reference on the approach taken here (create bbox as points and reproject it using PDAL functions).
I wouldn't call 0.12 "slightly". It needs to be investigated. |
I tried couple different things. I tested proj 9.4.1 on linux which is newer than in the ubuntu CI (8.2.1) and older than the mac CI (9.6.2). The results on ubuntu are the same, so it might not be version problem. In the ncspm test dataset (running in CI on ubuntu) the reprojected bbox values of the points_6346.las are when I created a new dataset from EPSG:3358, the results change, they are somewhat closer to the original dataset, approx difference of 0.1 meter:
The new dataset has PROJ_WKT unlike the one in CI. Then I tried to compare directly the coordinates of the points once they are reprojected (inside
But for some reason the reprojection pipeline transforming the bbox points gives different values. And none of this seems related to the difference with macOS. |
I remember reading something, probably gdal-dev mailing list, and I think you need to look about what proj-data is available in each, not only the version of the software. (And maybe which one is used) |
Right, that could be the difference between platforms. But I am struggling to get the reprojected bbox match exactly the reprojected points. |
You could try |
This PR tries to fix problems with CRS