xdem.DEM.set_area_or_point

xdem.DEM.set_area_or_point#

DEM.set_area_or_point(new_area_or_point, shift_area_or_point=None)#

Set new pixel interpretation of the raster.

Overwrites the area_or_point attribute and updates “AREA_OR_POINT” in raster metadata tags.

Optionally, shifts the raster to correct value coordinates in relation to interpretation:

  • By half a pixel (right and downwards) if old interpretation was “Area” and new is “Point”,

  • By half a pixel (left and upwards) if old interpretration was “Point” and new is “Area”,

  • No shift for all other cases.

Parameters:
  • new_area_or_point (Optional[Literal['Area', 'Point']]) – New pixel interpretation “Area”, “Point” or None.

  • shift_area_or_point (bool | None) – Whether to shift with pixel interpretation, which shifts to center of pixel indexes if self.area_or_point is “Point” and maintains corner pixel indexes if it is “Area” or None. Defaults to True. Can be configured with the global setting geoutils.config[“shift_area_or_point”].

Return type:

None

Returns:

None.