Skip to content

Focal Operations and Buffer Tile support#551

Closed
echeipesh wants to merge 11 commits intolocationtech:developfrom
echeipesh:feature/buffer-tiles
Closed

Focal Operations and Buffer Tile support#551
echeipesh wants to merge 11 commits intolocationtech:developfrom
echeipesh:feature/buffer-tiles

Conversation

@echeipesh
Copy link
Contributor

@echeipesh echeipesh commented Mar 30, 2021

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

Screen Shot 2021-03-30 at 12 16 00 PM

Notebook Demo

Tasks

  • Rebase BufferedTile support. #487
  • Read BufferTile when requested
  • Add Slope, Aspect, Hillshade functions
  • Add python wrappers for focal functions and test in notebook
  • 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)

Connects: #441

@metasim
Copy link
Member

metasim commented Mar 31, 2021

Awesome progress!

@metasim metasim mentioned this pull request Mar 31, 2021
We need to be able to unwrap RasterRefTile and call realizedTile before wrapping it in ProjectedRasterTile. This allows current version of BufferTile to do its work.

ProjectedRasterTile can be a base trait for any kind of eventual tile representation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants