Skip to content

Commit

Permalink
Force an index name and reset index
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Aug 20, 2023
1 parent 1e05a29 commit 2097add
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pygmt/helpers/tempfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ def tempfile_from_geojson(geojson):
# Map int/int64 to int32 since OGR_GMT only supports 32-bit integer
# https://github.com/geopandas/geopandas/issues/967#issuecomment-842877704
# https://github.com/GenericMappingTools/pygmt/issues/2497
if geojson.index.name is None:
geojson.index.name = "index"
geojson = geojson.reset_index(drop=False)
schema = gpd.io.file.infer_schema(geojson)
for col, dtype in schema["properties"].items():
if dtype in ("int", "int64"):
Expand Down

0 comments on commit 2097add

Please sign in to comment.