Skip to content
Merged
Show file tree
Hide file tree
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
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,40 @@ dmypy.json
.ionide

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode

# Created by https://www.toptal.com/developers/gitignore/api/macos
# Edit at https://www.toptal.com/developers/gitignore?templates=macos

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

# End of https://www.toptal.com/developers/gitignore/api/macos
24 changes: 18 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,26 @@ The format is based on [Keep a Changelog], and this project adheres to

## [Unreleased]

### Fixed

- Columns in the output file are now guaranteed to be in the same order as given
by the `columns` input value.
([#100](https://github.com/MAAP-Project/gedi-subsetter/issues/100))

### Changed

- Valid values for the `output` option have changed such that a file extension
is required, whereas previously this was optional since `.gpkg` was the only
supported output format. However, in addition to `.gpkg`, it is now possible
to specify the extensions `.parquet` for (Geo)Parquet format, and `.fgb` for
FlatGeobuf format.
(([#97](https://github.com/MAAP-Project/gedi-subsetter/issues/97))
- Valid values for the `output` option have changed such that **a file extension
is required**, whereas previously this was optional since `.gpkg` was the only
supported output format.
([#97](https://github.com/MAAP-Project/gedi-subsetter/issues/97))

### Added

- It is now possible to specify alternative file formats for the `output` value:
in addition to the file extension `.gpkg` for GeoPackage format, it is now
possible to specify the extensions `.parquet` for (Geo)Parquet format, or
`.fgb` for FlatGeobuf format.
([#97](https://github.com/MAAP-Project/gedi-subsetter/issues/97))

## [0.9.0] (2024-10-09)

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ module = [
ignore_missing_imports = true

[tool.pytest.ini_options]
addopts = ["--doctest-modules"]
filterwarnings = ["ignore::DeprecationWarning", "ignore::UserWarning"]
# Uncomment next line to enable live logging during tests
# log_cli = true
6 changes: 3 additions & 3 deletions src/gedi_subset/gedi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ def subset_hdf5(
... # `filename` column (which refers to the memory location of the
... # ``io.BytesIO``, not a filename).
... gdf.drop(columns=["filename"])
BEAM agbd sensitivity geometry
0 0000 1.116093 0.99 POINT (12.06707 -1.82471)
agbd sensitivity geometry
0 1.116093 0.99 POINT (12.06707 -1.82471)

Note that the resulting ``geopandas.GeoDataFrame`` contains only the specified
coverage `BEAM`s, specified columns (`agbd` and `sensitivity`), and only the
Expand All @@ -414,7 +414,7 @@ def subset_beam(beam: h5py.Group) -> gpd.GeoDataFrame:
# Grab the coordinates for the geometry, before dropping columns
geometry = gpd.points_from_xy(df[lon_col], df[lat_col])
# Select only the user-specified columns
gdf = gpd.GeoDataFrame(df[[*set(columns)]], geometry=geometry, crs=aoi.crs)
gdf = gpd.GeoDataFrame(df[columns], geometry=geometry, crs=aoi.crs)

return cast(gpd.GeoDataFrame, gdf.clip(aoi))

Expand Down
Loading