Quantcast
Channel: Question and Answer » arcpy
Browsing all 767 articles
Browse latest View live

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 Article


Find 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 Article


Import 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 Article

Export 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 Article

Image may be NSFW.
Clik here to view.

Setting 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 Article


Using 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 Article

Error 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 Article

Image may be NSFW.
Clik here to view.

Counting 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 Article


Error 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 Article


Can 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 Article

Python 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 Article

Trying 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 Article

Image may be NSFW.
Clik here to view.

Dissolving 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 Article


Image may be NSFW.
Clik here to view.

Why 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 Article

Scripting 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 Article


Unable 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 Article

Python 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 Article


Reversing 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 Article

Is 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 Article

Image may be NSFW.
Clik here to view.

Error 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
Browsing all 767 articles
Browse latest View live