-
Notifications
You must be signed in to change notification settings - Fork 390
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
MODIS dataset implementation for TorchGeo #2564
base: main
Are you sure you want to change the base?
MODIS dataset implementation for TorchGeo #2564
Conversation
@nickconst1999 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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.
- File should be moved to
torchgeo/datasets/modis.py
, see https://torchgeo.readthedocs.io/en/latest/user/contributing.html#datasets - It doesn't look like this dataset is compatible with our other GeoDatasets, it needs to support automatic reprojection
- It doesn't look like this dataset is compatible with our GeoSamplers, it needs to support bounding box queries
- You should not need to override
__init__
,__len__
, or__getitem__
, the defaults fromRasterDataset
should be fine, see https://torchgeo.readthedocs.io/en/latest/tutorials/custom_raster_dataset.html - We likely can't justify adding dependencies on xarray, rioxarray, pystac_client, and planetary_computer
- Need to add documentation
- Need to add unit tests
This pull request adds a new remote MODIS dataset implementation to TorchGeo. This new dataset class enables users to access and process MODIS data on–the–fly directly from the Microsoft Planetary Computer via the STAC API, without downloading the data locally.
The dataset queries the Microsoft Planetary Computer’s STAC API using a provided item ID and retrieves asset URLs for the desired MODIS product. This eliminates the need for pre-downloaded local files.
A configurable PRODUCTS dictionary defines several MODIS products (e.g., Snow Cover, Burned Area, Land Surface Temperature, Vegetation Indices, etc.), including their associated collection IDs, preferred asset keys, and bands. The dataset loads and combines multiple bands into a single xarray DataArray, ensuring consistency in data shape.
Furthermore, the implementation is designed as a subclass of TorchGeo’s RasterDataset, allows seamless integration into the TorchGeo ecosystem. This makes it easier for users to incorporate MODIS data into geospatial ML pipelines.