:py:mod:`wolfhece.Coordinates_operations` ========================================= .. py:module:: wolfhece.Coordinates_operations Module Contents --------------- .. py:function:: transform_chunk_coordinates(inputEPSG: str, outputEPSG: str, chunk: numpy.ndarray) Transforms a chunk of coordinates :param inputEPSG: input EPSG code (e.g. "EPSG:3812") :type inputEPSG: str :param outputEPSG: output EPSG code (e.g. "EPSG:31370") :type outputEPSG: str :param chunk: list of points to be transformed :type chunk: np.ndarray .. py:function:: transform_coordinates(points: numpy.ndarray, inputEPSG: str = 'EPSG:3812', outputEPSG: str = 'EPSG:31370', chunk_size: int = 1000) Transforms coordinates in batches using multiprocessing. If more than chunk_size points are provided, the function will split the points into chunks and transform them in parallel => requiring in the main script to use the statement if __name__ == '__main__':. :param points: Array of coordinates to be transformed :type points: numpy.ndarray :param inputEPSG: (optional) Input EPSG code. Defaults to "EPSG:3812" :type inputEPSG: str :param outputEPSG: (optional) Output EPSG code. Defaults to "EPSG:31370" :type outputEPSG: str :param chunk_size: (optional) Size of each batch for transformation. Defaults to 100000 :type chunk_size: int :return numpy.ndarray: Transformed coordinates .. py:function:: reproject_and_resample_raster(input_raster_path: str, output_raster_path: str, input_srs: str = 'EPSG:3812', output_srs: str = 'EPSG:31370', resampling_method: str | int = gdal.GRA_Bilinear, xRes: float = 0.5, yRes: float = 0.5, debug: bool = False) Use gdal to open a tiff raster in a given input EPSG 'inputEPSG' and transforms the raster into another EPSG system 'outputEPSG'. The resolution can be forced through xRes and yRes (the origin will be rounded to the nearest multiple of the resolution). The resampling method can be chosen among the gdal GRA_* constants (gdal.GRA_Average; gdal.GRA_Bilinear; gdal.GRA_Cubic; gdal.GRA_CubicSpline; gdal.GRA_Lanczos; gdal.GRA_Mode; gdal.GRA_NearestNeighbor). :param input_raster_path: the path to the input raster file (.tif or .tiff) :type input_raster_path: str :param output_raster_path: the path to the output raster file (.tif or .tiff) that will be created :type output_raster_path: str :param input_srs: Input EPSG code. Defaults to Lambert 2008 "EPSG:3812" :type input_srs: str :param output_srs: Output EPSG code. Defaults to Lambert 72 "EPSG:31370" :type output_srs: str :param resampling_method: Resampling method. Defaults to gdal.GRA_Bilinear :type resampling_method: int, str :param xRes: Resolution along X. Defaults to 0.5 :type xRes: float :param yRes: Resolution along Y. Defaults to 0.5 :type yRes: float :param debug: If True, print debug information. Defaults to False :type debug: bool