james-willis commented on code in PR #749:
URL: https://github.com/apache/sedona-db/pull/749#discussion_r3229039351
##########
rust/sedona-schema/src/raster.rs:
##########
@@ -116,6 +166,23 @@ impl BandDataType {
}
}
+ /// Try to convert from a u32 discriminant value.
+ pub fn try_from_u32(value: u32) -> Option<Self> {
+ match value {
+ 1 => Some(BandDataType::UInt8),
+ 2 => Some(BandDataType::UInt16),
+ 3 => Some(BandDataType::Int16),
+ 4 => Some(BandDataType::UInt32),
+ 5 => Some(BandDataType::Int32),
+ 6 => Some(BandDataType::Float32),
+ 7 => Some(BandDataType::Float64),
+ 8 => Some(BandDataType::UInt64),
+ 9 => Some(BandDataType::Int64),
+ 10 => Some(BandDataType::Int8),
Review Comment:
order is historic, we didn't change it. I think int8 was added later.
It's public because the raster reader in `sedona-raster::array` decodes the
`band.data_type` Arrow column through this method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]