Skip to content

Commit

Permalink
✨ Get affine transformation from GeoTIFF (#8)
Browse files Browse the repository at this point in the history
* ➕ Add geo

Geospatial primitives and algorithms!

* ✨ Get affine transformation from GeoTIFF

Implement transform method in CogReader struct to get affine transformation matrix from GeoTIFF via ModelPixelScaleTag and ModelTiepointTag. Added a unit test to check that the x/y pixel size and top left origin pixel coordinates is correct.

* 📝 Document transform method's internal properties

Explicitly mentioning the internal fields of the AffineTransform struct, specifically the pixel resolution, rotation and origin, and included a reference to the GeoTIFF standard. Also renamed origin_x/origin_y to x_origin/y_origin.

* 🚧 Raise unimplemented when getting non-zero rotation values

Supposed to be parsed from the ModelTransformationTag, but haven't found a sample GeoTIFF online with non-zero rotation to implement this properly with a unit test, so marking as unimplemented for now.
  • Loading branch information
weiji14 authored Mar 13, 2024
1 parent 2e463a7 commit 1b8fac8
Show file tree
Hide file tree
Showing 3 changed files with 267 additions and 4 deletions.
190 changes: 189 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ crate-type = ["cdylib"]

[dependencies]
bytes = "1.5.0"
geo = "0.28.0"
ndarray = "0.15.6"
numpy = "0.20.0"
object_store = { version = "0.9.0", features = ["http"] }
Expand Down
Loading

0 comments on commit 1b8fac8

Please sign in to comment.