Make all paths absolute for arcpy

etta-drone
Dan Howe 6 years ago
parent 0df7891213
commit be74d92c92

@ -39,7 +39,7 @@ def parse_yaml(yaml_name):
params = {}
for line in yaml.split('\n'):
if line:
key, val = line.split(':')
key, val = line.split(':', 1)
params[key] = val.strip()
return params
@ -50,15 +50,15 @@ def process(yaml_name):
beach = params['BEACH']
base_name = os.path.splitext(os.path.basename(params['INPUT LAS']))[0]
# Set all paths relative to current script location
input_tif_dir = params['TIF DEM FOLDER']
mxd_name = params['MAP DOCUMENT']
symb_lyr_name = params['SYMBOLOGY LAYER']
clip_poly = params['HEATMAP CROP POLY']
output_tif_dir = params['TIF HEATMAP FOLDER']
previous_date = params['PREVIOUS SURVEY DATE']
# Make all input and output paths absolute
mxd_name = os.path.abspath(params['MAP DOCUMENT'])
clip_poly = os.path.abspath(params['HEATMAP CROP POLY'])
symb_lyr_name = os.path.abspath(params['SYMBOLOGY LAYER'])
input_tif_dir = os.path.abspath(params['TIF DEM FOLDER'])
output_tif_dir = os.path.abspath(params['TIF HEATMAP FOLDER'])
# Check if previous survey date was provided
previous_date = params['PREVIOUS SURVEY DATE']
try:
int(previous_date)
except ValueError:

Loading…
Cancel
Save