ioevaamapcreator package

Submodules

ioevaamapcreator.evaa_map_builder module

Raster Data Management Module.

This module provides utilities for processing and transforming raster data specifically related to elevation maps. It supports operations such as reading elevation data from various formats, applying transformations to elevation data, and writing out transformed data to grid float format based on specific requirements.

Key functionalities include: - Reading elevation data from NED (National Elevation Dataset) files. - Converting elevation data between different raster formats. - Generating High Accuracy Elevation (HAE) maps by applying undulation corrections

to elevation maps.

  • Writing out processed elevation maps to specified output directories in grid float format, adhering to requirements for further analysis or usage.

The module makes extensive use of the rasterio and numpy libraries for raster data manipulation, along with custom objects like RasterMap and RasterBand to encapsulate raster operations. It is designed to be used in conjunction with geospatial analysis workflows, particularly in preparing data for hydrological modelling and analysis.

See the function write_grid_float_maps for details on writing elevation data to grid float format, including necessary transformations and format conversions. Refer to external documentation on raster format conversion at: https://wiki.tuflow.com/Raster_Format_Conversion_Using_gdal_translate for more information on the underlying processes.

Dependencies: - numpy - rasterio - Custom modules: iocommon, ioraster, iovector

Note:

This module is part of the IO-Aero geospatial analysis suite and is intended for use within specific project contexts. Ensure compatibility with project requirements and data formats before use.

class ioevaamapcreator.evaa_map_builder.EvaaMapCreator(file_df: DataFrame, out_folder: Path, start_prog: int)

Bases: QObject

Class to create HAE maps from NED data.

This class provides methods to create Height Above Ellipsoid (HAE) maps from National Elevation Dataset (NED) data. It supports reading elevation data from NED files, applying undulation corrections, and writing out the processed data to grid float format for further analysis.

finished
progress
progress_updated
__init__(file_df: DataFrame, out_folder: Path, start_prog: int) None

Initialize the EvaaMapCreator class.

Args:

box (BoundingBox): The bounding box to process for HAE maps. file_df (pd.DataFrame): The DataFrame containing information about the source NED files. out_folder (Path): The output folder where the HAE maps will be saved. start_prog (int): The starting progress bar value for the operation.

run() None

Run the EvaaMapCreator class.

manage_build_process(file_df: DataFrame, out_folder: Path) None

Manage the build process for HAE maps.

This method manages the build process for creating High Accuracy Elevation (HAE) maps from National Elevation Dataset (NED) files. It iterates over the bounding box and processes the elevation data for each cell, applying undulation corrections and writing out the HAE maps to the specified output folders.

Args:

box (BoundingBox): The bounding box to process for HAE maps. file_df (pd.DataFrame): The DataFrame containing information about the source NED files. out_folder (Path): The output folder where the HAE maps will be saved.

write_grid_float_maps(elev_map: RasterMap, output_base_folder: str, lat: float, lon: float) None

Write a grid float map to a specified folder.

Write a grid float map to a specified folder based on specific requirements, including format conversion from bil to flt. This operation is guided by RA requirements and adheres to the format conversion practices outlined in the gdal_translate documentation.

For more information on raster format conversion, see: https://wiki.tuflow.com/Raster_Format_Conversion_Using_gdal_translate

Args:

elev_map: The elevation map object to be written. output_base_folder: The base directory where the grid float map and

its header file will be saved.

lat: The southern latitude of the map’s boundary. lon: The western longitude of the map’s boundary.

staticMetaObject = PySide6.QtCore.QMetaObject("EvaaMapCreator" inherits "QObject": Methods:   #4 type=Signal, signature=finished()   #5 type=Signal, signature=progress(int), parameters=int   #6 type=Signal, signature=progress_updated(int), parameters=int )

ioevaamapcreator.evaamapcreator module

IO-EVAA-MAP-CREATOR interface.

ioevaamapcreator.evaamapcreator.ARG_TASK = ''

Placeholder for the command line argument ‘task’.

Type:

str

ioevaamapcreator.evaamapcreator.check_arg_task(args: Namespace) None

Check the command line argument: -t / –task.

Args:

args (argparse.Namespace): Command line arguments.

ioevaamapcreator.evaamapcreator.get_args() None

Load the command line arguments into the memory.

ioevaamapcreator.evaamapcreator.progress_msg(msg: str) None

Create a progress message.

Args:

msg (str): Progress message

ioevaamapcreator.evaamapcreator.progress_msg_time_elapsed(duration: int, event: str) None

Create a time elapsed message.

Args:

duration (int): Time elapsed in ns. event (str): Event description.

ioevaamapcreator.evaamapcreator.terminate_fatal(error_msg: str) None

Terminate the application immediately.

Args:

error_msg (str): Error message

ioevaamapcreator.evaamapcreator.version() str

Return the version number of the IO-XPA-DATA application.

Returns:

str

Return type:

The version number of the IO-XPA-DATA application

ioevaamapcreator.glob_local module

Global constants and variables.

ioevaamapcreator.glob_local.ARG_TASK = 'task'

A constant key used to reference the ‘task’ argument in function calls and command line arguments throughout the software.

Type:

str

ioevaamapcreator.glob_local.ARG_TASK_CHOICE = ''

Initially set to an empty string, this variable is intended to hold the user’s choice of task once determined at runtime.

Type:

str

ioevaamapcreator.glob_local.ARG_TASK_VERSION = 'version'

A constant key used to reference the ‘version’ argument for tasks, indicating the version of the task being used.

Type:

str

ioevaamapcreator.glob_local.CHECK_VALUE_TEST = True

A boolean indicating whether the check value from io_settings is ‘test’.

Type:

bool

ioevaamapcreator.glob_local.FATAL_00_926 = "FATAL.00.926 The task '{task}' is invalid"

Error message template indicating that the specified task is invalid.

Type:

str

ioevaamapcreator.glob_local.INFO_00_004 = 'INFO.00.004 Start Launcher'

Information message indicating the start of the launcher.

Type:

str

ioevaamapcreator.glob_local.INFO_00_005 = "INFO.00.005 Argument '{task}'='{value_task}'"

Information message indicating the value of a specific argument in the launcher.

Type:

str

ioevaamapcreator.glob_local.INFO_00_006 = 'INFO.00.006 End Launcher'

Information message indicating the end of the launcher.

Type:

str

ioevaamapcreator.glob_local.INFORMATION_NOT_YET_AVAILABLE = 'n/a'

Placeholder indicating that information is not yet available.

Type:

str

ioevaamapcreator.glob_local.IO_EVAA_MAP_CREATOR_VERSION = '9.9.9'

The current version number of the IO-Aero evaa map creator application.

Type:

str

ioevaamapcreator.glob_local.LOCALE = 'en_US.UTF-8'

Default locale setting for the system to ‘en_US.UTF-8’, ensuring consistent language and regional format settings.

Type:

str

ioevaamapcreator.main_map_creator_win module

ioevaamapcreator.main_window module

ioevaamapcreator.ned_download module

Used to manage sources and download NED files from the USGS bucket.

class ioevaamapcreator.ned_download.DownloadWorker(source_folder: Path, box: BoundingBox, remove_redundant: bool = False, download_latest: bool = False, max_progress: int = 100)

Bases: QObject

Worker class to download files in a separate thread.

finished
progress
progress_updated
__init__(source_folder: Path, box: BoundingBox, remove_redundant: bool = False, download_latest: bool = False, max_progress: int = 100) None

Initialize the worker class.

Args:

source_folder (Path): The folder where the files are located. box (BoundingBox): The bounding box to search for. remove_redundant (bool): If True, remove older NED files download_latest (bool): If True, download the latest NED files regardless of what is

in the source folder.

max_progress (int): The maximum progress value.

run() None

Run the worker.

manage_source_files(source_folder: Path, box: BoundingBox, remove_redundant: bool = False, download_latest: bool = False) None

Search for files in the source folder that intersect with the bounding box.

Args:

source_folder (Path): The folder where the files are located. box (BoundingBox): The bounding box to search for. remove_redundant (bool): If True, remove older NED files download_latest (bool): If True, download the latest NED files regardless of what is

in the source folder.

download_files_in_bucket(lat: int, lon: int, download_path: Path, current_file: Path = PosixPath('.')) Path

Download the files that are in the bucket to our local directory.

Args:

lat (int): The latitude of the file. lon (int): The longitude of the file. download_path (Path): where to put the downloaded file. current_file (Path): No need to download a new file if its the same one as you have

Returns:

str: The name of the file that was downloaded or “” if no file was downloaded.

staticMetaObject = PySide6.QtCore.QMetaObject("DownloadWorker" inherits "QObject": Methods:   #4 type=Signal, signature=finished()   #5 type=Signal, signature=progress(int), parameters=int   #6 type=Signal, signature=progress_updated(int), parameters=int )

ioevaamapcreator.save_or_cont module

Module contents

IO-EVAA-MAP-CREATOR.