Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Add operation data_frame_subset() #708

Closed
forman opened this issue Jul 12, 2018 · 0 comments
Closed

Add operation data_frame_subset() #708

forman opened this issue Jul 12, 2018 · 0 comments

Comments

@forman
Copy link
Member

forman commented Jul 12, 2018

Expected behavior

Users of Glaciers CCI data require an operation that would let them select spatial subsets or column subsets from potentially large shapefiles.

Proposed signature is:

data_frame_subset(df: pd.DataFrame, 
                     vars: VarsNamesLike = None,
                     region: GeometryLike = None,
                     monitor: Monitor = Monitor.NONE) -> pd.DataFrame

The region parameter is enabled only if df is an instance of gpd.GeoDataFrame.

Note, the operation may also partly be implemented by letting the existing operation subset_spatial accept "datasets" of type gpd.GeoDataFrame.

Actual behavior

Such operation does not exist yet.

EDIT:

This is not entirely true. We have the operation data_frame_query() which takes a filter expression that supports a set of geometric operators:

  • @almost_equals(geom) - does a feature's geometry almost equal the given geom;
  • @contains(geom) - does a feature's geometry contain the given geom;
  • @crosses(geom) - does a feature's geometry cross the given geom;
  • @disjoint(geom) - does a feature's geometry not at all intersect the given geom;
  • @intersects(geom) - does a feature's geometry intersect with given geom;
  • @touches(geom) - does a feature's geometry have a point in common with given geom but does not intersect it;
  • @within(geom) - is a feature's geometry contained within given geom.

Specifications

Cate 1.0 ... 2.0.dev15

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant