Why does Raster Calculator (RasterCalculator_sa) give ERROR 000539 in ArcPy?
I am getting a not executed error for a raster calculator. Here is part of the output: File “C:projectTempFloodAnalysisfloodxsectionanalysis.py”, line 107, in makeSeemless...
View ArticleFind and Replace python script to replaces values in attribute table?...
This question already has an answer here: Accessing attribute table within shapefile and replace values? 3 answers
View ArticleImport addresses from an Excel file via Python for route optimisation
relative newbie here. Apologies if this is very obvious or basic! I have created a route optimisation model through ArcGIS modelbuilder, then exported the Python script. Within the model I had a...
View ArticleExport attributes of shapefiles into text file
I’m trying to export attributes of multiple shapefiles a text file. I am multiple getting errors when I run my code not sure what the issue is. Any direction as to where to start to fix this would be...
View ArticleSetting Two Definition Queries as Parameters in Python Script tool causes:...
I created a script that adds definition queries to every layer in an mxd depending on the layer name. This worked fine as a stand alone script, but when I try to use it as a script tool with...
View ArticleUsing layer file to apply symbology to shapefile with ArcPy?
I have code that doesn’t work at the moment: # Import arcpy module import arcpy # Script arguments Input = arcpy.GetParameterAsText(0) if Input == '#' or not Input: Input = "frame" # provide a default...
View ArticleError 999999 “The table already exists”“No spatial reference exists” when...
I’m hoping someone can help me understand why I’m getting this error. I have a python script tool that throws this error when it is run through the task scheduler: Traceback (most recent call last):...
View ArticleCounting Features to Calculate Field Value
Generally, I am trying to find the # of features in one shapefile within 1000 feet of EACH feature in a second shapefile – and then populate a field in the first shapefile with that #. More...
View ArticleError 010240 when calculating mean of a list of rasters – Cell Statistics
I’m trying to calulate the mean value of a list of rasters but I am always getting the following error: RuntimeError: ERROR 010240: Could not save raster dataset to < value > with output format...
View ArticleCan you access all tools in python/arcpy regardless of license level?
Is it possible to write a python script using arcpy that is for a tool not included in the current desktop license level? For example, write something using the Identity Tool when you only have a...
View ArticlePython Script to batch compress .tif files using LZW compression
I am currently trying to batch compress a folder of .tif files using LZW compression in order to free up storage space. I’ve been using this script in ArcMap’s python window, adapted from here: #...
View ArticleTrying to re-project a folder of shapefiles using Python Script
I am trying to reproject multiple shapefiles in a folder. When I run my program this is the error I am getting: line 8221, in Project raise e ExecuteError: Failed to execute. Parameters are not valid....
View ArticleDissolving features by attribute(s)
How to apply ‘statistic_field’ to just one ‘dissolve_field’? I have a feature class that I need to dissolve by PageName but also by earliest year in SERVED_YEAR. So, how to apply MIN to SERVED _YEAR...
View ArticleWhy is Update Cursor adding Object IDs incorrectly?
I am using an update cursor to add values in a try:except block of code using ArcPy. If the code is successful I log yes in the success field, if it reaches the except block I log yes in the fail...
View ArticleScripting spatial join in arcpy – how to set field attribute in field mapping...
I’m scripting a spatial join in ArcGIS with Python. I only want the resultant feature class to have a single field containing one attribute from the join features. In general, many join features...
View ArticleUnable to connect to “Database Connections/.sde” from python
I just upgraded to 10.3.1 and now I am having issues running my administrative tasks set with Python scripts. I am unable to use the string “Database Connections/some.sde”, i.e:...
View ArticlePython error in Con function
I am trying to add two different rasters using the Con function. I am iterating the raster layer using the for loop to obtain two rasters belonging to the same species and their formats are in grid and...
View ArticleReversing polyline direction based on raster value using ArcPy?
I am trying to create an ArcPy script that will read a raster cell value at the start point and end point of a polyline, and flip the line based on those values. I do not want to create another feature...
View ArticleIs there a quick way to see the fields in a table via arcpy?
I frequently find myself in Python debug mode, trying to examine the fields of a layer or table. arcpy.Describe(lyr).fields returns an array of <geoprocessing describe field object> which isn’t...
View ArticleError 010092 for FeatureToRaster in Pythonwin
would someone be able to help me with this problem. As shown the process works for three files (of approx 1000) and then throw the Error 010092: Invalid Output Extent. All the files have been processed...
View Article