diff --git a/src/eodash_catalog/endpoints.py b/src/eodash_catalog/endpoints.py index ff6a070..e31f538 100644 --- a/src/eodash_catalog/endpoints.py +++ b/src/eodash_catalog/endpoints.py @@ -10,7 +10,7 @@ import requests from dateutil import parser -from pystac import Catalog, Collection, Item, Link, SpatialExtent, Summaries +from pystac import Asset, Catalog, Collection, Item, Link, SpatialExtent, Summaries from pystac_client import Client from eodash_catalog.sh_endpoint import get_SH_token @@ -23,6 +23,7 @@ from eodash_catalog.thumbnails import generate_thumbnail from eodash_catalog.utils import ( Options, + create_geojson_from_bbox, create_geojson_point, generate_veda_cog_link, retrieveExtentFromWMSWMTS, @@ -764,3 +765,58 @@ def handle_custom_endpoint( collection_config, ) return collection + + +def handle_raw_source( + catalog_config: dict, + endpoint_config: dict, + collection_config: dict, + catalog: Catalog, +) -> Collection: + collection = get_or_create_collection( + catalog, collection_config["Name"], collection_config, catalog_config, endpoint_config + ) + if len(endpoint_config.get("TimeEntries", [])) > 0: + for time_entry in endpoint_config["TimeEntries"]: + extra_fields = {} + if "DataProjection" in endpoint_config: + extra_fields["proj:epsg"] = endpoint_config["DataProjection"] + assets = {} + media_type = "application/geo+json" + style_type = "text/vector-styles" + if endpoint_config["Name"] == "COG source": + style_type = "text/cog-styles" + media_type = "image/tiff" + for a in time_entry["Assets"]: + assets[a["Identifier"]] = Asset( + href=a["File"], roles=["data"], media_type=media_type, extra_fields=extra_fields + ) + bbox = endpoint_config.get("Bbox", [-180, -85, 180, 85]) + item = Item( + id=time_entry["Time"], + bbox=bbox, + properties={}, + geometry=create_geojson_from_bbox(bbox), + datetime=parser.isoparse(time_entry["Time"]), + assets=assets, + ) + ep_st = endpoint_config["Style"] + style_link = Link( + rel="style", + target=ep_st + if ep_st.startswith("http") + else f"{catalog_config['assets_endpoint']}/{ep_st}", + media_type=style_type, + extra_fields={ + "asset:keys": list(assets), + }, + ) + item.add_link(style_link) + if "DataProjection" in endpoint_config: + collection.extra_fields["proj:epsg"] = endpoint_config["DataProjection"] + link = collection.add_item(item) + link.extra_fields["datetime"] = time_entry["Time"] + link.extra_fields["assets"] = [a["File"] for a in time_entry["Assets"]] + add_collection_information(catalog_config, collection, collection_config) + collection.update_extent_from_items() + return collection diff --git a/src/eodash_catalog/generate_indicators.py b/src/eodash_catalog/generate_indicators.py index b29a8c9..1e26bad 100644 --- a/src/eodash_catalog/generate_indicators.py +++ b/src/eodash_catalog/generate_indicators.py @@ -20,6 +20,7 @@ handle_collection_only, handle_custom_endpoint, handle_GeoDB_endpoint, + handle_raw_source, handle_SH_endpoint, handle_SH_WMS_endpoint, handle_VEDA_endpoint, @@ -240,6 +241,10 @@ def process_collection_file( collection_config, catalog, ) + elif resource["Name"] in ["COG source", "GeoJSON source"]: + collection = handle_raw_source( + catalog_config, resource, collection_config, catalog + ) else: raise ValueError("Type of Resource is not supported") if collection: diff --git a/src/eodash_catalog/utils.py b/src/eodash_catalog/utils.py index 1d05384..2ebaf4b 100644 --- a/src/eodash_catalog/utils.py +++ b/src/eodash_catalog/utils.py @@ -35,6 +35,21 @@ def create_geojson_point(lon: int | float, lat: int | float) -> dict[str, Any]: return {"type": "Feature", "geometry": point, "properties": {}} +def create_geojson_from_bbox(bbox: list[float | int]) -> dict: + coordinates = [ + [bbox[0], bbox[1]], + [bbox[2], bbox[1]], + [bbox[2], bbox[3]], + [bbox[0], bbox[3]], + [bbox[0], bbox[1]], + ] + polygon = {"type": "Polygon", "coordinates": [coordinates]} + + feature = {"type": "Feature", "geometry": polygon, "properties": {}} + feature_collection = {"type": "FeatureCollection", "features": [feature]} + return feature_collection + + def retrieveExtentFromWMSWMTS( capabilities_url: str, layer: str, version: str = "1.1.1", wmts: bool = False ) -> tuple[list[float], list[str]]: diff --git a/tests/test-data/regional_forecast.json b/tests/test-data/regional_forecast.json new file mode 100644 index 0000000..2e8cf9a --- /dev/null +++ b/tests/test-data/regional_forecast.json @@ -0,0 +1 @@ +{"type": "FeatureCollection", "name": "NUTS_AT_AGRI_3035", "crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:EPSG::3035"}}, "features": [{"type": "Feature", "properties": {"NUTS_ID": "AT111", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Mittelburgenland", "NUTS_NAME": "Mittelburgenland", "MOUNT_TYPE": 4, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT111", "yield": {"Wheat": {"average": 9.19, "best": 9.15, "worst": 9.21}, "Maize": {"average": 12.6, "best": 13.64, "worst": 0.26}, "Sunflower": {"average": 4.91, "best": 5.59, "worst": 0.18}, "Soybean": {"average": 3.98, "best": 4.65, "worst": 1.9}}, "water_need": {"Wheat": {"average": 3, "best": 0, "worst": 37}, "Maize": {"average": 152, "best": 99, "worst": 345}, "Sunflower": {"average": 174, "best": 127, "worst": 367}, "Soybean": {"average": 170, "best": 126, "worst": 358}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT111&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT111&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT111&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT111&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT111&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT111&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT111&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT111&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT111&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT111&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT111&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT111&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4821838.7709, 2726165.9716], [4806751.430600001, 2714374.6019], [4794232.3982, 2724666.8182999995], [4799461.1095, 2746013.3567999993], [4802912.6987, 2748897.5074000005], [4821820.7984, 2743038.7753], [4821838.7709, 2726165.9716]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT112", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Nordburgenland", "NUTS_NAME": "Nordburgenland", "MOUNT_TYPE": 4, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT112", "yield": {"Wheat": {"average": 8.95, "best": 8.82, "worst": 9.28}, "Maize": {"average": 8.69, "best": 11.72, "worst": 0.27}, "Sunflower": {"average": 3.58, "best": 4.77, "worst": 0.11}, "Soybean": {"average": 3.17, "best": 4.28, "worst": 1.53}}, "water_need": {"Wheat": {"average": 3, "best": 0, "worst": 18}, "Maize": {"average": 264, "best": 144, "worst": 387}, "Sunflower": {"average": 289, "best": 172, "worst": 405}, "Soybean": {"average": 265, "best": 179, "worst": 407}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT112&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT112&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT112&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT112&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT112&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT112&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT112&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT112&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT112&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT112&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT112&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT112&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4854633.2936, 2791782.4586999994], [4848182.930199999, 2758424.007200001], [4831130.8323, 2754284.3971999995], [4815471.18, 2758594.6459], [4802912.6987, 2748897.5074000005], [4799461.1095, 2746013.3567999993], [4794492.8671, 2758158.7359999996], [4798615.8835, 2772722.7161999997], [4805034.1021, 2779100.0143999998], [4813148.559699999, 2777119.8232000005], [4830660.8871, 2794709.8901000004], [4841049.4728, 2794508.9826999996], [4846489.8573, 2803511.3914], [4854633.2936, 2791782.4586999994]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT113", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "S\u00fcdburgenland", "NUTS_NAME": "S\u00fcdburgenland", "MOUNT_TYPE": 4, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT113", "yield": {"Wheat": {"average": 9.18, "best": 9.23, "worst": 9.22}, "Maize": {"average": 13.82, "best": 14.31, "worst": 3.59}, "Sunflower": {"average": 5.54, "best": 6.21, "worst": 3.36}, "Soybean": {"average": 4.6, "best": 4.94, "worst": 3.11}}, "water_need": {"Wheat": {"average": 3, "best": 0, "worst": 41}, "Maize": {"average": 141, "best": 49, "worst": 281}, "Sunflower": {"average": 173, "best": 77, "worst": 298}, "Soybean": {"average": 130, "best": 81, "worst": 295}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT113&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT113&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT113&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT113&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT113&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT113&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT113&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT113&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT113&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT113&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT113&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT113&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4806751.430600001, 2714374.6019], [4812740.354599999, 2687723.0766000003], [4810258.654200001, 2677111.2202000003], [4800025.597100001, 2673793.8384000007], [4786947.8336, 2658724.9250000007], [4778298.5133, 2654263.0853000004], [4785713.0998, 2673003.2632], [4776791.9191, 2712431.4378999993], [4786359.1337, 2720266.3476], [4794232.3982, 2724666.8182999995], [4806751.430600001, 2714374.6019]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT121", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Mostviertel-Eisenwurzen", "NUTS_NAME": "Mostviertel-Eisenwurzen", "MOUNT_TYPE": 2, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT121", "yield": {"Wheat": {"average": 8.41, "best": 8.35, "worst": 8.44}, "Maize": {"average": 12.73, "best": 14.06, "worst": 0.23}, "Sunflower": {"average": 5.23, "best": 6.26, "worst": 1.39}, "Soybean": {"average": 4.07, "best": 4.91, "worst": 1.98}}, "water_need": {"Wheat": {"average": 4, "best": 0, "worst": 23}, "Maize": {"average": 129, "best": 48, "worst": 304}, "Sunflower": {"average": 155, "best": 75, "worst": 320}, "Soybean": {"average": 142, "best": 66, "worst": 332}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT121&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT121&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT121&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT121&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT121&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT121&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT121&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT121&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT121&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT121&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT121&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT121&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4729365.276799999, 2815976.3673], [4726572.5578000005, 2790666.1566000003], [4715402.456700001, 2777884.0721000005], [4720089.821799999, 2767339.349300001], [4711489.3632, 2762353.5242999997], [4711804.5307, 2756071.9159999993], [4702486.772700001, 2749484.1655], [4680014.4482, 2746538.018100001], [4676275.6162, 2748475.8258999996], [4675665.1109, 2764056.0321999993], [4659253.963099999, 2774810.9908000007], [4654776.8215, 2787028.4026999995], [4656732.846899999, 2801817.7792000007], [4675427.5437, 2796440.8738], [4689776.2969, 2805059.8488999996], [4688301.636499999, 2819349.191400001], [4710448.6927000005, 2817966.0402000006], [4716448.241599999, 2810263.727], [4729365.276799999, 2815976.3673]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT122", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Nieder\u00f6sterreich-S\u00fcd", "NUTS_NAME": "Nieder\u00f6sterreich-S\u00fcd", "MOUNT_TYPE": 3, "URBN_TYPE": 2, "COAST_TYPE": 3, "FID": "AT122", "yield": {"Wheat": {"average": 7.95, "best": 7.92, "worst": 8.01}, "Maize": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Sunflower": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Soybean": {"average": 4.8, "best": 4.9, "worst": 3.33}}, "water_need": {"Wheat": {"average": 3, "best": 0, "worst": 14}, "Maize": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Sunflower": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Soybean": {"average": 71, "best": 31, "worst": 263}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT122&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT122&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT122&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "", "best": "", "worst": ""}, "Sunflower": {"average": "", "best": "", "worst": ""}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT122&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT122&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT122&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4798615.8835, 2772722.7161999997], [4794492.8671, 2758158.7359999996], [4799461.1095, 2746013.3567999993], [4794232.3982, 2724666.8182999995], [4786359.1337, 2720266.3476], [4780029.485200001, 2728347.4551999997], [4760796.640699999, 2734593.8402999993], [4750867.4233, 2744836.3982999995], [4723072.4749, 2758571.9596999995], [4711804.5307, 2756071.9159999993], [4711489.3632, 2762353.5242999997], [4720089.821799999, 2767339.349300001], [4735846.6910999995, 2787573.955600001], [4761466.483899999, 2792463.8223], [4783481.1602, 2776433.5638999995], [4798615.8835, 2772722.7161999997]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT123", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Sankt P\u00f6lten", "NUTS_NAME": "Sankt P\u00f6lten", "MOUNT_TYPE": 2, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT123", "yield": {"Wheat": {"average": 9.16, "best": 8.8, "worst": 9.12}, "Maize": {"average": 11.99, "best": 13.64, "worst": 1.27}, "Sunflower": {"average": 4.67, "best": 5.77, "worst": 1.3}, "Soybean": {"average": 3.27, "best": 4.49, "worst": 1.05}}, "water_need": {"Wheat": {"average": 13, "best": 5, "worst": 70}, "Maize": {"average": 142, "best": 95, "worst": 312}, "Sunflower": {"average": 171, "best": 123, "worst": 325}, "Soybean": {"average": 174, "best": 65, "worst": 351}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT123&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT123&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT123&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT123&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT123&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT123&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT123&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT123&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT123&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT123&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT123&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT123&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4766617.899499999, 2799482.1423000004], [4761466.483899999, 2792463.8223], [4735846.6910999995, 2787573.955600001], [4720089.821799999, 2767339.349300001], [4715402.456700001, 2777884.0721000005], [4726572.5578000005, 2790666.1566000003], [4729365.276799999, 2815976.3673], [4745246.488, 2824285.150800001], [4754460.202099999, 2810040.6975999996], [4764125.1895, 2808772.2530000005], [4766617.899499999, 2799482.1423000004]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT124", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Waldviertel", "NUTS_NAME": "Waldviertel", "MOUNT_TYPE": 4, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT124", "yield": {"Wheat": {"average": 8.72, "best": 9.13, "worst": 7.82}, "Maize": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Sunflower": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Soybean": {"average": 3.19, "best": 4.47, "worst": 1.57}}, "water_need": {"Wheat": {"average": 104, "best": 41, "worst": 193}, "Maize": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Sunflower": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Soybean": {"average": 217, "best": 115, "worst": 345}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT124&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT124&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT124&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "", "best": "", "worst": ""}, "Sunflower": {"average": "", "best": "", "worst": ""}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT124&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT124&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT124&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4726983.6402, 2881333.1931999996], [4742889.3682, 2876362.7248], [4750007.8452, 2869424.6975], [4755316.942299999, 2853526.1678], [4745940.7228999995, 2844752.0292000007], [4748191.413899999, 2835851.8060999997], [4745246.488, 2824285.150800001], [4729365.276799999, 2815976.3673], [4716448.241599999, 2810263.727], [4710448.6927000005, 2817966.0402000006], [4688301.636499999, 2819349.191400001], [4680267.486500001, 2833529.7031999994], [4666960.763, 2841107.5930000003], [4671696.735300001, 2855478.0228000004], [4683800.216, 2865231.0216000006], [4688408.726500001, 2889033.9690000005], [4726983.6402, 2881333.1931999996]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT125", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Weinviertel", "NUTS_NAME": "Weinviertel", "MOUNT_TYPE": 4, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT125", "yield": {"Wheat": {"average": 9.12, "best": 8.94, "worst": 8.83}, "Maize": {"average": 8.96, "best": 10.79, "worst": 0.0}, "Sunflower": {"average": 3.14, "best": 4.01, "worst": 0.0}, "Soybean": {"average": 1.97, "best": 3.41, "worst": 0.38}}, "water_need": {"Wheat": {"average": 45, "best": 13, "worst": 103}, "Maize": {"average": 237, "best": 217, "worst": 392}, "Sunflower": {"average": 266, "best": 239, "worst": 399}, "Soybean": {"average": 251, "best": 247, "worst": 430}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT125&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT125&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT125&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT125&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT125&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT125&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT125&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT125&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT125&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT125&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT125&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT125&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4832035.225400001, 2857836.831599999], [4833565.827299999, 2848880.935799999], [4827291.811899999, 2837437.805400001], [4805108.2996, 2839377.4876000006], [4788044.0265, 2849928.2930999994], [4775034.5013, 2837808.2350999992], [4748191.413899999, 2835851.8060999997], [4745940.7228999995, 2844752.0292000007], [4755316.942299999, 2853526.1678], [4750007.8452, 2869424.6975], [4742889.3682, 2876362.7248], [4783217.797599999, 2866474.0178999994], [4802272.2919, 2876131.341499999], [4826938.591700001, 2867717.001], [4832035.225400001, 2857836.831599999]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT126", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Wiener Umland/Nordteil", "NUTS_NAME": "Wiener Umland/Nordteil", "MOUNT_TYPE": 4, "URBN_TYPE": 1, "COAST_TYPE": 3, "FID": "AT126", "yield": {"Wheat": {"average": 9.05, "best": 8.89, "worst": 9.4}, "Maize": {"average": 7.94, "best": 11.03, "worst": 0.53}, "Sunflower": {"average": 3.0, "best": 4.29, "worst": 0.3}, "Soybean": {"average": 2.53, "best": 3.87, "worst": 0.76}}, "water_need": {"Wheat": {"average": 12, "best": 0, "worst": 30}, "Maize": {"average": 256, "best": 160, "worst": 403}, "Sunflower": {"average": 276, "best": 194, "worst": 411}, "Soybean": {"average": 271, "best": 194, "worst": 438}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT126&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT126&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT126&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT126&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT126&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT126&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT126&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT126&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT126&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT126&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT126&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT126&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4827291.811899999, 2837437.805400001], [4839232.970000001, 2808802.6084000003], [4824388.316199999, 2801383.4985000007], [4810026.3159, 2802881.3099000007], [4805208.368100001, 2815402.4612000007], [4796625.635, 2819975.155200001], [4782534.532400001, 2811756.030099999], [4780681.6302000005, 2803583.5084000006], [4766617.899499999, 2799482.1423000004], [4764125.1895, 2808772.2530000005], [4754460.202099999, 2810040.6975999996], [4745246.488, 2824285.150800001], [4748191.413899999, 2835851.8060999997], [4775034.5013, 2837808.2350999992], [4788044.0265, 2849928.2930999994], [4805108.2996, 2839377.4876000006], [4827291.811899999, 2837437.805400001]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT127", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Wiener Umland/S\u00fcdteil", "NUTS_NAME": "Wiener Umland/S\u00fcdteil", "MOUNT_TYPE": 4, "URBN_TYPE": 2, "COAST_TYPE": 3, "FID": "AT127", "yield": {"Wheat": {"average": 9.36, "best": 9.05, "worst": 9.39}, "Maize": {"average": 8.46, "best": 9.36, "worst": 0.34}, "Sunflower": {"average": 3.15, "best": 3.83, "worst": 0.19}, "Soybean": {"average": 2.64, "best": 3.66, "worst": 0.77}}, "water_need": {"Wheat": {"average": 11, "best": 0, "worst": 59}, "Maize": {"average": 259, "best": 229, "worst": 416}, "Sunflower": {"average": 280, "best": 249, "worst": 428}, "Soybean": {"average": 268, "best": 220, "worst": 432}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT127&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT127&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT127&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT127&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT127&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT127&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT127&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT127&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT127&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT127&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT127&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT127&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4810026.3159, 2802881.3099000007], [4824388.316199999, 2801383.4985000007], [4839232.970000001, 2808802.6084000003], [4846489.8573, 2803511.3914], [4841049.4728, 2794508.9826999996], [4830660.8871, 2794709.8901000004], [4813148.559699999, 2777119.8232000005], [4805034.1021, 2779100.0143999998], [4798615.8835, 2772722.7161999997], [4783481.1602, 2776433.5638999995], [4761466.483899999, 2792463.8223], [4766617.899499999, 2799482.1423000004], [4780681.6302000005, 2803583.5084000006], [4810026.3159, 2802881.3099000007]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT221", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Graz", "NUTS_NAME": "Graz", "MOUNT_TYPE": 3, "URBN_TYPE": 2, "COAST_TYPE": 3, "FID": "AT221", "yield": {"Wheat": {"average": 8.93, "best": 8.98, "worst": 8.78}, "Maize": {"average": 14.22, "best": 14.32, "worst": 9.27}, "Sunflower": {"average": 6.29, "best": 6.37, "worst": 4.32}, "Soybean": {"average": 4.29, "best": 4.9, "worst": 2.82}}, "water_need": {"Wheat": {"average": 34, "best": 0, "worst": 93}, "Maize": {"average": 49, "best": 15, "worst": 236}, "Sunflower": {"average": 85, "best": 16, "worst": 256}, "Soybean": {"average": 77, "best": 0, "worst": 271}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT221&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT221&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT221&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT221&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT221&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT221&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT221&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT221&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT221&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT221&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT221&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT221&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4728914.8758000005, 2703560.558700001], [4734836.407, 2693157.1164999995], [4748250.701199999, 2685596.8812000006], [4753868.7206999995, 2671186.6733], [4748020.863600001, 2670535.9944], [4731988.534700001, 2657714.0924999993], [4711242.9835, 2688609.7184999995], [4703733.7897, 2690653.335000001], [4703272.800899999, 2692290.1689999998], [4716557.587200001, 2704792.4880999997], [4728914.8758000005, 2703560.558700001]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT224", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Oststeiermark", "NUTS_NAME": "Oststeiermark", "MOUNT_TYPE": 2, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT224", "yield": {"Wheat": {"average": 8.93, "best": 9.0, "worst": 8.97}, "Maize": {"average": 14.64, "best": 14.67, "worst": 8.45}, "Sunflower": {"average": 6.4, "best": 6.54, "worst": 4.09}, "Soybean": {"average": 4.5, "best": 5.02, "worst": 3.06}}, "water_need": {"Wheat": {"average": 3, "best": 0, "worst": 56}, "Maize": {"average": 70, "best": 7, "worst": 241}, "Sunflower": {"average": 94, "best": 19, "worst": 260}, "Soybean": {"average": 105, "best": 6, "worst": 269}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT224&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT224&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT224&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT224&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT224&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT224&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT224&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT224&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT224&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT224&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT224&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT224&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4786359.1337, 2720266.3476], [4776791.9191, 2712431.4378999993], [4785713.0998, 2673003.2632], [4778298.5133, 2654263.0853000004], [4781138.73, 2636341.2249999996], [4763403.3181, 2638817.9725], [4753009.4882, 2637824.3693000004], [4756578.126700001, 2645372.801000001], [4747818.734200001, 2661943.1195], [4748020.863600001, 2670535.9944], [4753868.7206999995, 2671186.6733], [4748250.701199999, 2685596.8812000006], [4734836.407, 2693157.1164999995], [4728914.8758000005, 2703560.558700001], [4746033.6894000005, 2725243.121099999], [4760796.640699999, 2734593.8402999993], [4780029.485200001, 2728347.4551999997], [4786359.1337, 2720266.3476]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT225", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "West- und S\u00fcdsteiermark", "NUTS_NAME": "West- und S\u00fcdsteiermark", "MOUNT_TYPE": 3, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT225", "yield": {"Wheat": {"average": 8.97, "best": 9.03, "worst": 8.99}, "Maize": {"average": 14.62, "best": 14.58, "worst": 8.12}, "Sunflower": {"average": 6.13, "best": 6.4, "worst": 4.15}, "Soybean": {"average": 4.55, "best": 5.03, "worst": 3.22}}, "water_need": {"Wheat": {"average": 3, "best": 0, "worst": 65}, "Maize": {"average": 91, "best": 4, "worst": 245}, "Sunflower": {"average": 130, "best": 8, "worst": 264}, "Soybean": {"average": 111, "best": 10, "worst": 272}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT225&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT225&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT225&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT225&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT225&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT225&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT225&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT225&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT225&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT225&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT225&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT225&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4748020.863600001, 2670535.9944], [4747818.734200001, 2661943.1195], [4756578.126700001, 2645372.801000001], [4753009.4882, 2637824.3693000004], [4741993.602, 2628691.8389999997], [4734492.067299999, 2630626.1513], [4708765.1296999995, 2628648.7771000005], [4702156.259299999, 2644741.085999999], [4701916.816299999, 2659466.3616000004], [4688942.901799999, 2671473.2507000007], [4703733.7897, 2690653.335000001], [4711242.9835, 2688609.7184999995], [4731988.534700001, 2657714.0924999993], [4748020.863600001, 2670535.9944]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT311", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Innviertel", "NUTS_NAME": "Innviertel", "MOUNT_TYPE": 4, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT311", "yield": {"Wheat": {"average": 8.07, "best": 8.0, "worst": 8.11}, "Maize": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Sunflower": {"average": "N/A", "best": "N/A", "worst": 5.3}, "Soybean": {"average": 4.84, "best": 4.96, "worst": 3.7}}, "water_need": {"Wheat": {"average": 3, "best": 0, "worst": 10}, "Maize": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Sunflower": {"average": "N/A", "best": "N/A", "worst": 200}, "Soybean": {"average": 25, "best": 0, "worst": 208}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT311&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT311&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT311&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "", "best": "", "worst": ""}, "Sunflower": {"average": "", "best": "", "worst": "/crop_model/regional_forecast?nuts_id=AT311&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT311&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT311&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT311&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4596341.521500001, 2829133.7541000005], [4607259.8697, 2820043.5494], [4612711.6423, 2797314.6400000006], [4600506.891899999, 2785382.1982000005], [4581160.461200001, 2783670.4559000004], [4567548.3138999995, 2771539.2345000003], [4558250.4069, 2768274.2731], [4544161.352499999, 2773820.8451000005], [4534508.8895, 2768916.1735999994], [4525936.166999999, 2781511.587099999], [4539906.565199999, 2792493.4747], [4556759.177300001, 2802949.1988999993], [4572402.1347, 2812302.7816000003], [4574853.3708, 2832082.245100001], [4580163.4092999995, 2837016.5943], [4596341.521500001, 2829133.7541000005]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT312", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "Linz-Wels", "NUTS_NAME": "Linz-Wels", "MOUNT_TYPE": 4, "URBN_TYPE": 2, "COAST_TYPE": 3, "FID": "AT312", "yield": {"Wheat": {"average": 8.88, "best": 8.83, "worst": 8.88}, "Maize": {"average": 13.05, "best": 14.42, "worst": 4.13}, "Sunflower": {"average": 5.35, "best": 6.36, "worst": 1.88}, "Soybean": {"average": 4.01, "best": 4.83, "worst": 1.81}}, "water_need": {"Wheat": {"average": 3, "best": 0, "worst": 20}, "Maize": {"average": 136, "best": 51, "worst": 297}, "Sunflower": {"average": 162, "best": 89, "worst": 308}, "Soybean": {"average": 132, "best": 91, "worst": 318}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT312&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT312&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT312&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "/crop_model/regional_forecast?nuts_id=AT312&crop=MaizeGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT312&crop=MaizeGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT312&crop=MaizeGDD&scenario=worst"}, "Sunflower": {"average": "/crop_model/regional_forecast?nuts_id=AT312&crop=SunflowerGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT312&crop=SunflowerGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT312&crop=SunflowerGDD&scenario=worst"}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT312&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT312&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT312&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4656732.846899999, 2801817.7792000007], [4654776.8215, 2787028.4026999995], [4627633.078600001, 2782466.8113], [4618404.993799999, 2773478.673800001], [4600506.891899999, 2785382.1982000005], [4612711.6423, 2797314.6400000006], [4607259.8697, 2820043.5494], [4619451.7829, 2817006.0536], [4639241.3105, 2825433.0034999996], [4648489.1337, 2819704.3738], [4651649.188100001, 2810828.7657999992], [4649312.8651, 2803855.4235999994], [4656732.846899999, 2801817.7792000007]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}, {"type": "Feature", "properties": {"NUTS_ID": "AT313", "LEVL_CODE": 3, "CNTR_CODE": "AT", "NAME_LATN": "M\u00fchlviertel", "NUTS_NAME": "M\u00fchlviertel", "MOUNT_TYPE": 3, "URBN_TYPE": 3, "COAST_TYPE": 3, "FID": "AT313", "yield": {"Wheat": {"average": 8.93, "best": 8.98, "worst": 8.89}, "Maize": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Sunflower": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Soybean": {"average": 3.54, "best": 4.52, "worst": 1.14}}, "water_need": {"Wheat": {"average": 30, "best": 27, "worst": 69}, "Maize": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Sunflower": {"average": "N/A", "best": "N/A", "worst": "N/A"}, "Soybean": {"average": 134, "best": 89, "worst": 296}}, "links": {"Wheat": {"average": "/crop_model/regional_forecast?nuts_id=AT313&crop=WheatGDD&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT313&crop=WheatGDD&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT313&crop=WheatGDD&scenario=worst"}, "Maize": {"average": "", "best": "", "worst": ""}, "Sunflower": {"average": "", "best": "", "worst": ""}, "Soybean": {"average": "/crop_model/regional_forecast?nuts_id=AT313&crop=Soybean&scenario=average", "best": "/crop_model/regional_forecast?nuts_id=AT313&crop=Soybean&scenario=best", "worst": "/crop_model/regional_forecast?nuts_id=AT313&crop=Soybean&scenario=worst"}}}, "geometry": {"type": "MultiPolygon", "coordinates": [[[[4666960.763, 2841107.5930000003], [4680267.486500001, 2833529.7031999994], [4688301.636499999, 2819349.191400001], [4689776.2969, 2805059.8488999996], [4675427.5437, 2796440.8738], [4656732.846899999, 2801817.7792000007], [4649312.8651, 2803855.4235999994], [4651649.188100001, 2810828.7657999992], [4648489.1337, 2819704.3738], [4639241.3105, 2825433.0034999996], [4619451.7829, 2817006.0536], [4607259.8697, 2820043.5494], [4596341.521500001, 2829133.7541000005], [4601794.366800001, 2840349.2882000003], [4600312.774800001, 2851666.636], [4603174.0754, 2858273.119000001], [4624277.1894000005, 2839622.7402999997], [4641505.738500001, 2837187.209899999], [4651663.9683, 2845246.5511000007], [4666960.763, 2841107.5930000003]]]]}, "units": {"yield": "t/ha", "water_need": "mm"}}]} \ No newline at end of file diff --git a/tests/test_generate.py b/tests/test_generate.py index ac8232c..cc0f2dc 100644 --- a/tests/test_generate.py +++ b/tests/test_generate.py @@ -111,3 +111,47 @@ def test_baselayers_and_overlays_added(catalog_output_folder): ] assert len(baselayer_links) == 1 assert len(overlay_links) == 1 + + +def test_geojson_dataset_handled(catalog_output_folder): + collection_name = "crop_forecast_at" + root_collection_path = os.path.join(catalog_output_folder, collection_name) + child_collection_path = os.path.join(root_collection_path, collection_name) + child_child_collection_path = os.path.join(child_collection_path, collection_name) + item_dir = os.path.join(child_child_collection_path, "2024") + item_paths = os.listdir(item_dir) + assert len(item_paths) == 1 + with open(os.path.join(child_collection_path, "collection.json")) as fp: + collection_json = json.load(fp) + geojson_links = [ + link + for link in collection_json["links"] + if (link.get("rel", "") == "item" and len(link.get("assets", [])) > 0) + ] + # geojson link with assets exists + assert len(geojson_links) > 0 + # and has a correct value + assert ( + geojson_links[0]["assets"][0] + == "https://raw.githubusercontent.com/eodash/eodash_catalog/main/tests/regional_forecast.json" + ) + # epsg code saved on collection + assert collection_json.get("proj:epsg", "") == 3035 + # epsg code is saved to item + with open(os.path.join(item_dir, item_paths[0])) as fp: + item_json = json.load(fp) + assert item_json["assets"]["vector_data"]["type"] == "application/geo+json" + assert item_json["collection"] == collection_name + + +def test_cog_dataset_handled(catalog_output_folder): + collection_name = "solar_energy" + root_collection_path = os.path.join(catalog_output_folder, collection_name) + child_collection_path = os.path.join(root_collection_path, collection_name) + child_child_collection_path = os.path.join(child_collection_path, collection_name) + item_dir = os.path.join(child_child_collection_path, "2023") + item_paths = os.listdir(item_dir) + with open(os.path.join(item_dir, item_paths[0])) as fp: + item_json = json.load(fp) + assert item_json["assets"]["solar_power"]["type"] == "image/tiff" + assert item_json["collection"] == collection_name diff --git a/tests/testing-catalogs/testing.yaml b/tests/testing-catalogs/testing.yaml index f4f4f95..c404548 100644 --- a/tests/testing-catalogs/testing.yaml +++ b/tests/testing-catalogs/testing.yaml @@ -8,3 +8,5 @@ assets_endpoint: "https://raw.githubusercontent.com/eurodatacube/eodash-assets/m collections: - test_wms_no_time - test_indicator + - test_CROPOMAT1 + - test_see_solar_energy diff --git a/tests/testing-collections/test_CROPOMAT1.yaml b/tests/testing-collections/test_CROPOMAT1.yaml new file mode 100644 index 0000000..c34e066 --- /dev/null +++ b/tests/testing-collections/test_CROPOMAT1.yaml @@ -0,0 +1,51 @@ +Name: crop_forecast_at +Title: Austria yield +EodashIdentifier: CROPOMAT1 +Subtitle: Yield forecast under "what-if" scenarios +Description: "" +Themes: + - agriculture + - economy +Tags: + - Crop + - Yield + - Water + - Forecast +DataSource: + Spaceborne: + Satellite: + - Sentinel-2 + - CLMS HR-VPP Vegetation Indices + - CLMS HR-VPP Seasonal Trajectory + InSitu: + - Meteorological data from local Meteorological offices (AT) +Agency: + - ESA +Provider: + - Name: CropOM + Url: https://cropom.com + - Name: Danube Data Cube + Url: https://ddc.cropom.com + - Name: Copernicus Land Monitoring Service + Url: https://land.copernicus.eu/en/dataset-catalog + - Name: FAO + Url: https://www.fao.org/home/en +License: + - Name: Commercial license + Url: https://cropom.com/terms_and_conditions.pdf +References: + - Name: Danube Data Cube documentation + Url: https://doc.cropom.com + - Name: AquaCrop + Url: https://www.fao.org/aquacrop/en/ +Resources: + - Name: GeoJSON source + Style: crop_forecast_CropOM/style_yield.json + Bbox: [9.27, 46.2, 17.3, 49.2] + DataProjection: 3035 + TimeEntries: + - Time: "20240101" + Assets: + - Identifier: vector_data + File: "https://raw.githubusercontent.com/eodash/eodash_catalog/main/tests/regional_forecast.json" +Legend: crop_forecast_CropOM/cm_legend.png diff --git a/tests/testing-collections/test_see_solar_energy.yaml b/tests/testing-collections/test_see_solar_energy.yaml new file mode 100644 index 0000000..cdb5c93 --- /dev/null +++ b/tests/testing-collections/test_see_solar_energy.yaml @@ -0,0 +1,25 @@ +Name: solar_energy +Title: Solar energy cog example +EodashIdentifier: SEE +Description: testing +Themes: + - placeholder +Tags: + - placeholder +DataSource: + Spaceborne: + Satellite: + - Sentinel-2 +Agency: + - ESA +Resources: + - Name: COG source + Style: test_assets/cog_style.json + Bbox: [11, 46.5, 15.5, 48.9] + TimeEntries: + - Time: "2023" + Assets: + - Identifier: solar_power + File: https://eox-gtif-public.s3.eu-central-1.amazonaws.com/DHI/v2/SolarPowerPotential_Annual_COG_clipped_3857_fixed.tif + - Identifier: wsf + File: https://eox-gtif-public.s3.eu-central-1.amazonaws.com/DHI/WSF_EucDist_Austria_3857_COG_fix.tif