Skip to content

Commit

Permalink
Use rio.set_crs instead of rio.write_crs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
weiji14 committed Mar 27, 2023
1 parent e22d012 commit c3fca14
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pygmt/datasets/tile_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit c3fca14

Please sign in to comment.