From 71931d387b5f97c81eda7bd5178792a80340aea0 Mon Sep 17 00:00:00 2001 From: Sharon Fitzpatrick Date: Mon, 2 Dec 2024 15:30:31 -0800 Subject: [PATCH] if the transect has an id column already convert it to a string --- src/coastseg/transects.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/coastseg/transects.py b/src/coastseg/transects.py index b7a1b01d..6d6f6da6 100644 --- a/src/coastseg/transects.py +++ b/src/coastseg/transects.py @@ -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):