Skip to content

Clarify relationship between transform and registration#11

Open
maxrjones wants to merge 1 commit into
mainfrom
clarify-registration
Open

Clarify relationship between transform and registration#11
maxrjones wants to merge 1 commit into
mainfrom
clarify-registration

Conversation

@maxrjones
Copy link
Copy Markdown
Collaborator

The transform section was written before the registration field was added. This PR makes the two sections consistent. This content is aligned with the GeoTIFF raster space model, where the transform origin meaning depends on registration type.

@emmanuelmathot emmanuelmathot force-pushed the clarify-registration branch from 9087757 to f07ad05 Compare May 13, 2026 20:44
Copy link
Copy Markdown
Contributor

@emmanuelmathot emmanuelmathot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Net improvement that was needed. Thanks @maxrjones. A few inline suggestions to tighten wording.

Non-inline items:

  • spatial:bbox field description (above the diff) doesn't mention registration. Worth adding: "Interpretation depends on spatial:registration; see that section."
  • The Python conversion snippet (list(affine_transform)[:6]) is a half-pixel trap under "node" — rasterio/GDAL are corner-anchored. Either scope the snippet to "pixel" or branch on registration.
  • Consider keeping one line of the removed "Important considerations": "Misidentifying registration shifts data by half a cell; producers SHOULD set spatial:registration explicitly for non-imagery grids."

Comment thread README.md
- `a`: pixel width (w-e pixel resolution)
- `b`: row rotation (typically 0)
- `c`: x-coordinate of the upper-left corner of the upper-left pixel
- `c`: x-coordinate of pixel (0, 0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pixel (0, 0) is ambiguous (array element vs. continuous point). Anchor it to the formula's variables:

Suggested change
- `c`: x-coordinate of pixel (0, 0)
- `c`: x-coordinate of the point `(col_index, row_index) = (0, 0)` in coordinate space

Comment thread README.md
- `d`: column rotation (typically 0)
- `e`: pixel height (n-s pixel resolution, negative value for north-up images)
- `f`: y-coordinate of the upper-left corner of the upper-left pixel
- `f`: y-coordinate of pixel (0, 0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `f`: y-coordinate of pixel (0, 0)
- `f`: y-coordinate of the point `(col_index, row_index) = (0, 0)` in coordinate space

Comment thread README.md
The meaning of pixel (0, 0) depends on `spatial:registration`:

This follows the GDAL geotransform and Python's Affine library convention.
- **`"pixel"` (default):** Pixel (0, 0) refers to the **top-left corner** of the top-left pixel. The pixel value fills the area from (0, 0) to (1, 1). An N×M image covers the bounds (0, 0) to (N, M). Coefficients `c` and `f` give the corner coordinates.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **`"pixel"` (default):** Pixel (0, 0) refers to the **top-left corner** of the top-left pixel. The pixel value fills the area from (0, 0) to (1, 1). An N×M image covers the bounds (0, 0) to (N, M). Coefficients `c` and `f` give the corner coordinates.
- **`"pixel"` (default):** The point `(col_index, row_index) = (0, 0)` is the **top-left corner** of the top-left pixel. The pixel value covers the index-space area from (0, 0) to (1, 1). An N×M image covers index-space bounds (0, 0) to (N, M). Coefficients `c` and `f` give the coordinates of that corner.

Comment thread README.md

This follows the GDAL geotransform and Python's Affine library convention.
- **`"pixel"` (default):** Pixel (0, 0) refers to the **top-left corner** of the top-left pixel. The pixel value fills the area from (0, 0) to (1, 1). An N×M image covers the bounds (0, 0) to (N, M). Coefficients `c` and `f` give the corner coordinates.
- **`"node"`:** Pixel (0, 0) refers to the **point location** of the top-left pixel. The pixel value is a point measurement at that location. An N×M image covers the bounds (0, 0) to (N-1, M-1). Coefficients `c` and `f` give the point coordinates. If displayed with pixel cells, the top-left corner of the display would be at (-0.5, -0.5) in index space.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clearer to call it a node/center and state both the node extent and the footprint together:

Suggested change
- **`"node"`:** Pixel (0, 0) refers to the **point location** of the top-left pixel. The pixel value is a point measurement at that location. An N×M image covers the bounds (0, 0) to (N-1, M-1). Coefficients `c` and `f` give the point coordinates. If displayed with pixel cells, the top-left corner of the display would be at (-0.5, -0.5) in index space.
- **`"node"`:** The point `(col_index, row_index) = (0, 0)` is the **node/center** of the top-left pixel. The pixel value is a point measurement at that location. The N×M grid of nodes spans index-space (0, 0) to (N-1, M-1); the displayed cell footprints extend to (-0.5, -0.5)–(N-0.5, M-0.5). Coefficients `c` and `f` give the coordinates of that node.

Comment thread README.md
- Commonly used in images to prevent edge pixels from being cut in half
- A global grid will touch the edges of the poles without covering their centers
- Each cell in one registration overlaps quadrants of four cells in the corresponding node-registration
- An N×M image covers bounds (0, 0) to (N-1, M-1) in index space
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pin down what spatial:bbox reports under node registration (this is the common reader trap):

Suggested change
- An N×M image covers bounds (0, 0) to (N-1, M-1) in index space
- An N×M image covers bounds (0, 0) to (N-1, M-1) in index space; `spatial:bbox` reports the extent of node coordinates (outermost cell *centers*), not the half-cell-padded footprint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spatial:registration Clarify text around transform origin being top-left corner

2 participants