Clarify relationship between transform and registration#11
Open
maxrjones wants to merge 1 commit into
Open
Conversation
9087757 to
f07ad05
Compare
Contributor
emmanuelmathot
left a comment
There was a problem hiding this comment.
Net improvement that was needed. Thanks @maxrjones. A few inline suggestions to tighten wording.
Non-inline items:
spatial:bboxfield description (above the diff) doesn't mention registration. Worth adding: "Interpretation depends onspatial: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:registrationexplicitly for non-imagery grids."
| - `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) |
Contributor
There was a problem hiding this comment.
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 |
| - `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) |
Contributor
There was a problem hiding this comment.
Suggested change
| - `f`: y-coordinate of pixel (0, 0) | |
| - `f`: y-coordinate of the point `(col_index, row_index) = (0, 0)` in coordinate space |
| 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. |
Contributor
There was a problem hiding this comment.
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. |
|
|
||
| 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. |
Contributor
There was a problem hiding this comment.
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. |
| - 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 |
Contributor
There was a problem hiding this comment.
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 |
This was
linked to
issues
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.