Skip to content

Commit

Permalink
Merge pull request #241 from ArtesiaWater/epsg-28992-issue
Browse files Browse the repository at this point in the history
fix Projection issue in backgroundmaps #240
  • Loading branch information
dbrakenhoff authored Aug 25, 2023
2 parents 8ecca8a + 33d6478 commit c73f524
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nlmod/dims/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from scipy.spatial import cKDTree

from .. import util
from ..epsg28992 import EPSG_28992
from . import resample
from .layers import fill_nan_top_botm_kh_kv, set_idomain

Expand Down Expand Up @@ -490,7 +491,7 @@ def get_ds(
botm=None,
kh=10.0,
kv=1.0,
crs=28992,
crs=EPSG_28992,
xorigin=0.0,
yorigin=0.0,
angrot=0.0,
Expand Down
7 changes: 7 additions & 0 deletions nlmod/epsg28992.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# NOTE: this is the correct epsg:28992 definition for plotting backgroundmaps in RD
EPSG_28992 = (
"+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 "
"+x_0=155000 +y_0=463000 +ellps=bessel "
"+towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m "
"+no_defs"
)
4 changes: 2 additions & 2 deletions nlmod/plot/plotutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from matplotlib.ticker import FuncFormatter, MultipleLocator

from ..dims.resample import get_affine_mod_to_world

from ..epsg28992 import EPSG_28992

def get_patches(ds, rotated=False):
"""Get the matplotlib patches for a vertex grid."""
Expand Down Expand Up @@ -88,7 +88,7 @@ def get_map(
fmt="{:.0f}",
sharex=False,
sharey=True,
crs=28992,
crs=EPSG_28992,
background=False,
alpha=0.5,
tight_layout=True,
Expand Down

0 comments on commit c73f524

Please sign in to comment.