james-willis commented on code in PR #749:
URL: https://github.com/apache/sedona-db/pull/749#discussion_r3228732807
##########
rust/sedona-raster-functions/src/rs_convexhull.rs:
##########
@@ -107,8 +107,18 @@ impl SedonaScalarKernel for RsConvexHull {
/// of the raster in world coordinates. Due to skew/rotation in the affine
/// transformation, each corner must be computed individually.
fn write_convexhull_wkb(raster: &dyn RasterRef, out: &mut impl std::io::Write)
-> Result<()> {
- let width = raster.metadata().width() as i64;
- let height = raster.metadata().height() as i64;
+ let Some(width) = raster.width() else {
+ return Err(DataFusionError::Execution(
+ "Raster has no spatial dimensions; cannot determine width".into(),
+ ));
+ };
Review Comment:
done
##########
rust/sedona-raster-functions/src/rs_envelope.rs:
##########
@@ -105,8 +105,18 @@ impl SedonaScalarKernel for RsEnvelope {
/// derives the min/max X and Y to produce an axis-aligned bounding box.
/// For skewed/rotated rasters, this differs from the convex hull.
fn write_envelope_wkb(raster: &dyn RasterRef, out: &mut impl std::io::Write)
-> Result<()> {
- let width = raster.metadata().width() as i64;
- let height = raster.metadata().height() as i64;
+ let Some(width) = raster.width() else {
+ return Err(DataFusionError::Execution(
+ "Raster has no spatial dimensions; cannot determine width".into(),
+ ));
+ };
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]