Please consider responding to a brief user needs survey.

Some debugging in functions. Clean up and add prepper.ipynb.

parent c97aa7e0
......@@ -611,6 +611,8 @@ def CreateShoreBetweenInlets(shore_delineator: str, inletLines: str,
Used to produce shoreline points and measure distance to inlet."""
# initialize temp layer names
split = os.path.join(arcpy.env.scratchGDB, 'shoreline_split')
if arcpy.Exists(split):
split = os.path.join(arcpy.env.scratchGDB, 'shoreline_split2')
# Ready layers for processing
DeleteExtraFields(inletLines)
DeleteExtraFields(shore_delineator)
......@@ -626,12 +628,14 @@ def CreateShoreBetweenInlets(shore_delineator: str, inletLines: str,
arcpy.Merge_management([line_temp,inletLines],shore_delineator)
arcpy.ExtendLine_edit(shore_delineator,'500 Meters')
# Eliminate extra lines, e.g. bayside, based on presence of SHLpts
if verbose:
print("Splitting {} at inlets...".format(os.path.basename(shore_delineator)))
arcpy.Delete_management(split) # delete if already exists
if len(SA_bounds) > 0:
if verbose:
print("Splitting {} at inlets and study area bounds...".format(os.path.basename(shore_delineator)))
arcpy.FeatureToLine_management([shore_delineator, inletLines, SA_bounds], split)
else:
if verbose:
print("Splitting {} at inlets...".format(os.path.basename(shore_delineator)))
arcpy.FeatureToLine_management([shore_delineator, inletLines], split)
# Delete any lines that are not intersected by a shoreline point.
if verbose:
......@@ -1454,7 +1458,11 @@ def JoinDFtoRaster(df, rst_ID, out_rst='', fill=-99999, id_fld='sort_ID', val_fl
trans_tbl = os.path.basename(out_rst)+'_tbl'
tbl_path = DFtoTable(df, trans_tbl)
# Join field to raster and save as out_rst
arcpy.CopyRaster_management(rst_ID, out_rst)
try:
arcpy.CopyRaster_management(rst_ID, out_rst)
except:
out_rst = out_rst+'_try2'
arcpy.CopyRaster_management(rst_ID, out_rst)
arcpy.management.JoinField(out_rst, "Value", tbl_path, id_fld, val_fld)
print('OUTPUT: {}. Field "Value" is ID and "uBW" is beachwidth.'.format(os.path.basename(out_rst)))
return(out_rst)
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment