add support for predefinedtilegrid in split_area #883#886
Conversation
HansVRP
left a comment
There was a problem hiding this comment.
Some initial comments and questions
… 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 ? |
…er than 500x500 tiles #883
|
|
||
| # TODO: provide west, south, east, north, crs as @properties? Read-only or read-write? | ||
|
|
||
| def as_polygon(self) -> shapely.geometry.Polygon: |
There was a problem hiding this comment.
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 < eastso 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
eastso you preserve thewest < eastassumption
There was a problem hiding this comment.
FYI: also look at comparable utility in openeo_driver:
https://github.com/Open-EO/openeo-python-driver/blob/b7d0f7bea15a2c4bec03ee71f11c416854bc775e/openeo_driver/util/geometry.py#L590-L617
There was a problem hiding this comment.
Comitted something that uses the exact same antimeridian crossing logic as the python driver and a split between as_polygon and as_geometry
…ve these two unit tests #883
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