|
31 | 31 | from rasterio.warp import transform_bounds
|
32 | 32 | from rasterio.windows import from_bounds
|
33 | 33 |
|
34 |
| -from orthority import common |
35 |
| -from orthority import errors, param_io |
36 |
| -from orthority.camera import Camera, create_camera, PinholeCamera |
37 |
| -from orthority.enums import CameraType, Compress, Interp, Driver |
| 34 | +from orthority import common, errors, param_io |
| 35 | +from orthority.camera import Camera, PinholeCamera, create_camera |
| 36 | +from orthority.enums import CameraType, Compress, Driver, Interp |
38 | 37 | from orthority.errors import OrthorityError
|
39 | 38 | from orthority.ortho import Ortho
|
40 | 39 | from tests.conftest import _dem_resolution
|
@@ -224,6 +223,26 @@ def test_get_init_dem(
|
224 | 223 | assert test_bounds[2:] >= ref_bounds[2:]
|
225 | 224 |
|
226 | 225 |
|
| 226 | +def test_get_init_dem_vert_scale( |
| 227 | + rgb_byte_src_file: Path, |
| 228 | + float_utm34n_egm2008_dem_file: Path, |
| 229 | + pinhole_camera: Camera, |
| 230 | + utm34n_egm2008_crs: str, |
| 231 | + rgb_pinhole_utm34n_ortho: Ortho, |
| 232 | +): |
| 233 | + """Test that initial DEM bounds account for vertical scale / CRS by comparing bounds where the |
| 234 | + DEM and camera have the same relative geometry, but different vertical CRS. |
| 235 | + """ |
| 236 | + ortho_egm2008 = Ortho( |
| 237 | + rgb_byte_src_file, float_utm34n_egm2008_dem_file, pinhole_camera, crs=utm34n_egm2008_crs |
| 238 | + ) |
| 239 | + dem_bounds_egm2008 = array_bounds(*ortho_egm2008._dem_array.shape, ortho_egm2008._dem_transform) |
| 240 | + dem_bounds_novertcrs = array_bounds( |
| 241 | + *rgb_pinhole_utm34n_ortho._dem_array.shape, rgb_pinhole_utm34n_ortho._dem_transform |
| 242 | + ) |
| 243 | + assert dem_bounds_egm2008 == pytest.approx(dem_bounds_novertcrs, abs=1e-1) |
| 244 | + |
| 245 | + |
227 | 246 | @pytest.mark.parametrize(
|
228 | 247 | # varying rotations starting at ``rotation`` fixture value & keeping full DEM coverage
|
229 | 248 | 'opk_offset',
|
|
0 commit comments