jiayuasu commented on issue #1047:
URL: https://github.com/apache/sedona/issues/1047#issuecomment-1751127432
@JimShady I wonder what exactly you mean for `geotiff` to `h3`?
With the new H3 functions added in Sedona, the following are now possible:
1. GeoTiff geo-envelope -> H3 cells
```
df1 = df.selectExpr("raster", "ST_H3CellIDs(RS_Envelope(raster) as h3)")
df2 = df1.select(col("raster"), explode(col("h3")).as("h3"))
```
2. Individual pixel location + corresponding observed band value -> H3 cells
+ values
```
df1 = df.selectExpr("ST_Point(RS_RasterToWorldCoordX(raster, colX, rowY),
RS_RasterToWorldCoordY(raster, raster, colX, rowY)) as pixelWorldCoord",
"RS_Value(raster, pixelWorldCoord) as observed_value")
```
--
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]