Skip to content
Snippets Groups Projects
Commit 80a86bcc authored by Laura, Jason R's avatar Laura, Jason R
Browse files

Adds valid height check for DEM intersection

parent 29a6a553
No related branches found
No related tags found
No related merge requests found
...@@ -36,5 +36,7 @@ release. ...@@ -36,5 +36,7 @@ release.
## Unreleased ## Unreleased
### Changed ### Changed
- Removed all `pyproj` calls from csm.py, abstracting them into the reprojection and pyproj.Transformer code inside utils.py. Updated the transformations to use the new pipeline style syntax to avoid deprecation warnings about old syntax.p - Removed all `pyproj` calls from csm.py, abstracting them into the reprojection and pyproj.Transformer code inside utils.py. Updated the transformations to use the new pipeline style syntax to avoid deprecation warnings about old syntax.
### Fixed
- Added a check to `generate_ground_point` when a GeoDataset is used to raise a `ValueError` if the algorithm intersects a no data value in the passed DEM. This ensures that valid heights are used in the intersection computation.
...@@ -170,6 +170,8 @@ def _(dem, image_pt, camera, max_its = 20, tolerance = 0.001): ...@@ -170,6 +170,8 @@ def _(dem, image_pt, camera, max_its = 20, tolerance = 0.001):
px, py = dem.latlon_to_pixel(lat, lon) px, py = dem.latlon_to_pixel(lat, lon)
height = dem.read_array(1, [px, py, 1, 1])[0][0] height = dem.read_array(1, [px, py, 1, 1])[0][0]
if height == dem.no_data_value:
raise ValueError(f'No DEM height at {lat}, {lon}')
next_intersection = camera.imageToGround(image_pt, float(height)) next_intersection = camera.imageToGround(image_pt, float(height))
dist = max(abs(intersection.x - next_intersection.x), dist = max(abs(intersection.x - next_intersection.x),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment