From ddbdac99864281ea00ef19020c9ffd8d510de8f4 Mon Sep 17 00:00:00 2001 From: Dhinakaran Suriyah Date: Tue, 10 Mar 2026 09:04:33 +0100 Subject: [PATCH 1/2] added geocode method for resample spatial --- resample_spatial.json | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/resample_spatial.json b/resample_spatial.json index 705cba22..ad6621bb 100644 --- a/resample_spatial.json +++ b/resample_spatial.json @@ -1,7 +1,7 @@ { "id": "resample_spatial", "summary": "Resample and warp the spatial dimensions", - "description": "Resamples the spatial dimensions (x,y) of the data cube to a specified resolution and/or warps the data cube to the target projection. At least `resolution` or `projection` must be specified.\n\nRelated processes:\n\n* Use ``filter_bbox()`` to set the target spatial extent.\n* To spatially align two data cubes with each other (e.g. for merging), better use the process ``resample_cube_spatial()``.", + "description": "Resamples the spatial dimensions (x,y) of the data cube to a specified resolution and/or warps the data cube to the target projection. At least `resolution` or `projection` must be specified.\n\nSome backends may additionally support `method=\"geocode\"` as a backend-specific extension. In this mode, the input data cube is rectified/geocoded using 2D geolocation layers such as `lon`/`lat` or `longitude`/`latitude`. These geolocation layers must be aligned with the spatial grid and may be provided as coordinates, data variables, or as dedicated bands in band-based data cubes. For `method=\"geocode\"`, a non-zero `resolution` is required. If `projection` is omitted, the backend defaults to EPSG:4326.\n\nRelated processes:\n\n* Use ``filter_bbox()`` to set the target spatial extent.\n* To spatially align two data cubes with each other (e.g. for merging), better use the process ``resample_cube_spatial()``.", "categories": [ "cubes", "reproject" @@ -26,7 +26,7 @@ }, { "name": "resolution", - "description": "Resamples the data cube to the target resolution, which can be specified either as separate values for x and y or as a single value for both axes. Specified in the units of the target projection. Doesn't change the resolution by default (`0`).", + "description": "Resamples the data cube to the target resolution, which can be specified either as separate values for x and y or as a single value for both axes. Specified in the units of the target projection. Doesn't change the resolution by default (`0`).\n\nFor `method=\"geocode\"`, the current backend implementation requires a single non-zero numeric resolution.", "schema": [ { "description": "A single number used as the resolution for both x and y.", @@ -49,7 +49,7 @@ }, { "name": "projection", - "description": "Warps the data cube to the target projection, specified as [EPSG code](https://spatialreference.org/ref/epsg/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). By default (`null`), the projection is not changed.", + "description": "Warps the data cube to the target projection, specified as [EPSG code](https://spatialreference.org/ref/epsg/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). By default (`null`), the projection is not changed.\n\nFor `method=\"geocode\"`, if no projection is specified, the current backend implementation defaults to EPSG:4326.", "schema": [ { "title": "EPSG Code", @@ -75,7 +75,7 @@ }, { "name": "method", - "description": "Resampling method to use. The following options are available and are meant to align with [`gdalwarp`](https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-r):\n\n* `average`: average (mean) resampling, computes the weighted average of all valid pixels\n* `bilinear`: bilinear resampling\n* `cubic`: cubic resampling\n* `cubicspline`: cubic spline resampling\n* `lanczos`: Lanczos windowed sinc resampling\n* `max`: maximum resampling, selects the maximum value from all valid pixels\n* `med`: median resampling, selects the median value of all valid pixels\n* `min`: minimum resampling, selects the minimum value from all valid pixels\n* `mode`: mode resampling, selects the value which appears most often of all the sampled points\n* `near`: nearest neighbour resampling (default)\n* `q1`: first quartile resampling, selects the first quartile value of all valid pixels\n* `q3`: third quartile resampling, selects the third quartile value of all valid pixels\n* `rms` root mean square (quadratic mean) of all valid pixels\n* `sum`: compute the weighted sum of all valid pixels\n\nValid pixels are determined based on the function ``is_valid()``.", + "description": "Resampling method to use. The following options are available and are meant to align with [`gdalwarp`](https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-r), except for `geocode`, which is a backend-specific geocoding/rectification mode:\n\n* `average`: average (mean) resampling, computes the weighted average of all valid pixels\n* `bilinear`: bilinear resampling\n* `cubic`: cubic resampling\n* `cubicspline`: cubic spline resampling\n* `geocode`: geocodes / rectifies data with 2D geolocation layers (`lon`/`lat` or `longitude`/`latitude`) onto a regular target grid. Supported geolocation layers may be provided as coordinates, data variables, or as dedicated bands in band-based data cubes. This mode is intended for curvilinear or swath-like inputs where per-pixel geolocation is available. The current backend implementation requires a non-zero scalar `resolution`. If `projection` is omitted, EPSG:4326 is used.\n* `lanczos`: Lanczos windowed sinc resampling\n* `max`: maximum resampling, selects the maximum value from all valid pixels\n* `med`: median resampling, selects the median value of all valid pixels\n* `min`: minimum resampling, selects the minimum value from all valid pixels\n* `mode`: mode resampling, selects the value which appears most often of all the sampled points\n* `near`: nearest neighbour resampling (default)\n* `q1`: first quartile resampling, selects the first quartile value of all valid pixels\n* `q3`: third quartile resampling, selects the third quartile value of all valid pixels\n* `rms`: root mean square (quadratic mean) of all valid pixels\n* `sum`: compute the weighted sum of all valid pixels\n\nValid pixels are determined based on the function ``is_valid()``.", "schema": { "type": "string", "enum": [ @@ -83,6 +83,7 @@ "bilinear", "cubic", "cubicspline", + "geocode", "lanczos", "max", "med", @@ -100,7 +101,7 @@ }, { "name": "align", - "description": "Specifies to which corner of the spatial extent the new resampled data is aligned to.", + "description": "Specifies to which corner of the spatial extent the new resampled data is aligned to.\n\nNote: the current backend implementation does not apply `align` for `method=\"geocode\"`.", "schema": { "type": "string", "enum": [ @@ -157,4 +158,4 @@ "title": "gdalwarp resampling methods" } ] -} +} \ No newline at end of file From 34e49f80236e13dc709f4436a2b6a8fec97f2065 Mon Sep 17 00:00:00 2001 From: Dhinakaran Suriyah Date: Tue, 10 Mar 2026 16:09:49 +0100 Subject: [PATCH 2/2] accomodated the review from matthias on centralising description for method=geocode --- resample_spatial.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resample_spatial.json b/resample_spatial.json index ad6621bb..d973dfca 100644 --- a/resample_spatial.json +++ b/resample_spatial.json @@ -1,7 +1,7 @@ { "id": "resample_spatial", "summary": "Resample and warp the spatial dimensions", - "description": "Resamples the spatial dimensions (x,y) of the data cube to a specified resolution and/or warps the data cube to the target projection. At least `resolution` or `projection` must be specified.\n\nSome backends may additionally support `method=\"geocode\"` as a backend-specific extension. In this mode, the input data cube is rectified/geocoded using 2D geolocation layers such as `lon`/`lat` or `longitude`/`latitude`. These geolocation layers must be aligned with the spatial grid and may be provided as coordinates, data variables, or as dedicated bands in band-based data cubes. For `method=\"geocode\"`, a non-zero `resolution` is required. If `projection` is omitted, the backend defaults to EPSG:4326.\n\nRelated processes:\n\n* Use ``filter_bbox()`` to set the target spatial extent.\n* To spatially align two data cubes with each other (e.g. for merging), better use the process ``resample_cube_spatial()``.", + "description": "Resamples the spatial dimensions (x,y) of the data cube to a specified resolution and/or warps the data cube to the target projection. At least `resolution` or `projection` must be specified.\n\nRelated processes:\n\n* Use ``filter_bbox()`` to set the target spatial extent.\n* To spatially align two data cubes with each other (e.g. for merging), better use the process ``resample_cube_spatial()``.", "categories": [ "cubes", "reproject" @@ -26,7 +26,7 @@ }, { "name": "resolution", - "description": "Resamples the data cube to the target resolution, which can be specified either as separate values for x and y or as a single value for both axes. Specified in the units of the target projection. Doesn't change the resolution by default (`0`).\n\nFor `method=\"geocode\"`, the current backend implementation requires a single non-zero numeric resolution.", + "description": "Resamples the data cube to the target resolution, which can be specified either as separate values for x and y or as a single value for both axes. Specified in the units of the target projection. Doesn't change the resolution by default (`0`).", "schema": [ { "description": "A single number used as the resolution for both x and y.", @@ -49,7 +49,7 @@ }, { "name": "projection", - "description": "Warps the data cube to the target projection, specified as [EPSG code](https://spatialreference.org/ref/epsg/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). By default (`null`), the projection is not changed.\n\nFor `method=\"geocode\"`, if no projection is specified, the current backend implementation defaults to EPSG:4326.", + "description": "Warps the data cube to the target projection, specified as [EPSG code](https://spatialreference.org/ref/epsg/) or [WKT2 CRS string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html). By default (`null`), the projection is not changed.", "schema": [ { "title": "EPSG Code", @@ -75,7 +75,7 @@ }, { "name": "method", - "description": "Resampling method to use. The following options are available and are meant to align with [`gdalwarp`](https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-r), except for `geocode`, which is a backend-specific geocoding/rectification mode:\n\n* `average`: average (mean) resampling, computes the weighted average of all valid pixels\n* `bilinear`: bilinear resampling\n* `cubic`: cubic resampling\n* `cubicspline`: cubic spline resampling\n* `geocode`: geocodes / rectifies data with 2D geolocation layers (`lon`/`lat` or `longitude`/`latitude`) onto a regular target grid. Supported geolocation layers may be provided as coordinates, data variables, or as dedicated bands in band-based data cubes. This mode is intended for curvilinear or swath-like inputs where per-pixel geolocation is available. The current backend implementation requires a non-zero scalar `resolution`. If `projection` is omitted, EPSG:4326 is used.\n* `lanczos`: Lanczos windowed sinc resampling\n* `max`: maximum resampling, selects the maximum value from all valid pixels\n* `med`: median resampling, selects the median value of all valid pixels\n* `min`: minimum resampling, selects the minimum value from all valid pixels\n* `mode`: mode resampling, selects the value which appears most often of all the sampled points\n* `near`: nearest neighbour resampling (default)\n* `q1`: first quartile resampling, selects the first quartile value of all valid pixels\n* `q3`: third quartile resampling, selects the third quartile value of all valid pixels\n* `rms`: root mean square (quadratic mean) of all valid pixels\n* `sum`: compute the weighted sum of all valid pixels\n\nValid pixels are determined based on the function ``is_valid()``.", + "description": "Resampling method to use. The following options are available and are meant to align with [`gdalwarp`](https://gdal.org/programs/gdalwarp.html#cmdoption-gdalwarp-r), except for `geocode`, which is a backend-specific geocoding/rectification mode:\n\n* `average`: average (mean) resampling, computes the weighted average of all valid pixels\n* `bilinear`: bilinear resampling\n* `cubic`: cubic resampling\n* `cubicspline`: cubic spline resampling\n* `geocode`: geocodes / rectifies data with 2D geolocation layers onto a regular target grid. This mode is intended for curvilinear or swath-like inputs where per-pixel geolocation is available. The current backend implementation requires a non-zero scalar `resolution`. If `projection` is omitted, the backend defaults to EPSG:4326. The `align` parameter is currently ignored for this method.\n* `lanczos`: Lanczos windowed sinc resampling\n* `max`: maximum resampling, selects the maximum value from all valid pixels\n* `med`: median resampling, selects the median value of all valid pixels\n* `min`: minimum resampling, selects the minimum value from all valid pixels\n* `mode`: mode resampling, selects the value which appears most often of all the sampled points\n* `near`: nearest neighbour resampling (default)\n* `q1`: first quartile resampling, selects the first quartile value of all valid pixels\n* `q3`: third quartile resampling, selects the third quartile value of all valid pixels\n* `rms`: root mean square (quadratic mean) of all valid pixels\n* `sum`: compute the weighted sum of all valid pixels\n\nValid pixels are determined based on the function ``is_valid()``.", "schema": { "type": "string", "enum": [ @@ -101,7 +101,7 @@ }, { "name": "align", - "description": "Specifies to which corner of the spatial extent the new resampled data is aligned to.\n\nNote: the current backend implementation does not apply `align` for `method=\"geocode\"`.", + "description": "Specifies to which corner of the spatial extent the new resampled data is aligned to.", "schema": { "type": "string", "enum": [