diff --git a/.github/workflows/ci_tests.yaml b/.github/workflows/ci_tests.yaml index 4d7e8b09e8a..afecee674a3 100644 --- a/.github/workflows/ci_tests.yaml +++ b/.github/workflows/ci_tests.yaml @@ -76,7 +76,7 @@ jobs: numpy-version: '1.26' pandas-version: '' xarray-version: '' - optional-packages: ' contextily geopandas ipython pyarrow rioxarray sphinx-gallery' + optional-packages: ' contextily geopandas ipython pyarrow pyogrio rioxarray sphinx-gallery' timeout-minutes: 30 defaults: diff --git a/pygmt/helpers/tempfile.py b/pygmt/helpers/tempfile.py index 3cbb88060df..b59d58a1b32 100644 --- a/pygmt/helpers/tempfile.py +++ b/pygmt/helpers/tempfile.py @@ -154,14 +154,12 @@ def tempfile_from_geojson(geojson): # Other 'geo' formats which implement __geo_interface__ import json - import fiona - - with fiona.Env(): - jsontext = json.dumps(geojson.__geo_interface__) - # Do Input/Output via Fiona virtual memory - with fiona.io.MemoryFile(file_or_bytes=jsontext.encode()) as memfile: - geoseries = gpd.GeoSeries.from_file(filename=memfile) - geoseries.to_file(**ogrgmt_kwargs) + import pyogrio + + jsontext = json.dumps(geojson.__geo_interface__) + # Do Input/Output via Pyogrio (GDAL) virtual memory + geodataframe = pyogrio.read_dataframe(jsontext) + geodataframe.to_file(**ogrgmt_kwargs) yield tmpfile.name