james-willis commented on code in PR #749:
URL: https://github.com/apache/sedona-db/pull/749#discussion_r3228731289


##########
rust/sedona-raster-functions/src/rs_band_accessors.rs:
##########
@@ -224,16 +225,19 @@ fn get_nodata_value(
             Ok(())
         }
         Some(raster) => {
-            let num_bands = raster.bands().len();
+            let num_bands = raster.num_bands();
             if band_index < 1 || band_index > num_bands as i32 {
                 builder.append_null();
                 return Ok(());
             }
-            let band = raster.bands().band(band_index as usize)?;
-            let band_meta = band.metadata();
-            match band_meta.nodata_value_as_f64()? {
-                None => builder.append_null(),
-                Some(val) => builder.append_value(val),
+            let idx = (band_index - 1) as usize;
+            match (raster.band_nodata(idx), raster.band_data_type(idx)) {
+                (Some(bytes), Some(dt)) => {
+                    let val = nodata_bytes_to_f64(bytes, &dt)
+                        .map_err(datafusion_common::DataFusionError::from)?;

Review Comment:
   done



-- 
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]

Reply via email to