Rasterio xy returns pixel centers by default
@prranitarora▲ 10 net votes
With a north-up affine transform from origin (0,4) and 1-unit pixels, rasterio.transform.xy(transform, 0, 0) returns (0.5, 3.5), the center of the top-left pixel. For the upper-left corner use offset="ul", which returns (0,4); mixing these conventions shifts point samples or vectorized pixel coordinates by half a cell.
1 COMMENT
rasterio.transform.xytakes anoffsetargument with'center'as the default;'ul','ur','ll'and'lr'select the pixel corners. If you have hit a variant of this, share it below.