feat: add origin property and set_origin() method - #443
Merged
nathanjmcdougall merged 3 commits intoMay 20, 2026
Conversation
…lation Add Raster.origin property (getter + setter) and Raster.set_origin() immutable method to adjust the affine transform origin without modifying pixel data. This enables normalizing non-standard longitude conventions (e.g. -200 to -170 -> 160 to 190) before spatial operations. Closes #442
b-j-karl
suggested changes
May 19, 2026
b-j-karl
left a comment
Contributor
There was a problem hiding this comment.
approved once spec is clarified
|
nathanjmcdougall
deleted the
442-feature-request-shift_bounds-translate_bounds-method-for-longitude-wrapping
branch
May 20, 2026 00:00
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.

0 New Issues
0 Fixed Issues
0 Accepted Issues
Summary
Adds
Raster.originproperty (getter + setter) andRaster.set_origin(*, x=None, y=None)immutable method to adjust the affine transform origin without modifying pixel data.Motivation
When working with ShakeMap rasters near the antimeridian, some source rasters arrive with non-standard longitude conventions (e.g. bounds from -200 to -170). This causes spatial operations like
to_bounds()to produce all-NaN output due to no overlap with standard EPSG:4326 bounds.Usage
Changes
Raster.originproperty (getter): returns(transform.c, transform.f)Raster.originsetter: mutates transform translation in place (notebook/interactive use)Raster.set_origin(*, x=None, y=None): returns new Raster with updated origin (pipeline use)docs/specs/2025-05-20-set-origin-design.mdCloses #442