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

geoid issue-19 #20

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

geoid issue-19 #20

wants to merge 11 commits into from

Conversation

brentwilder
Copy link
Member

@brentwilder brentwilder commented Jan 21, 2025

Fixes hard coding of CRS for geoid conversion. (Closes #19 )

  • CRS of correct projection is pulled directly from the input laz

@jomey
Copy link
Member

jomey commented Jan 21, 2025

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?

@jomey jomey requested a review from naniciafone January 21, 2025 23:38
@shadoneel
Copy link
Collaborator

shadoneel commented Jan 22, 2025 via email

@brentwilder
Copy link
Member Author

@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 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?

@jomey
Copy link
Member

jomey commented Jan 22, 2025

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.

@shadoneel
Copy link
Collaborator

shadoneel commented Jan 22, 2025 via email

@brentwilder
Copy link
Member Author

@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?

@brentwilder
Copy link
Member Author

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.

@jomey
Copy link
Member

jomey commented Jan 22, 2025

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.

@naniciafone
Copy link

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.

@brentwilder
Copy link
Member Author

brentwilder commented Jan 22, 2025

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 -g flag and create a sort of standalone tool that can help guide some of these approaches?

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?

@jomey
Copy link
Member

jomey commented Jan 22, 2025

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?

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.

Are we in consensus then to take out the -g flag and create a sort of standalone tool that can help guide some of these approaches?

+1 from my side

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?

README.md Outdated Show resolved Hide resolved
scripts/geoid_tool.py Outdated Show resolved Hide resolved
@brentwilder
Copy link
Member Author

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.

@jomey
Copy link
Member

jomey commented Jan 24, 2025

Should need a little more testing perhaps?

@naniciafone - Want to give this a spin with your current use case in Kamas?

@brentwilder
Copy link
Member Author

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.

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.

scripts/geoid_tool.py Outdated Show resolved Hide resolved
scripts/geoid_tool.py Outdated Show resolved Hide resolved
scripts/geoid_tool.py Outdated Show resolved Hide resolved
scripts/geoid_tool.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
scripts/geoid_tool.py Outdated Show resolved Hide resolved
@jomey
Copy link
Member

jomey commented Jan 28, 2025

Nice work on moving the main logic pieces into methods.
Consider most of my remarks as minor.

I would like to give @naniciafone a chance to test this too before we merge

@shadoneel
Copy link
Collaborator

shadoneel commented Jan 28, 2025 via email

@@ -60,6 +60,9 @@
asp_dir = join(asp_dir, 'bin')
else:
asp_dir = abspath(join('ASP', 'bin'))
# check ASP install exists
if not exists(asp_dir):
raise Exception(f'The following is not the correct path to ASP: {asp_dir}')
Copy link
Member

Choose a reason for hiding this comment

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

Nice! ❤️

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.

CRS hard coded in Geoid conversion
4 participants