Commit 7c03aa56 authored by luroth's avatar luroth
Browse files

fix: NA if NA in canopy model

parent 145a777d
......@@ -240,18 +240,24 @@ def create_elevation_diff_GeoTiff(file_path_DTM, file_path_DSM, path_output_file
# convert to float16
ph_arr = np.array(ph_arr, dtype=np.float32)
# set to nadata if no value in height model
ph_arr[np.where(dsm_arr == nondata_val)] = nondata_val
# write geoTIFF
driver = gdal.GetDriverByName('GTiff')
ds_ph = driver.Create(path_output_file, xsize=ph_arr.shape[1], ysize=ph_arr.shape[0], bands=1, eType=gdal.GDT_Float32)
band1 = ds_ph.GetRasterBand(1)
band1.WriteArray(ph_arr)
# set geotransform from DTM
ds_ph.SetGeoTransform(dtm_transform)
# set projection
ds_ph.SetProjection(dtm_ds.GetProjection())
band1 = ds_ph.GetRasterBand(1)
band1.WriteArray(ph_arr)
band1.SetNoDataValue(nondata_val)
ds_ph.FlushCache()
# write to file
ds_ph = None
......
......@@ -44,7 +44,7 @@ in a windows comand window:
1. Download the python script [Agisoft_standalone_project_points.py](Agisoft_standalone_project_points.py)
2. Open Agisoft Metascan
3. Select "Tools" -> "Run Script..." and run the downloaded script
4. The menu "ETHZ CS Plugin" appears: ![cs menu](doc/cs_menu.png)
4. The menu "ETHZ CS Plugin" appears: [cs menu](doc/cs_menu.png)
5. Select "ETHZ CS Plugin" -> "Generate image masks"
6. Select the geojson file with the plot polygons that you prepared
7. Select an empty folder where the masks will be saved
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment