iGN5117 commented on code in PR #972:
URL: https://github.com/apache/sedona/pull/972#discussion_r1294820079
##########
common/src/test/java/org/apache/sedona/common/raster/FunctionsTest.java:
##########
@@ -76,6 +76,14 @@ public void valueWithMultibandRaster() throws
TransformException {
assertEquals(255d, PixelFunctions.value(multiBandRaster,
point(4.5d,4.5d), 4), 0.1d);
}
+ @Test
+ public void testPixelAsPolygon() throws FactoryException,
TransformException {
+ GridCoverage2D emptyRaster = RasterConstructors.makeEmptyRaster(1, 5,
10, 123, -230, 8);
+ String actual = PixelFunctions.getPixelAsPolygon(emptyRaster, 2,
3).toString();
Review Comment:
Use Functions.asWKT() instead of toString() here
##########
docs/api/sql/Raster-operators.md:
##########
@@ -32,6 +32,26 @@ Output:
IndexOutOfBoundsException: Specified pixel coordinates (6, 2) do not lie in
the raster
```
+### RS_PixelAsPolygon
+
+Introduction: Returns a polygon geometry that bounds the specified pixel.The
pixel coordinates specified are 1-indexed.
+
+Format: `RS_PixelAsPolygon(raster: Raster, colX:int, rowY:int)`
+
+Since: `v1.5.0`
+
+Spark SQL Example:
+
+```sql
+SELECT ST_AsText(RS_PixelAsPolygon(raster, 2, 3)) FROM rasters
Review Comment:
Please use MakeEmptyRaster wherever possible in examples so that it is clear
to the reader
--
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]