jiayuasu commented on code in PR #3114:
URL: https://github.com/apache/sedona/pull/3114#discussion_r3627602071


##########
docs/api/sql/Raster-Operators/RS_AsRaster.md:
##########
@@ -26,7 +26,7 @@ Introduction: `RS_AsRaster` converts a vector geometry into a 
raster dataset by
 * `pixelType`: Defines data type of the output raster. This can be one of the 
following, D (double), F (float), I (integer), S (short), US (unsigned short) 
or B (byte).
 * `allTouched` (Since: `v1.7.1`): Decides the pixel selection criteria. If set 
to `true`, the function selects all pixels touched by the geometry, else, 
selects only pixels whose centroids intersect the geometry. Defaults to `false`.
 * `value`: The value to be used for assigning pixels covered by the geometry. 
Defaults to using `1.0` if not provided.
-* `noDataValue`: Used for assigning the no data value of the resultant raster. 
Defaults to `null` if not provided.
+* `noDataValue`: Used for assigning the no data value of the resultant raster; 
pixels not covered by the geometry are set to this value. Defaults to `null` if 
not provided, in which case uncovered pixels are `0` and the raster has no no 
data value.

Review Comment:
   I’m okay changing the default behavior while the raster APIs are still 
evolving. When noDataValue is omitted, I’d lean toward using the reference 
band’s nodata value for both the output metadata and the unburned pixels. If 
the reference band has no nodata value, returning an error/null seems 
preferable to inventing one.
   
   I also checked GDAL 3.13.1. It does not have an exact equivalent of Sedona’s 
reference-raster creation model. When updating an existing raster, GDAL 
preserves its nodata metadata and leaves pixels outside the geometry unchanged. 
For a new raster, nodata metadata and initialization are separate options: 
noData/-a_nodata sets metadata, while initValues/-init fills the pixels.



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