Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ GeoPandasRectangleClipper for spatially subsetting vectors #52

Merged
merged 3 commits into from
Sep 5, 2022

Commits on Sep 5, 2022

  1. ✨ GeoPandasRectangleClipper for spatially subsetting vectors

    An iterable-style DataPipe for clipping vector geometries with a raster grid! Uses the rectangular clip algorithm in geopandas.clip for the spatial subsetting. Included a doctest that ensures a geopandas.GeoDataFrame can be clipped by two xarray.DataArray grids. Added a new section in the API docs too.
    weiji14 committed Sep 5, 2022
    Configuration menu
    Copy the full SHA
    3ba5b50 View commit details
    Browse the repository at this point in the history
  2. ✅ Unit tests to clip geoseries and check incorrect len

    Ensure that a geopandas.Geoseries vector can be clipped using xarray.Dataset rasters, and that vector datapipes which are too long (len > 1) raise a NotImplementedError properly.
    weiji14 committed Sep 5, 2022
    Configuration menu
    Copy the full SHA
    f65c573 View commit details
    Browse the repository at this point in the history
  3. 💫 Reproject vector to match raster's coordinate reference system

    To handle raster images with different coordinate reference systems, do on-the-fly reprojection of the vector geopandas.GeoDataFrame to match the raster xarray.DataArray's coordinate reference system. Have added a unit test with EPSG:3857 and EPSG:32613 chips, and noted this automatic reprojection feature in the docstring. Need to refactor this basic implementation to be more efficient as the whole geodataframe is being reprojected rather than a subset only.
    weiji14 committed Sep 5, 2022
    Configuration menu
    Copy the full SHA
    5f9cdf2 View commit details
    Browse the repository at this point in the history