Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Projection issue in backgroundmaps #240 #241

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -87,7 +87,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