pygmi.raster.reproj#

Raster reprojection functions.

Classes#

GroupProj

Group Projection GUI widget.

Functions#

data_reproject(data, ocrs[, otransform, orows, ...])

Reproject dataset.

getepsgcodes()

Routine used to get a list of EPSG codes.

transform_exists(crs_from_id, crs_to_id)

Check if transform exists.

Module Contents#

class pygmi.raster.reproj.GroupProj(title='Projection', parent=None)#

Bases: PySide6.QtWidgets.QWidget

Group Projection GUI widget.

Parameters:
  • parent – Reference to the parent routine. The default is None.

  • title (str) – Title for QGroupBox - self.gbox.

set_current(wkt)#

Set new WKT for current option.

Parameters:

wkt (str) – Well Known Text descriptions for coordinates (WKT).

combo_datum_change()#

Change datum combo.

combo_change()#

Change Combo.

pygmi.raster.reproj.data_reproject(data, ocrs, otransform=None, orows=None, ocolumns=None, icrs=None, showlog=print, forcereproj=False)#

Reproject dataset.

Parameters:
  • data (pygmi.raster.datatypes.Data) – PyGMI dataset.

  • ocrs (pyproj.crs.CRS) – output crs.

  • otransform (rasterio.Affine | None) – Output affine transform. The default is None.

  • orows (int | None) – output rows. The default is None.

  • ocolumns (int | None) – output columns. The default is None.

  • icrs (pyproj.crs.CRS | None) – input crs. The default is None.

  • showlog (collections.abc.Callable[..., None]) – Display information. The default is print.

  • forcereproj (bool) – Force a reprojection, the default is False.

Returns:

Reprojected dataset.

Return type:

Data

pygmi.raster.reproj.getepsgcodes()#

Routine used to get a list of EPSG codes.

Returns:

Dictionary of codes per projection in WKT format.

Return type:

dict

pygmi.raster.reproj.transform_exists(crs_from_id, crs_to_id)#

Check if transform exists.

Parameters:
  • crs_from_id (str | int | pyproj.crs.CRS) – CRS input definition.

  • crs_to_id (str | int | pyproj.crs.CRS) – CRS output definition.

Returns:

True if a transformation exists, False otherwise.

Return type:

bool