Skip to content

Conversation

@vini-fda
Copy link


This PR proposes to replace the unwrap_primitive_type macro with a RasterValue enum, which makes it easier to add more types later. It also adds the convenience methods sample_type, get_value_at and get_value_at_pixel to the GeoTIFF struct.

The reasoning behind this change is to make a more ergonomic API to add the CInt32 and CInt32 data types in another PR (see #24).

Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

Sorry for the late review @vini-fda. This PR looks ok to me, a little unfortunate that we can't use the primitive converters from num-traits to support complex numbers, but I guess we'll have to settle with more verbose code.

If you remove the num-traits dependency and re-lock the Cargo.lock file, I can merge this afterwards. Thanks again!

geo-index = { version = "0.1", optional = true }
geo-types = { version = "0.7" }
num_enum = "0.7"
num-traits = "0.2"
Copy link
Member

Choose a reason for hiding this comment

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

Since we're not using num_traits::FromPrimitive anymore, I guess this dependency can be removed?

Suggested change
num-traits = "0.2"

@jurisk
Copy link

jurisk commented Jun 26, 2025

I appreciate you adding a get_value_at_pixel for an easier migration path from the 0.0 version. Thank you!

@weiji14
Copy link
Member

weiji14 commented Sep 8, 2025

@vini-fda, ok if I push changes directly here to resolve the merge conflict, and then merge this PR in?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants