Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/cookbook/job_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,42 @@ This will create a GeoDataFrame with one row per tile, and a geometry column con

Note that while the original bounding box was in EPSG:4326, the resulting GeoDataFrame is in the tiling projection (EPSG:3857 in this case).

.. note::

The size-based splitting anchors tiles at the southwest corner of the
bounding box and does **not** snap tile boundaries to multiples of a
pixel size. This means the resulting tile coordinates may not be
pixel-aligned, which can lead to sub-pixel shifts when mosaicking
results afterwards.

If pixel-aligned tile boundaries are important for your workflow (e.g.
for seamless merging of output rasters), consider providing a
pre-computed tile grid via the ``tile_grid`` parameter instead. See the
:ref:`custom tile grid example <job-splitting-custom-grid>` below.

.. _job-splitting-custom-grid:

Using a custom tile grid
------------------------

For workflows that require pixel-aligned tiles, a specific tiling scheme,
or any other custom partitioning, you can pass a pre-computed
:class:`~geopandas.GeoDataFrame` as the ``tile_grid`` argument.
``split_area`` will then only return tiles that intersect the area of interest.

.. code-block:: python

import geopandas as gpd
from openeo.extra.job_management import split_area

bbox = {"west": 5.0, "south": 51.0, "east": 5.2, "north": 51.2, "crs": "EPSG:4326"}

# Load a pre-computed tile grid (e.g. a pixel-aligned UTM grid stored as GeoParquet)
tile_grid = gpd.read_parquet("my_tile_grid.parquet")

# Only tiles intersecting the AOI are returned
gdf = split_area(aoi=bbox, tile_grid=tile_grid)
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.

UI design consideration:
you are using/mixing aoi and bbox here, while in most comparable parts of the openEO API we use spatial_extent (or just extent when it's already obvious from the context that it is a spatial extent).
It might be beneficial to consider improving consistency


Customizing Job Handling
========================

Expand Down