From c3fca1419454d34221fea6dbc9471ac398d03199 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Mon, 27 Mar 2023 15:08:49 +1300 Subject: [PATCH] Use rio.set_crs instead of rio.write_crs So that the `spatial_ref` CF coordinate won't be set, which would result in an int32 variable on Windows but int64 on Linux/macOS. --- pygmt/datasets/tile_map.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pygmt/datasets/tile_map.py b/pygmt/datasets/tile_map.py index 92bfe07bda3..fd5268a408a 100644 --- a/pygmt/datasets/tile_map.py +++ b/pygmt/datasets/tile_map.py @@ -106,7 +106,6 @@ def load_tile_map(region, zoom="auto", source=None, lonlat=True, wait=0, max_ret * band (band) uint8 0 1 2 * y (y) float64 -7.081e-10 -7.858e+04 ... -1.996e+07 ... * x (x) float64 -2.004e+07 -1.996e+07 ... 1.996e+07 2.004e+07 - spatial_ref int64 0 """ # pylint: disable=too-many-locals if contextily is None: @@ -148,6 +147,6 @@ def load_tile_map(region, zoom="auto", source=None, lonlat=True, wait=0, max_ret # If rioxarray is installed, set the coordinate reference system if hasattr(dataarray, "rio"): - dataarray = dataarray.rio.write_crs(input_crs="EPSG:3857") + dataarray = dataarray.rio.set_crs(input_crs="EPSG:3857") return dataarray