Hello! I have an error 400 when trying to retrieve data from HHNK:
import nlmod
from pathlib import Path
# Model extent (xmin, xmax, ymin, ymax) from the loaded MF6 model grid
xmin, xmax, ymin, ymax = modelgrid.extent
extent = [xmin, xmax, ymin, ymax]
print(f"Extent (xmin, xmax, ymin, ymax): {extent}")
cachedir = model_ws / "cache" / "hhnk_level_deviations"
cachedir.mkdir(parents=True, exist_ok=True)
# nlmod uses: arcrest call to
# https://kaarten.hhnk.nl/arcgis/rest/services/NHFLO/Peilafwijking_gebied/MapServer
# layer 0 (default), f="geojson", with the Sectigo intermediate cert injected.
peilafw = nlmod.read.waterboard.download_data(
"Hollands Noorderkwartier",
"level_deviations",
extent=extent,
cachedir=str(cachedir),
cachename="hhnk_peilafwijking",
)
print(f"Downloaded {len(peilafw)} peilafwijking features")
print(peilafw.columns.tolist())
peilafw.head()
i get this error
ValueError Traceback (most recent call last)
Cell In[7], line 15
11
12 # nlmod uses: arcrest call to
13 # https://kaarten.hhnk.nl/arcgis/rest/services/NHFLO/Peilafwijking_gebied/MapServer
14 # layer 0 (default), f="geojson", with the Sectigo intermediate cert injected.
---> 15 peilafw = nlmod.read.waterboard.download_data(
16 "Hollands Noorderkwartier",
17 "level_deviations",
18 extent=extent,
File ~\AppData\Roaming\Python\Python312\site-packages\nlmod\cache.py:485, in cache_pickle..decorator(cachedir, cachename, *args, **kwargs)
482 return cached_pklz
484 # create cache
--> 485 result = func(*args, **kwargs)
486 msg = f"caching data -> {cachename}"
487 logger.info(msg)
File ~\AppData\Roaming\Python\Python312\site-packages\nlmod\read\waterboard.py:725, in download_data(wb, data_kind, extent, max_record_count, config, **kwargs)
723 # % download and plot data
724 if server_kind == "arcrest":
--> 725 gdf = webservices.arcrest(
726 url,
727 layer,
...
200 message = data["error"]["message"]
--> 201 raise (ValueError(f"Error code {code}: {message}"))
202 return data
ValueError: Error code 400: Unable to complete operation.
The URL to Peilafwijking_gebied is empty or broken :(
Issue checklist
Hello! I have an error 400 when trying to retrieve data from HHNK:
i get this error
ValueError Traceback (most recent call last)
Cell In[7], line 15
11
12 # nlmod uses: arcrest call to
13 # https://kaarten.hhnk.nl/arcgis/rest/services/NHFLO/Peilafwijking_gebied/MapServer
14 # layer 0 (default), f="geojson", with the Sectigo intermediate cert injected.
---> 15 peilafw = nlmod.read.waterboard.download_data(
16 "Hollands Noorderkwartier",
17 "level_deviations",
18 extent=extent,
File ~\AppData\Roaming\Python\Python312\site-packages\nlmod\cache.py:485, in cache_pickle..decorator(cachedir, cachename, *args, **kwargs)
482 return cached_pklz
484 # create cache
--> 485 result = func(*args, **kwargs)
486 msg = f"caching data -> {cachename}"
487 logger.info(msg)
File ~\AppData\Roaming\Python\Python312\site-packages\nlmod\read\waterboard.py:725, in download_data(wb, data_kind, extent, max_record_count, config, **kwargs)
723 # % download and plot data
724 if server_kind == "arcrest":
--> 725 gdf = webservices.arcrest(
726 url,
727 layer,
...
200 message = data["error"]["message"]
--> 201 raise (ValueError(f"Error code {code}: {message}"))
202 return data
ValueError: Error code 400: Unable to complete operation.
The URL to Peilafwijking_gebied is empty or broken :(
Issue checklist