Opened 10 years ago
Last modified 10 years ago
#545 closed task
DEM Scripts Rewrite/Restructure — at Version 1
Reported by: | dac | Owned by: | dac |
---|---|---|---|
Priority: | immediate | Milestone: | The Glorious Future |
Component: | Processing: general | Keywords: | |
Cc: | Other processors: |
Description (last modified by dac)
There are currently a large number of scripts and libraries for DEM related tasks, most commonly used to:
- Create DEMs for use in APL
- Create DEMs from LiDAR data
- Perform general tasks on DEMs (e.g., reprojection)
These scripts are a complicated mix of bash and Python which are very difficult to debug. Previous attempts to simplify them have only increased the complexity.
There are problems with the existing scripts which are proving difficult to fix given the current state of the code, the biggest one is that the DEMs produced are often much larger than needed.
A rewrite/restructure of the existing DEM scripts is therefore proposed with the following aims:
- Use Python instead of bash where possible
- Store common functions within a Python library
- Make use of existing libraries both external (e.g., GDAL, Proj, GRASS Python bindings) and internal where possible.
Given these aims the following is proposed:
New DEM Scripts
create_apl_dem.py
Create DEM subset to navigation data for use in APL. Locations of existing DEMs (ASTER and NMB) will be hardcoded but will allow any DEM mosaic (real or virtual raster) to be provided.
Inputs:
--aster [bool]
--nmb [bool]
--demmosaic [File, if not ASTER or NMB]
--nav [Navigation file]
--projectpath [Path to project]
Outputs:
--outdem [File]
create_dem_from_lidar.py
Create DEM from lidar data
Inputs:
lidar files(s)
--inproj [shouldn't be needed if projection is stored properly with lidar]
--outproj [default same as input]
--aster [bool - patch with aster]
--nmb [bool - patch with nmb]
--mosaic [mosaic if multiple input files are provided]
Outputs:
--outdem [File]
--screenshots [File(s) optional]
New DEM Library
Putting all the DEM functions in a separate module (arsf_dem) is proposed rather than multiple libraries.
|-- arsf_dem | |-- dem_common.py | |-- dem_lidar | | |-- grass_lidar.py | | |-- laspy_lidar.py | | |-- lastools_lidar.py | | |-- lidar_utilities.py | | |-- spdlib_lidar.py | |-- dem_nav_utilities.py | |-- dem_utilities.py |-- scripts | |-- create_apl_dem.py | |-- create_dem_from_lidar.py
Updated library structure.