src.inout.geotiff_io
Classes
- class src.inout.geotiff_io.GeoTiffIO
- Author:
Alberto M. Esmoris Pena
Class with util static methods for input/output operations related to GeoTiff files.
- static write(x, path, **kwargs)
Write the given data to a GeoTiff file.
- Parameters:
x (
PointCloudor tuple) – It can be either a point cloud or a tuple where the first element is the matrix of coordinates representing a point cloud and the second element is a raster-like grid of features representing the point cloud.path – Path where the GeoTiff file must be written.
kwargs – The key-word arguments governing the writing of the GeoTiff file.
- Returns:
Nothing, but a GeoTiff file is written to the given path.
- static write_pcloud(pcloud, path, **kwargs)
Write a point cloud as a GeoTiff file located at given path.
- Parameters:
pcloud – The point cloud to be written. It can be None, in which case the kwargs dictionary must contain an X element giving a matrix of coordinates and an F element giving the matrix of features.
path (str) – Path where the GeoTiff file must be written.
kwargs (dict) – The key-word arguments governing the GeoTiff specification and its writing.
- Returns:
Nothing
- static write_pcloud_as_geotiff(pcloud, path, **kwargs)
Assist the
geotiff_io.GeoTiffIO.write()method.- Returns:
Nothing, but writes the GeoTiff file.
- static write_grid_as_geotiff(X, Fgrid, path, **kwargs)
Assist the
geotiff_io.GeoTiffIO.write()method.- Parameters:
X – The matrix of coordinates representing a point cloud.
Fgrid – The raster-like grid of features representing a point cloud.
path – The path where the GeoTiff file must be written.
kwargs – The key-word arguments governing the writing of the GeoTiff file.
- Returns:
Nothing, but a GeoTiff file is written at given path.
- static build_fgrid_from_pcloud(Xgrid, X2D, F, width, height, xres, yres)
Build a grid of features from the given point cloud data.
- Parameters:
Xgrid – The grid of 2D coordinates.
X2D – The 2D coordinates matrix representing the point cloud.
F – The feature matrix representing the point cloud.
width – The number of cells along the x-axis.
height – The number of cells along the y-axis.
xres – The step size along the x-axis.
yres – The step size along the y-axis.
- Returns:
The grid of features corresponding to the grid of 2D coordinates and the given matrix of features.
- Return type:
np.ndarray
- static validate_geotiff_spec(crs, driver, xres, yres)
Validate whether the given GeoTiff specification is correct or not.
- Returns:
Nothing, but an Exception will be thrown if the specification is not valid.
- static generate_raster(X, xres, yres)
Generate a raster for the given point cloud considering the requested cell size.
- Parameters:
X – The matrix of coordinates representing the point cloud for which the raster must be generated.
xres – The cell size along the x-axis.
yres – The cell size along the y-axis.
- Returns:
The width, height, window, transform, xmin, xmax, ymin, and ymax values defining the generated raster.