Skip to content

add Cell.xy for RasterLayer cell coordinates and clarify pos/indices semantics #298

@wang-boyu

Description

@wang-boyu

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

  1. Add cell.xy returning the cell's geographic/projected (x, y) coordinates, which is the cell center.
  2. Add new properties:
  • cell.grid_pos for cell.pos, Mesa-like coordinates, that also use [x, y] (int) but for grid space. (mesa doc)
  • cell.rowcol for cell.indices, (row, col) indexing.
  1. Depreate current cell.pos and cell.indices with a warning stating that they will be removed in a future release.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions