geo3d.rasters.types =================== .. py:module:: geo3d.rasters.types Classes ------- .. autoapisummary:: geo3d.rasters.types.GeoTransform geo3d.rasters.types.Raster Module Contents --------------- .. py:class:: GeoTransform(/, **data: Any) Bases: :py:obj:`pydantic.BaseModel` GeoTransform class. .. py:attribute:: xorigin :type: float .. py:attribute:: yorigin :type: float .. py:attribute:: pixelwidth :type: float .. py:attribute:: pixelheight :type: float .. py:attribute:: rowrotation :type: float .. py:attribute:: columnrotation :type: float .. py:attribute:: size :type: Tuple[int, int] .. py:method:: dump() -> dict Convert to a dictionary object. :returns: A GeoTransform dictionary with the same keys as the object's attributes. :rtype: dict .. py:method:: resize(new_size: Tuple[int, int]) -> GeoTransform Adapt the GeoTransform dataclass for a different image size. :param new_size: New image size. :type new_size: Tuple[int, int] :returns: A new GeoTransform instance. :rtype: GeoTransform .. py:method:: pixels2coordinates(pixels: Tuple[int, int]) -> Tuple[float, float] Convert a pixel position to a geometric coordinates. :param pixels: The position of a pixel as (col, row). :type pixels: Tuple[int, int] :returns: The geometric coordinates of a pixel position. :rtype: Tuple[float, float] .. py:class:: Raster(dataset: osgeo.gdal.Dataset) Class for defining raster objects. .. py:attribute:: color_file .. py:attribute:: ds_ .. py:method:: read(path: str) -> Raster :classmethod: Create a raster object from a file. :param path: The path to the raster object. :type path: str :returns: The created raster object. :rtype: Raster .. py:property:: width :type: int Get the width of the raster. :returns: The width value. :rtype: int .. py:property:: height :type: int Get the height of the raster. :returns: The height value. :rtype: int .. py:property:: dimensions :type: Tuple[int, int] Get the dimensions of the raster. :returns: The width x height. :rtype: Tuple[int, int] .. py:property:: geotransform :type: GeoTransform Get the affine transformation. :rtype: Tuple[int | float] .. py:method:: to_png(output_path: str, colors: bool = True) -> None Convert the raster to a PNG image. :param output_path: The path to the output image file. :type output_path: str :param colors: Apply color relief if True. Defaults to True. :type colors: bool, optional .. py:method:: close() -> None Close the raster.