-
Notifications
You must be signed in to change notification settings - Fork 3
geoid issue-19 #20
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?
geoid issue-19 #20
Conversation
Looking at the initial issue and the implementation of this PR, I am going back and forth on the best approach. On the one side it is nice to have some sort of automation for converting between CRS and the other is that we are assuming that the point cloud is the preferred/correct one. You mentioned pulling this logic out of the pipeline and have it as a separate tool/script, which I am currently leaning towards. For this PR, I would suggest that we compare the reference DEM and the point cloud and raise an error in the workflow when there is a difference. Then we could give the user the exact conversion call for GDAL if they opt to convert the reference DEM. Basically print the call on line 74 Making the user aware of this detail is important and then have ice-roads as the tool to assist the user in getting everything done. Thoughts? |
I really support some sort of error print and engage the user to make a
decision. Especially in the case of geoid- ellipsoid issues. I havent
gotten into software development at this scale for a long time, but
ideally, i think there would be a configuration gui that could be used at
start up to check what you what done with the run, then let it loose. It
would still be basically command line driven, but the modules would be user
specified (if desired) to allow for individulalized workflows.
I dont know how hard this would be in python, or who would be available to
do the programming. Maybe just an option to do CRS or run separate would
be good fior now?
…On Tue, Jan 21, 2025 at 4:32 PM Joachim Meyer ***@***.***> wrote:
Looking at the initial issue and the implementation of this PR, I am going
back and forth on the best approach. On the one side it is nice to have
some sort of automation for converting between CRS and the other is that we
are assuming that the point cloud is the preferred/correct one.
You mentioned pulling this logic out of the pipeline and have it as a
separate tool/script, which I am currently leaning towards.
For this PR, I would suggest that we compare the reference DEM and the
point cloud and raise an error in the workflow when there is a difference.
Then we could give the user the exact conversion call for GDAL if they opt
to convert the reference DEM. Basically print the call on line 74
<https://github.com/cryogars/ice-road-copters/pull/20/files#diff-68f7c9293bc31fb2a05fa9dc49cf12c1574bc03fc503ee597d0b53c9384c69b4R74-R75>
Making the user aware of this detail is important and then have ice-roads
as the tool to assist the user in getting everything done.
Thoughts?
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA22DJKTJAMF5VFZRICD7I32L3KJJAVCNFSM6AAAAABVTLKXWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBVHE2TGOBYGY>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
@shadoneel But we do ask for this in the README (see below),
Users input either a True or False at the start. imo a GUI may be a little over-engineered, and would not be ideal for running on Borah or other linux cluster. @jomey My main issue with pulling it out, is that it's not just GDAL , since GDAL does not have a geoid conversion. We would be asking users to compute it using Ames Stereo. Which could be less accessible. It's possible that keeping this in as is, would aid non-technical users in easily performing the geoid conversion? Alternatively, we can do what I was suggesting and just remove the -g flag. We can have an exception that looks for if reference-DEM is in geoid. And we can refer them to run another script that we make. But, this whole process could be longer, and potentially not worth the headache if we can just ask the user to be aware of what vertical datum their reference-DEM is in? |
I am still voting for referring the user to a separate script to properly prepare the reference DEM. Also thinking from a repeatability perspective, where for instance in our case we would convert the reference DEM every time we process a point cloud. This adds unnecessary time each time a workflow is executed. It already takes quite a while for one run and saving time should be desirable. |
If the software isnt user friendly its not useful.
Trying to use the software in new areas has illustrated weak points, that
can be handled by an expert but not by someone at a student or technician
level that isnt a software developer. Because 3DEP and other large lidar
products have decided to go with geoid heights, we really need capacity to
transform from geoid to ellipsoid. I was told that vertical transforms are
now possible with GDAL, without making and editing a VRT. I have not
verified this. How i did it in the past:
1. Use gdalwarp to make a vrt
gdalwarp -of vrt <source> <dest.vrt> -s_srs epsg:32611+5703 -t_srs
epsg:32611-r bilinear
e.g. Quantum provides data in NAD83(2011) UTM 11N: 26911
NAVD88(Geoid12B) = 5703
2. Use an editor like Atom to Edit the vrt along the lines of below at
the bottom just inside the closing *</*VRTDataset*>* *tag*. This is telling
gdal translate (step 3) to reference the “Vertical Shift Grids”. The last
line in the example below is the referenced closing tag. You paste above
it. <VerticalShiftGrids>
<Grids>g2012a_conus.gtx,g2012a_alaska.gtx,g2012a_guam.gtx,g2012a_hawaii.gtx,g2012a_puertorico.gtx,g2012a_samoa.gtx</Grids>
<Inverse>False</Inverse>
<ToMeterSrc>1</ToMeterSrc>
<ToMeterDest>1</ToMeterDest>
</VerticalShiftGrids>
*</*VRTDataset*>*
1. Those specific grid shift files are for NAVD88 (5703). you have to
reference different files for different vertical datums
2. if you have to deal with ft based vertical, then change the
<ToMeterSrc> or <ToMeterDest> to convert to feet/survey feet/us
feet/chains/rods/etc
3. 1. gdal_translate the vrt to a output tiff e.g.
gdal_translate -of <source.vrt> <output.tif>
Checking to see if it worked can be done using
GTIFF_REPORT_COMPD_CS=TRUE gdalinfo DryCreek_WGS84.tif -stats
Before and after the transform, and the min and max will change, following
the vertical shift you just executed.
…On Wed, Jan 22, 2025 at 7:27 AM Brent Wilder ***@***.***> wrote:
@shadoneel <https://github.com/shadoneel> But we do ask for this in the
README (see below),
-g geoid Is the reference DEM CRS orthometric (geoid height)? Will be auto set to True if you don't supply a DEM [Default: False]
Users input either a *True* or *False* at the start.
imo a GUI may be a little over-engineered, and would not be ideal for
running on Borah or other linux cluster.
@jomey <https://github.com/jomey> My main issue with pulling it out, is
that it's not just GDAL , since GDAL does not have a geoid conversion. We
would be asking users to compute it using Ames Stereo. Which could be less
accessible. It's possible that keeping this in as is, would aid
non-technical users in easily performing the geoid conversion?
Alternatively, we can do what I was suggesting and just remove the -g
flag. We can have an exception that looks for if reference-DEM is in geoid.
And we can refer them to run another script that we make. But, this whole
process could be longer, and potentially not worth the headache if we can
just ask the user to be aware of what vertical datum their reference-DEM is
in?
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA22DJPNV26RM4LFQT76KVD2L6TDVAVCNFSM6AAAAABVTLKXWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBXGM4TEMRQGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@shadoneel @jomey Putting these two ideas together, I would argue we need to have a separate utility script even more so. This would allow for more flexibility (perhaps allowing choice of a GDAL or Ames method), adding in if its in feet vs meter, allowing for users to assess the output stats to verify, repeatability so we are not computing the same thing over again? |
And I can make it clear in the documentation/README, that this geoid-conversion-tool should be used first. We can also add another Exception/Error, to catch this early on in the main pipeline. |
Tagging @naniciafone to chime in how she processed the 3DEP data. Think there is also a PDAL+GDAL way that uses the 3DEP point clouds. |
PDAL was able to perform the transformation from NAVD 1988 GEOID 12B to WGS ellipsoid with the reprojection filter... I thought I was going to need to download a gtx file but I didn't need to. |
Good to know about the ease of the PDAL method for point clouds @naniciafone and @jomey ... Which could also be added to this geoid-helper script? Are we in consensus then to take out the EDIT: with the idea being similar to Shad's comments that we are focusing on User input, and trying to simply bring down the technical barrier on this part? |
I would like to see Nani's workflow at least in the example. Think this is very useful to have as a reference if a user decides to go the point cloud route.
+1 from my side
|
Should need a little more testing perhaps? but i have exhausted all of the data I have on my computer (flipping back and forth between WGS and NAD). But I believe I have done it? It seems to be fully dummy proof and does not allow you to do any sort of geoid transformations that are impossible. It also takes in either a raster (using ASP), or it can take in a point cloud (using PDAL). I leverage the fact we have the navd88.tif already local due to the ASP install. And so this is called in the PDAL pipeline to ensure consistency when performing the transformation. |
@naniciafone - Want to give this a spin with your current use case in Kamas? |
Also, just to follow up on your earlier point @jomey , we have taken out this assumption too. And so now, we just ask the user to provide the EPSG code (e.g 32611) that they wish their data to be in. This should hopefully remove the ambiguity in which is the preferred/correct one. |
@naniciafone perhaps the easiest and most flexible solution for us would be to have another argument . like an "override" argument that mostly would just be used for USGS 3DEP lidar. that could perform geoid->ellipsoid by ignoring the datum? ... Seems a little dangerous just because it expects the user to know exactly. But i think this is required due to the ambiguity? |
Okay, I have pushed a new version if you wanted to test! Updates:
Example usage would be:
|
yeah I can try it again! Question for my own understanding- does the tool automatically convert to WGS84 (versus NAD83/ another ellipsoid)? And does it assume a geoid model? If the geoid model is not specified in the metadata, I assume I'd need to specify. I've only done transformations with PDAL/PROJ so not sure how ASP handles it. |
Yeah that’s a great question. And right now it’s super simple, and just assumes ‘navd88.tif’. Which is supplied in ASP. We use this same model for both point cloud and raster data. I’m realizing as I am writing this , that I need to check if we need to use the WGS model in here too (EGM2008). Update: this is a great point Nani I need to think more about this. |
Yeah so I am missing cases here and the code is currently flawed.. It assumes user wants to switch from either NAD83 to WGS or visa versa. But you can stay within one of those datums and still change geoid to ellipsoid. I will continue to iterate and figure out the best way to do this but it will take some time. |
If it's helpful, this is what I ended up doing... with much hand holding from Abhi @ NCALM, who visited for the SNOWWI flights :) :
Probably could've done one json but it was helpful to look at my point samples along the way. The 3DEP and RaLiPod were 15m off to start. After converting to NAD83 with the first json, the points were about 30cm offset. The second json removed that last 30cm offset. |
I haven't been able to replicate this since I moved to the AWS downloaded point cloud, which as discussed does not have encoded vertical CRS data... when I posted this I was using tiled data downloaded from the National Map, which was a headache for a lot of reasons. That data did have encoded vertical CRS info, however.... I've also learned a ton about transformations since I posted this and want to verify that I actually got the transformation I thought I did. |
So a few things as I am looking at these examples (thank you for providing).
EDIT: I have gone ahead and updated it to be more of a "library" of sorts that users may start from, versus a formal tool. I honestly think this will be more helpful in the long-term and perhaps @naniciafone like as you use them you could put them here for others (see |
I like the idea of an example folder instead of the tool (for the reasons Brent mentioned). We could publish the PDAL JSON pipelines that handle 3DEP and any other ones that you crated, Brent. |
Going back to this question: |
Happy to add my own examples to that folder/ contribute to the "resources" folder. I think that's a good way to go given the nuances of geoid-ellipsoid transformations. |
nuances in geoid-ellipsoid transforms, rubbish. This is child's play! 🤪
Its too bad HOBU doesnt solve this, but he kinda bailed at the end of the
thread with david it appears.
Nice work y'all. Maybe David could be a source to test what you come up
with to see if it works in his case as well as it does for what you are
pushing it to?
…On Mon, Mar 24, 2025 at 9:39 AM Nani (Siobhan) Ciafone < ***@***.***> wrote:
Happy to add my own examples to that folder/ contribute to the "resources"
folder. I think that's a good way to go given the nuances of
geoid-ellipsoid transformations.
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA22DJKPR55EVMGSN4P2KG32WARLFAVCNFSM6AAAAABVTLKXWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBYGU3DGNZUG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: naniciafone]*naniciafone* left a comment
(cryogars/ice-road-copters#20)
<#20 (comment)>
Happy to add my own examples to that folder/ contribute to the "resources"
folder. I think that's a good way to go given the nuances of
geoid-ellipsoid transformations.
—
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA22DJKPR55EVMGSN4P2KG32WARLFAVCNFSM6AAAAABVTLKXWCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDONBYGU3DGNZUG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I think the way we could make it a tool is by helping the user build the json with all PROJ strings needed for transformations. I got the proj strings through, for example, |
@naniciafone I agree and I came to a similar conclusion when I was looking at that too. That's why I think building out an example library would be most helpful. And especially for Mores crew, and any of your more recent projects @naniciafone and @shadoneel to account for the largest use cases! If you want to email the jsons to mee I can just go ahead and add them to the https://github.com/cryogars/ice-road-copters/tree/issue-19-geoid/contrib/datum_transformation_examples , and do another push to this PR. Let me know! |
Fixes hard coding of CRS for geoid conversion. (Closes #19 )