Skip to main content
When upgrading to a WherobotsDB runtime that includes the Sedona 2.0 API changes, update the calls below. This guide describes API changes; Apache Sedona and WherobotsDB have separate release numbers.

Use one-based indices

ST_GeometryN and ST_InteriorRingN now start at 1. Add 1 to the index used by an older runtime to keep selecting the same element.
An unchanged positive index selects the preceding element under the new convention. For example, n = 1 selects the first element instead of the second. Zero, negative, and out-of-range indices return NULL. For the integer grid-coordinate forms of RS_Value and RS_Values, add 1 to both the column and row. Apply the change to every element of coordinate arrays. The upper-left pixel is now (1, 1). Keeping both positive grid coordinates unchanged selects a pixel one column to the left and one row up in grid order.
Geometry-coordinate overloads, band indices, and other raster pixel functions retain their existing conventions.

Rename raster band-stacking calls

Replace RS_Union with RS_Stack, and replace RS_Union_Aggr with RS_Stack_Aggr. Update SQL calls, including SQL expressions passed from Python. The old names are removed. These functions stack bands from rasters with matching shapes. They do not mosaic spatially adjacent grids. Arguments and band ordering are unchanged.

Separate no-data metadata from pixel replacement

RS_SetBandNoDataValue now only sets or clears a band’s no-data metadata. It leaves pixel values unchanged. Its fourth replace argument is removed. RS_ReplaceBandNoDataValue rewrites existing no-data pixels and updates the band’s no-data metadata. The band must already declare a no-data value. To preserve the same no-data mask, choose a replacement value exactly representable in the band’s pixel type and absent from valid pixels. The two- and three-argument metadata setter forms continue to work; passing NULL as the setter’s value clears the metadata.

Review raster boundary assumptions

RS_AsRaster selects polygon pixels by their centers when allTouched = false; true also includes cells entered by the polygon’s boundary. A polygon never selects a pixel it touches only on the pixel’s boundary, whichever edge that is. Points select their containing half-open pixel. Lines select cells entered by their segments without requiring a pixel-center intersection. These geometry-specific rules also apply to RS_Clip, RS_SetValues, and zonal statistics. For LineString geometries, allTouched = true can expand the rasterization window at grid boundaries. This can change dimensions and selected pixels in RS_AsRaster with useGeometryExtent = true, and can also change selected pixels in RS_Clip and RS_SetValues. With useGeometryExtent = true, RS_AsRaster returns NULL when the geometry neither burns nor overlaps a raster pixel. RS_PixelAsPoint now extrapolates coordinates outside the grid instead of throwing an out-of-bounds exception.

Handle empty geometry results

ST_DistanceSphere and ST_DistanceSpheroid return NULL if either input is empty. ST_DWithin returns false for an empty input. Spherical nearest-neighbor searches skip empty geometries.