From 6a9679ac8acf06358d3cd055b0128f5017baaa05 Mon Sep 17 00:00:00 2001 From: Nils Lehmann Date: Sun, 5 Nov 2023 15:18:47 +0100 Subject: [PATCH 1/2] fix link --- .../Aboveground_Live_Woody_Biomass_Density.geojson | 2 +- tests/data/agb_live_woody_density/data.py | 4 ++-- torchgeo/datasets/agb_live_woody_density.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/data/agb_live_woody_density/Aboveground_Live_Woody_Biomass_Density.geojson b/tests/data/agb_live_woody_density/Aboveground_Live_Woody_Biomass_Density.geojson index 169191641e1..7beec3e9db3 100644 --- a/tests/data/agb_live_woody_density/Aboveground_Live_Woody_Biomass_Density.geojson +++ b/tests/data/agb_live_woody_density/Aboveground_Live_Woody_Biomass_Density.geojson @@ -1 +1 @@ -{"type": "FeatureCollection", "name": "Aboveground_Live_Woody_Biomass_Density", "crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"}}, "features": [{"type": "Feature", "properties": {"tile_id": "00N_000E", "download": "tests/data/agb_live_woody_density/00N_000E.tif", "ObjectId": 1, "Shape__Area": 1245542622548.87, "Shape__Length": 4464169.76558139}, "geometry": {"type": "Polygon", "coordinates": [[[0.0, 0.0], [10.0, 0.0], [10.0, -10.0], [0.0, -10.0], [0.0, 0.0]]]}}]} \ No newline at end of file +{"type": "FeatureCollection", "name": "Aboveground_Live_Woody_Biomass_Density", "crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"}}, "features": [{"type": "Feature", "properties": {"tile_id": "00N_000E", "Mg_px_1_download": "tests/data/agb_live_woody_density/00N_000E.tif", "ObjectId": 1, "Shape__Area": 1245542622548.87, "Shape__Length": 4464169.76558139}, "geometry": {"type": "Polygon", "coordinates": [[[0.0, 0.0], [10.0, 0.0], [10.0, -10.0], [0.0, -10.0], [0.0, 0.0]]]}}]} \ No newline at end of file diff --git a/tests/data/agb_live_woody_density/data.py b/tests/data/agb_live_woody_density/data.py index 5bbb9b1476d..115a9772fba 100755 --- a/tests/data/agb_live_woody_density/data.py +++ b/tests/data/agb_live_woody_density/data.py @@ -23,7 +23,7 @@ "type": "Feature", "properties": { "tile_id": "00N_000E", - "download": os.path.join( + "Mg_px_1_download": os.path.join( "tests", "data", "agb_live_woody_density", "00N_000E.tif" ), "ObjectId": 1, @@ -74,5 +74,5 @@ def create_file(path: str, dtype: str, num_channels: int) -> None: json.dump(base_file, f) for i in base_file["features"]: - filepath = os.path.basename(i["properties"]["download"]) + filepath = os.path.basename(i["properties"]["Mg_px_1_download"]) create_file(path=filepath, dtype="int32", num_channels=1) diff --git a/torchgeo/datasets/agb_live_woody_density.py b/torchgeo/datasets/agb_live_woody_density.py index 885d6bc4fac..291d5356499 100644 --- a/torchgeo/datasets/agb_live_woody_density.py +++ b/torchgeo/datasets/agb_live_woody_density.py @@ -45,8 +45,8 @@ class AbovegroundLiveWoodyBiomassDensity(RasterDataset): is_image = False url = ( - "https://opendata.arcgis.com/api/v3/datasets/3e8736c8866b458687" - "e00d40c9f00bce_0/downloads/data?format=geojson&spatialRefId=4326" + "https://opendata.arcgis.com/api/v3/datasets/e4bdbe8d6d8d4e32ace7d3" + "6a4aec7b93_0/downloads/data?format=geojson&spatialRefId=4326" ) base_filename = "Aboveground_Live_Woody_Biomass_Density.geojson" @@ -123,7 +123,7 @@ def _download(self) -> None: for item in content["features"]: download_url( - item["properties"]["download"], + item["properties"]["Mg_px_1_download"], self.paths, item["properties"]["tile_id"] + ".tif", ) From 10d09daf372d2746915fed032d3f9814fc46d3f3 Mon Sep 17 00:00:00 2001 From: Nils Lehmann Date: Sun, 5 Nov 2023 21:36:27 +0100 Subject: [PATCH 2/2] one line link --- torchgeo/datasets/agb_live_woody_density.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/torchgeo/datasets/agb_live_woody_density.py b/torchgeo/datasets/agb_live_woody_density.py index 291d5356499..e572de967b2 100644 --- a/torchgeo/datasets/agb_live_woody_density.py +++ b/torchgeo/datasets/agb_live_woody_density.py @@ -44,10 +44,7 @@ class AbovegroundLiveWoodyBiomassDensity(RasterDataset): is_image = False - url = ( - "https://opendata.arcgis.com/api/v3/datasets/e4bdbe8d6d8d4e32ace7d3" - "6a4aec7b93_0/downloads/data?format=geojson&spatialRefId=4326" - ) + url = "https://opendata.arcgis.com/api/v3/datasets/e4bdbe8d6d8d4e32ace7d36a4aec7b93_0/downloads/data?format=geojson&spatialRefId=4326" # noqa: E501 base_filename = "Aboveground_Live_Woody_Biomass_Density.geojson"