Skip to content

Commit 9045f46

Browse files
authored
GeoPandas: Explicitly convert columns with overflow integers avoid OverflowError with fiona 1.10 (#3455)
1 parent 838b0e1 commit 9045f46

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pygmt/helpers/tempfile.py

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def tempfile_from_geojson(geojson):
153153
if dtype in {"int", "int64"}:
154154
overflow = geojson[col].abs().max() > 2**31 - 1
155155
schema["properties"][col] = "float" if overflow else "int32"
156+
geojson[col] = geojson[col].astype(schema["properties"][col])
156157
ogrgmt_kwargs["schema"] = schema
157158
else: # GeoPandas v1.x.
158159
# The default engine "pyogrio" doesn't support the 'schema' parameter

0 commit comments

Comments
 (0)