Skip to content

Commit

Permalink
if the transect has an id column already convert it to a string
Browse files Browse the repository at this point in the history
  • Loading branch information
2320sharon committed Dec 2, 2024
1 parent f414db4 commit 71931d3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/coastseg/transects.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ def initialize_transects_with_transects(self, transects: gpd.GeoDataFrame):
)
# if not all the ids in transects are unique then create unique ids
transects = create_unique_ids(transects, prefix_length=3)
# if an id column exists then make sure it is a string
if "id" in transects.columns:
transects["id"] = transects["id"].astype(str)
self.gdf = transects

def initialize_transects_with_bbox(self, bbox: gpd.GeoDataFrame):
Expand Down

0 comments on commit 71931d3

Please sign in to comment.