Skip to content

Commit

Permalink
HHNK revert to old url (#321)
Browse files Browse the repository at this point in the history
* HHNK revert to old url

* Fix failing test (unrelated to other change in this PR)

---------

Co-authored-by: Ruben Caljé <r.calje@artesia-water.nl>
  • Loading branch information
bdestombe and rubencalje authored Jan 30, 2024
1 parent d730e26 commit 904f269
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
12 changes: 11 additions & 1 deletion nlmod/gwf/surface_water.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def get_gdf_stage(gdf, season="winter"):


def download_level_areas(
gdf, extent=None, config=None, raise_exceptions=True, **kwargs
gdf, extent=None, config=None, raise_exceptions=True, drop_duplicates=True, **kwargs
):
"""Download level areas (peilgebieden) of bronhouders.
Expand All @@ -590,6 +590,9 @@ def download_level_areas(
Raises exceptions, mostly caused by a webservice that is offline. When
raise_exceptions is False, the error is raised as a warning. The default is
True.
drop_duplicates : bool, optional
Drop features with a duplicate index, keeping the first occurence. The default
is True.
Returns
-------
Expand All @@ -610,6 +613,13 @@ def download_level_areas(
if len(lawb) == 0:
logger.info(f"No {data_kind} for {wb} found within model area")
continue
if drop_duplicates:
mask = lawb.index.duplicated()
if mask.any():
msg = "Dropping {} level area(s) of {} with duplicate indexes"
logger.warning(msg.format(mask.sum(), wb))
lawb = lawb.loc[~mask]

la[wb] = lawb
mask = ~la[wb].is_valid
if mask.any():
Expand Down
14 changes: 1 addition & 13 deletions nlmod/read/waterboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,7 @@ def get_configuration():
"bottom_height": "WS_BODEMHOOGTE",
},
"level_areas": {
"url": "https://kaarten.hhnk.nl/arcgis/rest/services/ws/ws_peilgebieden_vigerend/MapServer",
"layer": 4,
"table": {
"id": 6,
"SOORTSTREEFPEIL": {
901: "STREEFPEIL_JAARROND", # vast peilbeheer
902: "STREEFPEIL_WINTER",
903: "STREEFPEIL_ZOMER",
904: "STREEFPEIL_JAARROND", # dynamisch peilbeheer
905: "ONDERGRENS_JAARROND",
906: "BOVENGRENS_JAARROND",
},
},
"url": "https://kaarten.hhnk.nl/arcgis/rest/services/NHFLO/Peilgebied_beheerregister/MapServer",
"summer_stage": [
"ZOMER",
"STREEFPEIL_ZOMER",
Expand Down

0 comments on commit 904f269

Please sign in to comment.