Skip to content

Commit

Permalink
GeoPandas: Explicitly convert columns with overflow integers avoid Ov…
Browse files Browse the repository at this point in the history
…erflowError with fiona 1.10 (#3455)
  • Loading branch information
seisman authored Sep 26, 2024
1 parent 838b0e1 commit 9045f46
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pygmt/helpers/tempfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def tempfile_from_geojson(geojson):
if dtype in {"int", "int64"}:
overflow = geojson[col].abs().max() > 2**31 - 1
schema["properties"][col] = "float" if overflow else "int32"
geojson[col] = geojson[col].astype(schema["properties"][col])
ogrgmt_kwargs["schema"] = schema
else: # GeoPandas v1.x.
# The default engine "pyogrio" doesn't support the 'schema' parameter
Expand Down

0 comments on commit 9045f46

Please sign in to comment.