Fix Download Link AGB Live Woody Biomass dataset (#1713)

* fix link

* one line link
This commit is contained in:
Nils Lehmann 2023-11-05 21:59:07 +01:00 коммит произвёл Nils Lehmann
Родитель 5c4c7168f2
Коммит 57b028ce5e
3 изменённых файлов: 5 добавлений и 8 удалений

Просмотреть файл

@ -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]]]}}]}
{"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]]]}}]}

Просмотреть файл

@ -23,7 +23,7 @@ base_file = {
"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 @@ if __name__ == "__main__":
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)

Просмотреть файл

@ -44,10 +44,7 @@ class AbovegroundLiveWoodyBiomassDensity(RasterDataset):
is_image = False
url = (
"https://opendata.arcgis.com/api/v3/datasets/3e8736c8866b458687"
"e00d40c9f00bce_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"
@ -123,7 +120,7 @@ class AbovegroundLiveWoodyBiomassDensity(RasterDataset):
for item in content["features"]:
download_url(
item["properties"]["download"],
item["properties"]["Mg_px_1_download"],
self.paths,
item["properties"]["tile_id"] + ".tif",
)