jiayuasu opened a new issue, #3214: URL: https://github.com/apache/sedona/issues/3214
## Is your feature request related to a problem? `RS_MapAlgebra` runs a [Jiffle](https://github.com/geosolutions-it/jai-ext/wiki/Jiffle) script per pixel. It has served as Sedona's general raster processing primitive, but it carries costs that a Python UDF does not: - Jiffle is a language users have to learn, documented outside Sedona, and used nowhere else in the project. - It pulls in `jt-jiffle-language` plus an antlr and janino shading block in `common/pom.xml` that exists solely to stop janino colliding with Spark's copy in the REPL (#1945). - It is limited to per-pixel arithmetic — anything reading a neighbourhood, classifying, or calling a library cannot be expressed in it. Python UDFs over rasters now cover the same ground and more. Raster input has been supported since 1.6.0, and returning a raster landed in #2956 for 1.9.1, so a UDF can do everything `RS_MapAlgebra` does while also reaching NumPy, SciPy, scikit-learn, and rasterio. ## Describe the solution you'd like Deprecate `RS_MapAlgebra` in favour of Python UDFs, following the precedent set by `ST_Envelope_Aggr` in 1.8.1: a documented deprecation notice, with the function left registered and working. Nothing is removed and no behaviour changes. Scope: 1. Deprecation notices on `Raster-map-algebra.md` (and its `zh` translation), `Raster-Map-Algebra-Operators/RS_MapAlgebra.md`, and the `Raster-Functions.md` index row, naming `v1.9.1` and pointing at the replacement. 2. `@Deprecated` on the `MapAlgebra.mapAlgebra` overloads in `sedona-common`. Two prerequisites, both in flight: - The replacement needs to be documented well enough to migrate to. #3212 adds a Raster UDF page covering both read paths, with NDVI written as Jiffle and as NumPy side by side. - A UDF currently cannot set the NODATA of the raster it returns, which `RS_MapAlgebra` takes as an argument. That is #3213, and it needs to be fixed before UDFs are a complete replacement. Removing the function, and with it the Jiffle dependency and its shading workaround, would be a separate decision for a later major version. ## Describe alternatives you've considered Keeping `RS_MapAlgebra` as a peer option rather than deprecating it. The array-based functions (`RS_Add`, `RS_Multiply`, `RS_NormalizedDifference`, …) already cover simple band arithmetic from SQL, which leaves Jiffle serving only the middle ground between those and a UDF — not enough to justify the dependency and the second scripting language. -- 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]
