Hello,
I’m trying to plot a topographic map using Transverse Mercator projection (with thicks like 420000 → 470000 Easting and 4510000->4535000 North). I’m giving a try with this:
import pygmt
import pyproj
import xarray as xr
region_utm = [420000, 470000, 4510000, 4535000] # [xmin, xmax, ymin, ymax]
utm_proj = pyproj.Proj(proj="utm", zone=33, ellps="WGS84", north=True)
lon_min, lat_min = utm_proj(region_utm[0], region_utm[2], inverse=True)
lon_max, lat_max = utm_proj(region_utm[1], region_utm[3], inverse=True)
region_lonlat = [lon_min, lon_max, lat_min, lat_max]
grid_geo = pygmt.datasets.load_earth_relief(resolution="03s", region=region_lonlat)
grid_utm = pygmt.grdproject(grid=grid_geo, projection="EPSG:32633")
grid_utm = pygmt.grdcut(grid=grid_utm, region=region_utm)
fig = pygmt.Figure()
fig.grdimage(
grid=grid_utm,
region=region_utm,
projection="X15c/10c",
shading=True,
cmap="gray",
frame=["xaf", "yaf"]
)
# coastlines (same UTM region)
fig.coast(
region=region_utm,
shorelines=True,
water="lightblue",
resolution="f",
frame=["xaf", "yaf"]
)
fig.show()
However, it is not working. I get this:
pygmt.exceptions.GMTCLibError: Module 'coast' failed with status code 74:
coast [ERROR]: Map region exceeds 360 degrees
coast [ERROR]: General map projection error
So, the coast module does not work in this case (if I comment the coast module lines, the plot works!).
I would appreciate your support with this issue.
Thanks


