From d460d9f2bf577040238f4230c0281722bb8580f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Gallego=20Jim=C3=A9nez?= <91949040+AlbertGallegoJimenez@users.noreply.github.com> Date: Fri, 15 Dec 2023 12:23:49 +0100 Subject: [PATCH] small changes when the intersection points features are created --- src/tools/computeIntersections.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/tools/computeIntersections.py b/src/tools/computeIntersections.py index 613c359..9f14178 100644 --- a/src/tools/computeIntersections.py +++ b/src/tools/computeIntersections.py @@ -111,9 +111,11 @@ def execute(self, parameters, messages): # == 1. Baseline Intersection Points == basePoints = intersect_baseline(transectsShapely, baseShapely) # Create an empty Feature Class with empty field - arcpy.management.CreateFeatureclass("", - baseOutFeature, - "POINT", + if arcpy.Exists(baseOutFeature): + arcpy.Delete_management(baseOutFeature) + + arcpy.management.CreateFeatureclass(out_name=baseOutFeature, + geometry_type="POINT", spatial_reference=sr) arcpy.management.AddField(baseOutFeature, transectsID, 'SHORT') @@ -132,9 +134,10 @@ def execute(self, parameters, messages): # == 2. Shoreline Intersection Points == shorePoints = intersect_shorelines(transectsShapely, shoreShapely) # Create an empty Feature Class with empty fields - arcpy.management.CreateFeatureclass("", - shoreOutFeature, - "POINT", + if arcpy.Exists(shoreOutFeature): + arcpy.Delete_management(shoreOutFeature) + arcpy.management.CreateFeatureclass(out_name=shoreOutFeature, + geometry_type="POINT", spatial_reference=sr) arcpy.management.AddField(shoreOutFeature, transectsID, 'SHORT') arcpy.management.AddField(shoreOutFeature, shoreID, 'SHORT')