james-willis commented on code in PR #3114:
URL: https://github.com/apache/sedona/pull/3114#discussion_r3668246952
##########
common/src/main/java/org/apache/sedona/common/raster/RasterConstructors.java:
##########
@@ -130,8 +131,35 @@ public static GridCoverage2D asRaster(
boolean useGeometryExtent)
throws FactoryException {
+ // Reject a burn value that cannot be represented in the target pixel
type, for the same reason
+ // the noDataValue is rejected below: silently coercing an out-of-range or
fractional value (for
+ // example 265 -> 9 in an unsigned 8-bit band) would store a different
number than the caller
+ // asked to burn. Unlike noDataValue this is a primitive double, so it is
always validated.
+ RasterUtils.assertRepresentable(value, pixelType, "value");
Review Comment:
Ok. I did this. I'm not sure about it still. People can always cast some
literal to float.
--
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]