add support for predefinedtilegrid in split_area #883#886
add support for predefinedtilegrid in split_area #883#886VincentVerelst wants to merge 15 commits intomasterfrom
Conversation
HansVRP
left a comment
There was a problem hiding this comment.
Some initial comments and questions
| "deprecated>=1.2.12", | ||
| 'oschmod>=0.3.12; sys_platform == "win32"', | ||
| "importlib_resources; python_version<'3.9'", | ||
| # TODO #717 Simplify geopandas constraints when Python 3.8 support is dropped |
There was a problem hiding this comment.
Do we need to rely on python 3.8 compatibility?
There was a problem hiding this comment.
It's needed for as long as the backend supports it
There was a problem hiding this comment.
I am probably overlooking something; but this runs only client side?
or is the limitation due to the geometry we send into the back-end
| @@ -1,168 +1,265 @@ | |||
| import geopandas as gpd | |||
There was a problem hiding this comment.
do we have test coverage on the behavior if the AOI is a line or a single point?
There was a problem hiding this comment.
Yes the TileGrid tests covered this case. Also added a test for split_area. Current behaviour: only dict, Polygon or MultiPolygon is allowed
There was a problem hiding this comment.
if the dict contains for instance a line or point
the error will come when openEO tries to run it I assume?
There was a problem hiding this comment.
No the job splitter will fail, because the bbox is validated to must have east>west and north>south
There was a problem hiding this comment.
There still might be some niche cases we will encounter:
- e.g. inputs in a geographic CRS with coordinates that extend past ±180° longitude, this breaks the assumption that west < east
- Predefined tiles in a geographic CRS that wrap past the antimeridian
Couple of things we could do as follow up:
if west>east --> spliting two polygons and further split those seperatly. This seems low effort to me.
input polygons with lon past +-180 will be harder; I believe @soxofaan was also looking into this for the python client.
There was a problem hiding this comment.
(made a small commit which I believe handles this: 1e0c178)
… crs. SizebasedTileGrid doesn't follow a pre-defined grid centered at 0,0 but rather uses the AOI bottom left as anchor point #883
|
@HansVRP , except for addressing your comments, one big change: there is now a standardized reprojecting happening to the CRS of the tile grid that is being used for splitting. To re-iterate what will be exposes to the public API: the
Advanced users can always define their own splitting method by defining a subclass of |
|
will look into the update; thanks. can you also include a usecase example in: https://github.com/Open-EO/openeo-python-client/blob/master/docs/cookbook/job_manager.rst ? |
The idea is to expose the
split_areafunction to users. Users can provide an AOI, which can be split in different ways:projectionandtile_size: splits the AOI up in square tilesPredefinedTileGrid(can also be ageopandas.GeoDataFrame), which splits the AOI according to that gridTileGridInterface: splits the AOI according to their custom classThe function returns the split AOI as a
geopandas.GeoDataFrame