Skip to content

Commit 4933b2b

Browse files
authored
README: root -> paths for GeoDatasets (#2438)
1 parent 9f2cc02 commit 4933b2b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ Many remote sensing applications involve working with [_geospatial datasets_](ht
7272
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.
7373

7474
```python
75-
landsat7 = Landsat7(root="...", bands=["B1", ..., "B7"])
76-
landsat8 = Landsat8(root="...", bands=["B2", ..., "B8"])
75+
landsat7 = Landsat7(paths="...", bands=["B1", ..., "B7"])
76+
landsat8 = Landsat8(paths="...", bands=["B2", ..., "B8"])
7777
landsat = landsat7 | landsat8
7878
```
7979

8080
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.
8181

8282
```python
83-
cdl = CDL(root="...", download=True, checksum=True)
83+
cdl = CDL(paths="...", download=True, checksum=True)
8484
dataset = landsat & cdl
8585
```
8686

0 commit comments

Comments
 (0)