From fdbb36518366079c17957d36d2517539751f3bd9 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 30 Nov 2024 17:47:50 +0100 Subject: [PATCH] README: root -> paths for GeoDatasets --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6171e027640..c27ffa9c426 100644 --- a/README.md +++ b/README.md @@ -72,15 +72,15 @@ Many remote sensing applications involve working with [_geospatial datasets_](ht In this example, we show how easy it is to work with geospatial data and to sample small image patches from a combination of [Landsat](https://www.usgs.gov/landsat-missions) and [Cropland Data Layer (CDL)](https://data.nal.usda.gov/dataset/cropscape-cropland-data-layer) data using TorchGeo. First, we assume that the user has Landsat 7 and 8 imagery downloaded. Since Landsat 8 has more spectral bands than Landsat 7, we'll only use the bands that both satellites have in common. We'll create a single dataset including all images from both Landsat 7 and 8 data by taking the union between these two datasets. ```python -landsat7 = Landsat7(root="...", bands=["B1", ..., "B7"]) -landsat8 = Landsat8(root="...", bands=["B2", ..., "B8"]) +landsat7 = Landsat7(paths="...", bands=["B1", ..., "B7"]) +landsat8 = Landsat8(paths="...", bands=["B2", ..., "B8"]) landsat = landsat7 | landsat8 ``` Next, we take the intersection between this dataset and the CDL dataset. We want to take the intersection instead of the union to ensure that we only sample from regions that have both Landsat and CDL data. Note that we can automatically download and checksum CDL data. Also note that each of these datasets may contain files in different coordinate reference systems (CRS) or resolutions, but TorchGeo automatically ensures that a matching CRS and resolution is used. ```python -cdl = CDL(root="...", download=True, checksum=True) +cdl = CDL(paths="...", download=True, checksum=True) dataset = landsat & cdl ```