Closed NengLu closed 4 years ago
Greetings,
Thanks for the info. Looks like it's an off-by-one difference.
In GDAL, the lower-right coordinate of the bbox is the upper-left corner of the lower-right pixel.
In pysheds, the lower-right coordinate of the bbox is the lower-right corner of the lower-right pixel:
@property
def bbox(self):
shape = self.shape
xmin, ymax = self.affine * (0,0)
xmax, ymin = self.affine * (shape[1] + 1, shape[0] + 1)
_bbox = (xmin, ymin, xmax, ymax)
return _bbox
The desired behavior depends on your application. For instance, the bbox as defined in GDAL doesn't appear to capture the full area of all the cells.
Thanks for the tips.
Hi, thanks for developing this good package, but the grid.bbox is not the same as read from gdalinfo, take the dem.tif form this package for example:
The grid.bbox should be ( -97.4850000,32.5225000, -97.1791667,32.8216667). But actually: