Skip to content

add support for predefinedtilegrid in split_area #883#886

Merged
HansVRP merged 19 commits intomasterfrom
883-predefined-tilegrid-splitter
Apr 21, 2026
Merged

add support for predefinedtilegrid in split_area #883#886
HansVRP merged 19 commits intomasterfrom
883-predefined-tilegrid-splitter

Conversation

@VincentVerelst
Copy link
Copy Markdown
Collaborator

@VincentVerelst VincentVerelst commented Apr 2, 2026

The idea is to expose the split_area function to users. Users can provide an AOI, which can be split in different ways:

  • By providing a projection and tile_size: splits the AOI up in square tiles
  • By providing a PredefinedTileGrid (can also be a geopandas.GeoDataFrame), which splits the AOI according to that grid
  • By providing a custom subclass of TileGridInterface: splits the AOI according to their custom class

The function returns the split AOI as a geopandas.GeoDataFrame

@VincentVerelst VincentVerelst requested a review from HansVRP April 2, 2026 15:11
Copy link
Copy Markdown
Contributor

@HansVRP HansVRP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial comments and questions

Comment thread openeo/extra/job_management/_job_splitting.py Outdated
Comment thread openeo/extra/job_management/_job_splitting.py Outdated
Comment thread setup.py
Comment thread openeo/extra/job_management/_job_splitting.py
Comment thread openeo/extra/job_management/_job_splitting.py
Comment thread openeo/extra/job_management/_job_splitting.py Outdated
Comment thread openeo/extra/job_management/_job_splitting.py Outdated
Comment thread tests/extra/job_management/test_job_splitting.py
Comment thread openeo/extra/job_management/_job_splitting.py Outdated
Comment thread tests/extra/job_management/test_job_splitting.py
@VincentVerelst VincentVerelst requested a review from HansVRP April 8, 2026 14:27
@VincentVerelst
Copy link
Copy Markdown
Collaborator Author

@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 split_area function now takes as input an AOI, which can be split in either of two ways:

  • By providing a tile-grid as geopandas.GeoDataFrame or a list of (Multi)Polygon. In the background _PredefinedTileGrid will be used for splitting
  • By providing a projection and tile_size. In the background _SizeBasedTileGrid will be used for splitting. The origin will be taken to be the bottom-left of the AOI provided by the user.

Advanced users can always define their own splitting method by defining a subclass of _TileGridInterface, which is still experimental and prone to change

@HansVRP
Copy link
Copy Markdown
Contributor

HansVRP commented Apr 9, 2026

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 ?

Comment thread openeo/util.py Outdated

# TODO: provide west, south, east, north, crs as @properties? Read-only or read-write?

def as_polygon(self) -> shapely.geometry.Polygon:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soxofaan okay to add this here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, fine to add that here.

However, note that it's tricky to get this correct+intuitive for antimeridian use cases.
e.g. in antimeridian use cases, you have west > east (so min and max longitude are switched). Your polygon will then probably the opposite of what you want.

There are several possible solutions/guardrails here:

  • explicit assert west < east so that you get hard fail on anti-meridian cases, instead of blindly producing wrong results
  • produce a multi-polygon with two parts, one for each side of the antimeridian
  • add 360 to east so you preserve the west < east assumption

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comitted something that uses the exact same antimeridian crossing logic as the python driver and a split between as_polygon and as_geometry

@HansVRP HansVRP merged commit 43ea500 into master Apr 21, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants