-
-
Notifications
You must be signed in to change notification settings - Fork 77
add Cell.xy for RasterLayer cell coordinates and clarify pos/indices semantics #298
Copy link
Copy link
Closed
Labels
Description
What's the problem this feature will solve?
Mesa-Geo's RasterLayer / Cell APIs expose grid coordinates (cell.pos) and raster indices (cell.indices), but there is no direct way to access a cell's real-world / CRS coordinates. This is confusing for users working with georeferenced rasters, because positions looks like "(x, y)" and the layer carries CRS/transform metadata, so it’s natural to expect Cell.pos to be physical coordinates.
Describe the solution you'd like
- Add
cell.xyreturning the cell's geographic/projected (x, y) coordinates, which is the cell center. - Add new properties:
cell.grid_posforcell.pos, Mesa-like coordinates, that also use[x, y](int) but for grid space. (mesa doc)cell.rowcolforcell.indices, (row, col) indexing.
- Depreate current
cell.posandcell.indiceswith a warning stating that they will be removed in a future release.
Additional context
- Confusion example: Invalid pos/index within RasterLayer (geographic spatial location not exposed to GeoSpace / RasterLayer)? #267
- Rasterio docs on Transforms: https://rasterio.readthedocs.io/en/stable/topics/transforms.html where (x, y) conventionally referrs to real-world geographic/projected coordinates, and (row, col) are indices.
Reactions are currently unavailable