3

You need to get rid of the directory as well as the file extension. import os import arcpy import pandas as pd filein = [ r'D:\mypath\test1.shp', r'D:\mypath\test2.shp', ] for f in filein: fout = os.path.splitext(os.path.basename(f))[0] #<=== strip file extension and path TempTab = 'in_memory\\{}_Table'.format(fout) arcpy....


2

cvr_rasters will be a list of only raster names with no path/workspace. When you change workspace after it is created the rasters will not be found. Try adding path to each raster: ... arcpy.env.workspace = CVR cvr_rasters = arcpy.ListRasters() cvr_rasters = [os.path.join(CVR, r) for r in cvr_rasters] ... Same goes for lss_rasters since you change ...


2

Use arcpy.Clip_management() to clip a raster, not arcpy.Clip_analysis() which is for clipping a vector feature class. See: Clip (vector) documentation and: Clip (raster) documentation


2

Looks like it is having trouble finding the files. I use double backslash to get to my files. "C:\\ArcMap\\Res_Boulder.gdb\\Subject" See this reference which shows the valid and invalid path options https://pro.arcgis.com/en/pro-app/arcpy/get-started/setting-paths-to-data.htm


2

The problem is that CON is a Windows reserved word. From docs.microsoft.com: Do not use the following reserved names for the name of a file: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed immediately by an extension. If you must ...


2

Just glancing at this, it looks like you have escaped only half of your backslashes? D:\\Buildings\\Gemeinden\8537\8537_Change_Detection_TLM_LAZ_pre.shp' I would suggest trying a real string, escaping all the back slashes, or using forward slashes. reference: https://pro.arcgis.com/en/pro-app/arcpy/get-started/setting-paths-to-data.htm


1

There's no need to convert to a string, you can directly supply a tuple or list as the argument. From the examples: import arcpy arcpy.env.workspace = "C:/data" arcpy.Merge_management(["majorrds.shp", "Habitat_Analysis.gdb/futrds"], "C:/output/Output.gdb/allroads")


1

When you do arcpy.env.workspace = SSPF_1_workspace SSPF_1_List = arcpy.ListFeatureClasses() SPF_2_workspace = r"D:\GIS\Python\Track No items in SSPF_1_List will be found when spatial joining since you changed workspace after it was created and arcpy will only look for them in the last specified workspace. Try: import os arcpy.env.workspace = ...


1

ListFeatureClasses doesn't return the full path to the feature class. It only returns the name. Then, within the outer loop, you change workspaces. So, in your call of Erase, you're passing G:/Files/Areas/[fc] instead of then intended G:/Files/Watersheds/[fc]. To resolve this, where you iterate over the feature classes in "in_cover", use a list ...


1

Ok, thanks to Vince and ahmadhanb for the guidance. I was convinced the issue was with my lack of my python skills but I went back to square one and looked at my data after and found the first row of my CSV was 'pathname' and was the cause of the error.


1

I think to make your script work you should: remove all the arcpy.Raster() calls # Set names for optional output rasters, seems not working??? outDirectRad = arcpy.Raster(outNameDirect) outDiffuseRad = arcpy.Raster(outNameDiff) outDirectDur = arcpy.Raster(outNameDirDur) change the call to arcpy.sa.AreaSolarRadiation like this: # Execute ...


Only top voted, non community-wiki answers of a minimum length are eligible