tilupy.raster ============= .. py:module:: tilupy.raster Functions --------- .. autoapisummary:: tilupy.raster.read_raster tilupy.raster.read_tiff tilupy.raster.read_ascii tilupy.raster.write_tiff tilupy.raster.write_ascii tilupy.raster.write_raster Module Contents --------------- Functions ^^^^^^^^^ .. py:function:: read_raster(file: str) -> list[numpy.ndarray] Convert a raster file (tif or asc) into numpy array. :param file: Path to the raster file. :type file: str :returns: X and Y coordinates and data values in numpy array. :rtype: list[np.ndarray] .. py:function:: read_tiff(file: str) -> list[numpy.ndarray] Read and convert a tiff file into numpy array. :param file: Path to the tiff file. :type file: str :returns: X and Y coordinates and data values in numpy array. :rtype: list[np.ndarray] .. py:function:: read_ascii(file: str) -> list[numpy.ndarray] Read and convert a ascii file into numpy array. :param file: Path to the ascii file. :type file: str :returns: X and Y coordinates and data values in numpy array. :rtype: list[np.ndarray] .. py:function:: write_tiff(x: numpy.ndarray, y: numpy.ndarray, z: numpy.ndarray, file_out: str, **kwargs) -> None Write tif file from numpy array. :param x: X coordinates. :type x: np.ndarray :param y: Y coordinates. :type y: np.ndarray :param z: Elevation values. :type z: np.ndarray :param file_out: Name of the output folder. :type file_out: str .. py:function:: write_ascii(x: numpy.ndarray, y: numpy.ndarray, z: numpy.ndarray, file_out: str) -> None Write ascii file from numpy array. :param x: X coordinates. :type x: np.ndarray :param y: Y coordinates. :type y: np.ndarray :param z: Elevation values. :type z: np.ndarray :param file_out: Name of the output folder. :type file_out: str .. py:function:: write_raster(x: numpy.ndarray, y: numpy.ndarray, z: numpy.ndarray, file_out: str, fmt: str = None, **kwargs) -> None Write raster file from numpy array. :param x: X coordinates. :type x: np.ndarray :param y: Y coordinates. :type y: np.ndarray :param z: Elevation values. :type z: np.ndarray :param file_out: Name of the output folder. :type file_out: str :param fmt: Wanted format : "asc", "ascii", "txt", "tif", "tiff". :type fmt: str :raises ValueError: If invalid format.