-
Notifications
You must be signed in to change notification settings - Fork 405
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
GeoDatasets should use separate values for x and y resolution #2601
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 24 out of 38 changed files in this pull request and generated no comments.
Files not reviewed (14)
- torchgeo/datasets/eudem.py: Evaluated as low risk
- torchgeo/datasets/cms_mangrove_canopy.py: Evaluated as low risk
- torchgeo/datasets/astergdem.py: Evaluated as low risk
- torchgeo/datasets/enmap.py: Evaluated as low risk
- torchgeo/datasets/cdl.py: Evaluated as low risk
- torchgeo/datasets/agb_live_woody_density.py: Evaluated as low risk
- torchgeo/datasets/esri2020.py: Evaluated as low risk
- tests/datamodules/test_geo.py: Evaluated as low risk
- torchgeo/datasets/eurocrops.py: Evaluated as low risk
- tests/datasets/test_cbf.py: Evaluated as low risk
- tests/samplers/test_batch.py: Evaluated as low risk
- tests/samplers/test_single.py: Evaluated as low risk
- torchgeo/datasets/chesapeake.py: Evaluated as low risk
- tests/datasets/test_geo.py: Evaluated as low risk
@@ -416,7 +416,7 @@ def __init__( | |||
self, | |||
paths: Path | Iterable[Path] = 'data', | |||
crs: CRS | None = None, | |||
res: float | None = None, | |||
res: tuple[float, float] | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, I would like all of these datasets to support both float
and tuple[float, float]
similar to how our Samplers work. We can use the same helper function to convert the former to the latter. This is also nice for backwards compatibility (which we have to start caring about soon).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to update docstrings to document the order of xres
and yres
.
This PR refactors GeoDatasets to use separate values to store the x and y resolutions. This is pretty important because not all raster pixels are square.
Some notes:
size
in (height, width) format for the samplersCloses #2594