Commit 80a86bcc authored by Laura, Jason R's avatar Laura, Jason R
Browse files

Adds valid height check for DEM intersection

parent 29a6a553
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -36,5 +36,7 @@ release.
## Unreleased

### 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.
+3 −1
Original line number Diff line number Diff line
@@ -170,6 +170,8 @@ def _(dem, image_pt, camera, max_its = 20, tolerance = 0.001):

        px, py = dem.latlon_to_pixel(lat, lon)
        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))
        dist = max(abs(intersection.x - next_intersection.x),