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

How to Calculate Field in joined table using ArcPy?

I have to calculate a field based on another field in a joined table, but an error occurs: “Parameters are not valid. ERROR 000728: Field !Table_A.field_A! does not exist within table” My code: import...

View Article


How do I load multiple shapefiles into the same existing feature class?

I have a hundreds of shapefiles and, based on the filename, I need to load it into one of three feature classes (points, polylines, or polygons). My code works until it tries to load the second file of...

View Article


Can we no longer reference an ArcMap layer to get the spatial reference?

I’m currently using ArcGIS 10.2.1. In previous custom geoprocessing tools, I’ve used the following code to create a feature class in-memory, and set the spatial reference using an existing layer in...

View Article

SyntaxError: can't assign to function call, arcpy set parameter as text

I have a python script loaded into arcgis ModelBuilder, and when I run the model I keep getting an error when the script tries to run, at the line where I am setting the output as a text parameter. The...

View Article

Image may be NSFW.
Clik here to view.

How to flip a polyline based on a separate polyline feature class being left...

Can’t go into detail about what these features actually are but I will just refer to them as the green line and the black line. The black lines are not able to ever overlap the blue polygons. Black...

View Article


Why does thumbnail on one MXD not update?”

I want to make modification on multi-mxd properties, I try Arcpy script with a loop like ” for mxd in mxdList:” , but I always have same results, Thumbnails are not created… import arcpy,os dossierRech...

View Article

Image may be NSFW.
Clik here to view.

Eliminate in Arcpy

I am attempting to move away from Coverages. One of the tools we have did a great job of eliminating slivers from our datasets based on hard and soft boundaries for elimination rulesets; howver, it is...

View Article

How to get cell value along Flow Direction

I have: a flow direction raster where I took off (assigned NoData value) the cells that overlayed the river network (from flow accumulation). a perfectly overlapping raster where I asigned a...

View Article


Using Python Script to change Pie Chart Symbology

I am trying to change the symbology for Pie chart in ArcGIS. I have a feature class which is joined to a table and I will like to symbolized as a pie chart. I will be symbolizing it a lot thus I am...

View Article


How to create proprietary tools for ArcGIS?

I want to build a some tools for ArcGIS. Toolboxes that I’ve seen are open source and run the scripts that reside in their src folder. However, I don’t want to release the source code. After some...

View Article

What is the word for “Bar” progress and write it in python script?

I am a beginner in python and have written a few scripts and I am wondering if there is a term for python to call and show the progress of the bar telling you from start to finish like you see in...

View Article

Image may be NSFW.
Clik here to view.

ArcPy QueryPointAndDistance: Incorrect Lengths?

Background: I’m currently trying to determine the chainage (distance m) of my points along a polyline (i.e. proposed railway alignment). A colleague within my firm assisted me with the following script...

View Article

Image may be NSFW.
Clik here to view.

Apply Symbology Layer to a group layers

I have several mxds (located in C:Project ) that have 250 layers each. All the layers as the same name- “plan” and they all in group layers like that (added picture for example): I try to change all...

View Article


GPRecordSet in python toolBox

I would like to use a GPRecordSet in my python toolBox as an output parameter. This geoprocessing will be share on my ArcgGIS server and in my ArcGIS portal. I haven’t see any documentation on how to...

View Article

Image may be NSFW.
Clik here to view.

Field Calculator Python Issues [closed]

How can I adapt the following expression in the ArcGIS field calculator? Below is the python code: import arcpy fc = "2014_2" keyField = "ID_segment" affectedField = "KKN2" maxVal = 2500 cnt = 1 Value...

View Article


Can multiprocessing with arcpy be run in a script tool?

I have been tinkering around with the multiprocessing module to resolve some processing of data in ArcMap 10.3. I have created a script which works fine if I run it in IDLE. I see all my cores max out...

View Article

Inserting row into table and then updating it in sum of each column using ArcPy?

My problem is the following: I have a table with an unknown number of columns (n) Use arcpy.ListFields create a list of columns and generates Field name list Then, using arcpy.da.InsertCursor create a...

View Article


Clipping a Raster into 5×5(25) equal tiles through the use of arcpy?

I am curious to find our if there is a way to create a python code that enables you to clip a raster into equal parts example: 5×5(25) tiles with the use of arcpy? From what I can think of you would...

View Article

Using ArcPy to Read from Excel Spreadsheet to Python Dictionary

How would I go about creating a script that reads a specified excel spreadsheet and places the values in a dictionary? I have read about the xlrd library and how the library in such endeavors to read...

View Article

GetParameterAsText(arcpy) does not work

I am new in this area. I was practicing the function GetParameterAsText(). I know that when you run the code (for example in PythonWin) it works like the function raw_input(), therefore it should show...

View Article
Browsing all 767 articles
Browse latest View live