added geocode method for resample spatial in the processes json#565
added geocode method for resample spatial in the processes json#565suriyahgit wants to merge 2 commits intoOpen-EO:masterfrom
Conversation
clausmichele
left a comment
There was a problem hiding this comment.
@suriyahgit I proposed some changes. Let's see what @jdries and @m-mohr think about this PR.
resample_spatial.json
Outdated
| "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()``.", |
There was a problem hiding this comment.
| "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\nSome back-ends may additionally support `method=\"geocode\"` as a back-end-specific extension. In this mode, the input data cube is rectified/geocoded using 2D geolocation layers, which must be provided as two bands with names `longitude` and `latitude`. These bands are dropped in the resulting cube. 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()``.", |
@suriyahgit in openEO there's no concept of coordinates or data variables, we have dimensions (spatial, temporal, bands, other). I'm not sure which name we should adopt for the special band names, since the user can set the desired output projection probably longitude and latitude are not fitting all the scenarios and we should use something more generic if possible.
There was a problem hiding this comment.
@clausmichele I used the terms coordinates and data variables because I was initially thinking of the dataset in terms of its representation as an xarray object, and also based on how datasets appear when loaded through a local connection in the openEO ecosystem. That said, I agree these terms are not strictly necessary here and can be removed.
resample_spatial.json
Outdated
| { | ||
| "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.", |
There was a problem hiding this comment.
| "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`).\n\nThe `method=\"geocode\"` requires a single non-zero numeric resolution.", |
resample_spatial.json
Outdated
| { | ||
| "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.", |
There was a problem hiding this comment.
| "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.\n\nFor `method=\"geocode\"`, if no projection is specified, the default is EPSG:4326.", |
resample_spatial.json
Outdated
| { | ||
| "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\"`.", |
There was a problem hiding this comment.
| "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.\n\nIt does not apply for `method=\"geocode\"`.", |
m-mohr
left a comment
There was a problem hiding this comment.
As the methods enum is configurable and backends just choose this, it should be simple for implementors to remove it at a central place. Thus scattering descriptions for the methods in other parameters makes this hard to maintain. All changes needed for adding geocode should only be made in the method parameter schema/description ideally.
resample_spatial.json
Outdated
| "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()``.", |
There was a problem hiding this comment.
All methods are optional, as such this special handling in the process description doesn't really make sense. The specifics of the method should be described in description of the method parameter.
I think no change should be made to the process description.
resample_spatial.json
Outdated
| { | ||
| "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.", |
There was a problem hiding this comment.
This restriction should only be mentioned centrally in the method parameter.
resample_spatial.json
Outdated
| { | ||
| "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.", |
There was a problem hiding this comment.
This restriction should only be mentioned centrally in the method parameter.
resample_spatial.json
Outdated
| { | ||
| "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\"`.", |
There was a problem hiding this comment.
This restriction should only be mentioned centrally in the method parameter.
|
reviews from @m-mohr accomodated - centralised the descriptions related to method="geocode" to the method description. |
Refer:
Open-EO/openeo-processes-dask#361
#552