def polygonal_max(self, geometry, data_type):
"""Finds the max value for each band that is contained within the given geometry.
Args:
geometry (shapely.geometry.Polygon or shapely.geometry.MultiPolygon or bytes): A
Shapely ``Polygon`` or ``MultiPolygon`` that represents the area where the summary
should be computed; or a WKB representation of the geometry.
data_type (type): The type of the values within the rasters. Can either be int or
float.
Returns:
[int] or [float] depending on ``data_type``.
Raises:
TypeError: If ``data_type`` is not an int or float.
"""
if data_type is int:
return self._process_polygonal_summary(geometry, self.srdd.polygonalMax)
elif data_type is float:
return self._process_polygonal_summary(geometry, self.srdd.polygonalMaxDouble)
else:
raise TypeError("data_type must be either int or float.")
评论列表
文章目录