Skip to content

Commit d4a1d7d

Browse files
fix: enforce str type
1 parent bf0ab2d commit d4a1d7d

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

m2l/processing/algorithms/extract_basal_contacts.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
# Internal imports
2929
from ...main.vectorLayerWrapper import qgsLayerToGeoDataFrame, GeoDataFrameToQgsLayer
3030
from map2loop.contact_extractor import ContactExtractor
31-
from ...main.vectorLayerWrapper import qgsLayerToGeoDataFrame, GeoDataFrameToQgsLayer
32-
from map2loop.contact_extractor import ContactExtractor
3331

3432

3533
class BasalContactsAlgorithm(QgsProcessingAlgorithm):
@@ -112,15 +110,16 @@ def processAlgorithm(
112110
geology = self.parameterAsVectorLayer(parameters, self.INPUT_GEOLOGY, context)
113111
faults = self.parameterAsVectorLayer(parameters, self.INPUT_FAULTS, context)
114112
strati_column = self.parameterAsString(parameters, self.INPUT_STRATI_COLUMN, context)
115-
113+
116114
if strati_column and strati_column.strip():
117115
strati_column = [unit.strip() for unit in strati_column.split(',')]
118116

119117
unit_name_field = self.parameterAsString(parameters, 'UNIT_NAME_FIELD', context)
120118

121119
geology = qgsLayerToGeoDataFrame(geology)
120+
geology['UNITNAME'] = geology['UNITNAME'].astype(str)
121+
122122
faults = qgsLayerToGeoDataFrame(faults) if faults else None
123-
124123
if unit_name_field != 'UNITNAME' and unit_name_field in geology.columns:
125124
geology = geology.rename(columns={unit_name_field: 'UNITNAME'})
126125

0 commit comments

Comments
 (0)