locationtech / rasterframes

Geospatial Raster support for Spark DataFrames
http://rasterframes.io
Apache License 2.0
243 stars 46 forks source link

Expand function signatures for rf_rasterize #411

Open vpipkt opened 4 years ago

vpipkt commented 4 years ago

Two points of friction:

1) almost always and everywhere we are doing "rasterize geometry like this projected raster tile" and then having to pass in the various metadata bits of the PRT explicitly 2) often enough we are rasterizing with a default-y value of 1 or as frequently expressed F.lit(1)

Add the following signatures:

rf_rasterize(geom: Column, projected_rastr_tile: Column)
rf_rasterize(geom: Column, projected_rastr_tile: Column, cell_val: Column)
rf_rasterize(geom: Column, projected_rastr_tile: Column, cell_val: Int)
rf_rasterize(geom: Column, extent: Column, crs: Column, dimensions: Column) # nb not geom but extent, also note dims is a struct as returned by rf_dimension
rf_rasterize(geom: Column, extent: Column, crs: Column, dimensions: Column, cell_val: Column) 
rf_rasterize(geom: Column, extent: Column, crs: Column, dimensions: Column, cell_val: Int)  

We might even consider a flag for optionally reprojecting the geom from EPSG:4326. That is a common enough use case but expensive enough that it ought not be the default.