1
Python and Java API / Export DEM using chunk.exportRaster(): Vertical Datum mising
« on: February 16, 2024, 02:48:47 PM »
Hi all,
I'm trying to export a DEM using chunk.exportRaster(), using python module.
If DEM was build using WGS84 (EPSG::4326), the export runs ok.
The problem occurs with DEM's build using WGS84 + EGM96 height (EPSG::9707): RuntimeError: Vertical datum missing: WGS 84 (EPSG::4326) to EGM96 height (EPSG::5773)
Any ideia to solve this issue?
I'm trying to export a DEM using chunk.exportRaster(), using python module.
Code: [Select]
# Set projections
set_projection = Metashape.OrthoProjection()
set_projection.crs = Metashape.CoordinateSystem("EPSG::"+str(epsg))
# Set image compression
set_img_compression = Metashape.ImageCompression()
set_img_compression.tiff_compression = Metashape.ImageCompression.TiffCompressionLZW
# DEM export settings
output_path = outputs_folder + os.path.basename(os.path.splitext(project_path)[0] + '-DSM-'+str(res_cm)+'cm-epsg'+str(epsg)+'.tif')
print(output_path)
chunk.exportRaster(
output_path,
image_format=Metashape.ImageFormatTIFF,
source_data=Metashape.ElevationData,
image_compression=set_img_compression,
projection = set_projection,
resolution_x = res_cm/100, resolution_y = res_cm/100
)
print(f"DSM exported from {project_path} to {output_path}")
If DEM was build using WGS84 (EPSG::4326), the export runs ok.
The problem occurs with DEM's build using WGS84 + EGM96 height (EPSG::9707): RuntimeError: Vertical datum missing: WGS 84 (EPSG::4326) to EGM96 height (EPSG::5773)
Any ideia to solve this issue?