Skip to content

point splitter - #954

Open
HansVRP wants to merge 4 commits into
masterfrom
hv_split_points_jobmanager
Open

HansVRP wants to merge 4 commits into
masterfrom
hv_split_points_jobmanager

Conversation

@HansVRP

@HansVRP HansVRP commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

While working on the ML blueprint I figured it should not be hard to extend the spitting function towards point geometries as well.

@VincentVerelst you are quite familiar with this; can you please chekc and validate as well?

For me the results look good and respect tilegrids as well:

image

@HansVRP

HansVRP commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@VincentVerelst can you take a look?

Comment thread openeo/extra/job_management/_job_splitting.py
Comment thread openeo/extra/job_management/_job_splitting.py
@HansVRP HansVRP self-assigned this Oct 21, 2026
@HansVRP

HansVRP commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

@soxofaan could you have a look as well (I do still need to fix the unit tests)

@soxofaan soxofaan left a comment

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.

can't go deep here, just some quick observations

centroids: gpd.GeoSeries,
idx,
max_points: Optional[int],
out: List,

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.

having the output as argument instead of return value looks like an ugly matlab-ism to me 😜

I guess it's to do the recursiveness , but I think that can also be done with a regular returns here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes indeed, it was done for recursive usage, can clean it up

if "geometry" not in points.columns:
raise JobSplittingFailure("The GeoDataFrame must contain a 'geometry' column.")
if not points.geom_type.isin(["Point", "MultiPoint"]).all():
raise JobSplittingFailure("All geometries must be of type Point or MultiPoint.")

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.

I'm not sure it is necessary to enforce this constraint that all geometries must be points.
Lower you are using something like .centroid to get a point regardless of the original geometry type, so the logic would handle other types of geometry just fine, right?

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.

I mean, recursive quadrant based batching also seems interesting to have on a collection of polygons

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

would indeed be pssible; but then we should change the naming as well. I was working on a points splitter, but it should rather become a geometry splitter then?

@soxofaan soxofaan Oct 23, 2026 •

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.

point or geometry splitting sound like you are splitting the geometries themselves

maybe something along the lines of quandrant_grouping or quandrant_batching is more self-explanatory

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Input features can be duplicated or lost, and custom tile grids do not satisfy the advertised interface contract.

3 open issues
What changed in this PR

Adds point-based job splitting to the existing job-management utilities, supporting sample extraction workflows alongside area-based splitting.

Changes:

  • Introduces split_points with optional feature limits, spatial subdivision, and tile-grid grouping.
  • Exports the helper publicly and documents its usage.
  • Adds tests for supported inputs, grouping, reprojection, and validation.
File Description
tests/​extra/​job_management/​test_job_splitting.py Tests point splitting and tile-grid behavior.
openeo/​extra/​job_management/​_job_splitting.py Implements point grouping and recursive subdivision.
openeo/​extra/​job_management/​__init__.py Exports split_points publicly.
docs/​cookbook/​job_manager.rst Adds point-extraction batching examples.
CHANGELOG.md Announces the new helper.

Review effort: Balanced

Comment on lines +491 to +492
if not points.geom_type.isin(["Point", "MultiPoint"]).all():
raise JobSplittingFailure("All geometries must be of type Point or MultiPoint.")
if points.empty:
return []

centroids = points.geometry.centroid
Comment on lines +543 to +544
else:
raise JobSplittingFailure(f"Unsupported tile grid type: {type(tile_grid).__name__}.")
@soxofaan

Copy link
Copy Markdown
Member

FYI: any unit test failures you see about jsonschema are fixed with #960, so make sure to merge master to get rid of that problem

This branch has not been deployed

No deployments
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.

5 participants