Skip to content

Commit

Permalink
last fixes
Browse files Browse the repository at this point in the history
- comments onno
- new link with info on EPSG 28992
- add trap for duplicate indices in gdf_to_grid (better error message for users)
  • Loading branch information
dbrakenhoff committed Jul 5, 2024
1 parent 31d3c06 commit f8f6953
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions nlmod/dims/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1706,6 +1706,9 @@ def gdf_to_grid(
if ml is None and ix is None:
raise (ValueError("Either specify ml or ix"))

if gdf.index.has_duplicates or gdf.columns.has_duplicates:
raise ValueError("gdf should not have duplicate columns or index.")

if ml is not None:
if isinstance(ml, xr.Dataset):
ds = ml
Expand Down
10 changes: 6 additions & 4 deletions nlmod/epsg28992.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""
NOTE: this is the correct epsg:28992 definition for plotting backgroundmaps in RD
More info (in Dutch) here:
https://qgis.nl/2011/12/05/epsg28992-of-rijksdriehoekstelsel-verschuiving/
This was still a problem in October 2023
NOTE: this is the correct epsg:28992 definition for plotting backgroundmaps in RD.
Related information (in Dutch):
https://geoforum.nl/t/betrouwbare-bron-voor-proj4-definitie-van-rd-new-epsg-28992/5144/15
This was still a problem in July 2024.
"""

EPSG_28992 = (
Expand Down
2 changes: 1 addition & 1 deletion nlmod/plot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
geotop_lithok_in_cross_section,
geotop_lithok_on_map,
map_array,
# modelextent,
modelextent,
modelgrid,
surface_water,
)
Expand Down

0 comments on commit f8f6953

Please sign in to comment.