This is a draft effort to add focal operations which require use of pixel buffer per tile to provide the cell neighborhood information around tile edges. This PR moves https://github.com/locationtech/rasterframes/pull/487 closer to develop and adds Python wrappers for focal operations along with elevation related operations (slope, aspect, hillshade).
Currently this PR brings over geotrellis.raster.BufferTile implementation for convenience of iteration. I don't think its in its final form and having it here greatly simplifies the development process. This will be moved to GeoTrellis proper at the end.
[x] Add python wrappers for focal functions and test in notebook
[x] Reconcile BufferTile with Delegate tile
[ ] Add Neighborhood class and parser to pyrasterframes
[ ] Test that tile buffer information is being correctly used by focal functions
[ ] zFactor as Expression input (can be calculated by UDF)
[ ] zFactor as interpolation table
[ ] zFactor is automatic for LatLng rasters
Notes
Delegate Tiles
The main remaining challenge is to reconcile the design of BufferTile with RasterFrame reliance of the delegate tiles. This is critical because the current pattern in GeoTrellis is to rely on matching argument tile types in order to activate special handling. For instance when combining two buffer tiles operation needs to be applied to "hidden" buffer pixels. This is not possible when both or either of the inputs are wrapped in a delegate tile. Likely pixel buffer information needs to be integrated into Tile interface itself.
zFactor
For surface calculations critical input is zFactor which is contingent on the resolution and CRS. For a DataFrame of tiles the zFactor can change as the location of the tile shifts relative to the projection distortion. GeoTrellis has some functionality to support this. Some design should be lifted from GeoPySpark API. From user perspective there are three modes that can be helpful:
Handle calculations automatically for supported projections (LatLng) (given elevation units)
Use user provided interpolation table to use zFactor
Use expression and UDF to allow user full control over zFactor given raster metadata (will require adding rf_cellsize)
This is a draft effort to add focal operations which require use of pixel buffer per tile to provide the cell neighborhood information around tile edges. This PR moves https://github.com/locationtech/rasterframes/pull/487 closer to develop and adds Python wrappers for focal operations along with elevation related operations (slope, aspect, hillshade).
Currently this PR brings over
geotrellis.raster.BufferTile
implementation for convenience of iteration. I don't think its in its final form and having it here greatly simplifies the development process. This will be moved to GeoTrellis proper at the end.Notebook Demo
Tasks
Neighborhood
class and parser to pyrasterframesNotes
Delegate Tiles
The main remaining challenge is to reconcile the design of BufferTile with RasterFrame reliance of the delegate tiles. This is critical because the current pattern in GeoTrellis is to rely on matching argument tile types in order to activate special handling. For instance when combining two buffer tiles operation needs to be applied to "hidden" buffer pixels. This is not possible when both or either of the inputs are wrapped in a delegate tile. Likely pixel buffer information needs to be integrated into
Tile
interface itself.zFactor
For surface calculations critical input is zFactor which is contingent on the resolution and CRS. For a DataFrame of tiles the zFactor can change as the location of the tile shifts relative to the projection distortion. GeoTrellis has some functionality to support this. Some design should be lifted from GeoPySpark API. From user perspective there are three modes that can be helpful:
rf_cellsize
)Connects: #441