Skip to content

Commit d503268

Browse files
weiji14seisman
andcommitted
Move load_tile_map call out of GMTTempFile context
Co-Authored-By: Dongdong Tian <[email protected]>
1 parent 7efdbfd commit d503268

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

pygmt/src/tilemap.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,16 @@ def tilemap(
120120
"to install the package."
121121
)
122122

123+
raster = load_tile_map(
124+
region=region,
125+
zoom=zoom,
126+
source=source,
127+
lonlat=lonlat,
128+
wait=wait,
129+
max_retries=max_retries,
130+
)
123131
with GMTTempFile(suffix=".tif") as tmpfile:
124-
raster = load_tile_map(
125-
region=region,
126-
zoom=zoom,
127-
source=source,
128-
lonlat=lonlat,
129-
wait=wait,
130-
max_retries=max_retries,
131-
)
132132
raster.rio.to_raster(raster_path=tmpfile.name)
133-
134133
with Session() as lib:
135134
lib.call_module(
136135
module="grdimage", args=build_arg_string(kwargs, infile=tmpfile.name)

0 commit comments

Comments
 (0)