Tagged Questions
1
vote
1answer
19 views
Python Toolbox (.pyt) Tool Output Layer Name
How can I manipulate the TOC display name of my output parameters when using a Python toolbox (.pyt) Tool class. I tried adding a symbology layer, however this has no affect on the TOC name. Is it ...
2
votes
1answer
32 views
forLoop & joinField & different names
I have a folder with an output (shapefiles) from an iteration. On this output, I want to perform a join between two attributetables.
So far so good. Here comes the tricky part.
There are different ...
1
vote
1answer
30 views
How can I do a definition query on a layer and zoom to it?
I am trying to do definition query to a layer and to zoom to the same layer, but I got an error ("SyntaxError: can't assign to operator") ??
dataFrame = arcpy.mapping.ListDataFrames(mxd)[0] # the ...
0
votes
1answer
37 views
Definition Query then Zoom to Layer Automation?
I'm trying to create something in here. I want to have an automated process of doing a DEFINITION QUERY then ZOOM TO LAYER with one step.
the concept is like that, a dialog comes up with one form ...
-1
votes
0answers
25 views
Error 0100060 while running Extract by Points?
The resources have not been much help here. I can run this same process hardcoded in the IDE, however through the tool dialogue it gives the following error? Any thoughts?
ExecuteError: ERROR ...
1
vote
1answer
39 views
how to separate a list of features from its shapefile_
I tried to copy all features in a list of dictionaries. the code looks as follows:
def iterate_features(self):
feature_set = arcpy.SearchCursor(self.address)
for feature in feature_set:
...
0
votes
0answers
36 views
Create polygon with mouse clicks using Python Add-in [closed]
I would like to create a polygon with mouse clicks on ArcMap. I know nothing about ArcPy and it's very difficult for me to find the good fonction to do that. I guess I should use onMouseDownMap() but ...
0
votes
3answers
59 views
UpdateCursor 'is not defined' Python
I have several files (shapefiles). Table 1 has only one row with several fields whereas Table 2 has several rows.
What I want is to take a value from Table 1 and populate all rows in Table 2. I used a ...
2
votes
1answer
55 views
What are resources to learn ArcGIS for someone who already knew Python [closed]
I know that there are several resources recommendation questions, however, they are all from GIS people trying to learn Python (for example, here).
My situation is the opposite: I have worked ...
0
votes
1answer
31 views
Adding field to table without path to table (python) [closed]
I want to add a field to my table in the FieldCalculator.
import arcpy
arcpy.AddField_management("veg8", "test", "TEXT")
An error message occured doing this and I figured out that I need to set a ...
1
vote
1answer
59 views
Arcpy: List to point feature class
I have a list of lists that contains:
[vala, valb, valc, vald, (pntx, pnty)]
[vala, valb, valc, vald, (pntx, pnty)]
[vala, valb, valc, vald, (pntx, pnty)]
I also have a list of the field names that ...
1
vote
2answers
38 views
Set parameter of field from number to string with python
since I realised python is a very useful tool in ArcMap I dont want to do any workarounds anymore.
I have a field with is numeric, but I want to perform this calculation in the field calculator on it
...
5
votes
1answer
138 views
Is there a way to use ArcPy module in the python shell that is not with ArcGIS?
I have ArcGIS 10.2 installed on my machine. When ArcGIS was installed, python 2.7.3(32 bits) was also installed. I need python 2.7.5 64bits for some gdal functions. So I installed python 2.7.5 64bits ...
1
vote
3answers
77 views
Merging many to one data rows in arcpy [duplicate]
The dataset 'left_right_merge' at the bottom of my screen shot shows the dataset that I'm currently working with. The NODE values indicate a single point feature, but is duplicated with many ...
1
vote
1answer
75 views
Creating a Simple Join Script in Python
I'm trying to create a simple join script in python from an arcgis model, where the only steps are joining a map to a table to produce a map with the table's properties. The attributes joined ...
0
votes
1answer
65 views
using Z and M feature geometry to create line graph in Python?
I am a Python (v2.6.5) noob trying to plot a series of 3D polylines into graphs. So far I've come up with:
# Import system modules
import arcpy, os, sys, string
from arcpy import env
...
0
votes
1answer
41 views
Updating records based on value in another field using arcpy.da.UpdateCursor?
I am trying to write file names and paths to two separate fields in a feature class, and the value for each record is dependent on finding a match in a list. When I run my code it writes the same ...
3
votes
2answers
62 views
Efficient way to use a CSV to Define a Feature Class
I was provided an Excel Spreadsheet which had the definitions of fields for a feature class. There were several worksheets in the file, each containing field definitions for different feature ...
1
vote
0answers
53 views
Writing values to feature class in Python script results in strange characters"? [closed]
The script below does a series of things, and towards the end it is supposed to write values pulled from a list to a new field, if the feature class name is found anywhere in a list element. It does ...
2
votes
1answer
86 views
Merge from arcpy.ListTables() producing duplicate rows?
I was trying to manually merge file geodatabase tables and was getting Null values for the output file rows and decided to write a python script to merge the files. Here's my script: import arcpy
...
0
votes
0answers
26 views
How can I define coordinate system of feature class when overlaying with coordinate zone shapes in python?
I have generated bounding boxes for CAD drawings that do not have defined coordinate system files. I know that each drawing could be in one of 6 different systems that do not overlap. My idea was to ...
0
votes
1answer
42 views
Using os.walk to update broken links and save mxd
I've got code to walk through an entire directory and sub-directories repair broken links in each mxd and save the mxd. It works for the mxd's in the top directory but fails when trying to enter any ...
2
votes
0answers
36 views
how to make a list of features constructing the dissolved feature?
I need to simplify my road network using the dissolve function to remove nodes not occurring on the intersections. the following code is doing that.
arcpy.Dissolve_management(self.address_cor_layer2, ...
1
vote
2answers
34 views
finding the index of a field with its name using arcpy
I wan to extract the index of a field with its name using arcpy. it seems what I have written is so dumb. is there any simpler method with out using for-loop.
import arcpy
fieldList = ...
2
votes
2answers
100 views
Convert a Toolbox (.TBX) to a Python script (.PY)?
I have a .tbx tool box, which runs a script that is incredibly slow.
So what I want to do is to open the python script that is running below the .tbx and make some changes or perhaps write something ...
1
vote
2answers
67 views
Open source, Python option for Arcpy's Con tool?
I'm wondering if there is a method to perform a function similar to Arc's Con tool, using open source options in python. I have two rasters, one that shows locations of clouds and the other is just a ...
1
vote
1answer
50 views
how to assign keyboard key to python script in arcmap
I have a python script and I use it through my toolbox but I use it many times in a day.
Is it possible to assign a keyboard shortcut to my tool ?
1
vote
1answer
216 views
How to Properly Loop Through a List With a Cursor?
My team is working on a python script that does various updating tasks to our streets file. A part we are getting stuck on is trying to update a field.
Currently we have a field FEDROUTE that is ...
1
vote
1answer
50 views
Locating 0-points multipart polygons using arcpy
By Running this piece of code:
import arcpy
arcpy.env.workspace = "C:\working\GEODATABASES\\tests.gdb"
fcList = arcpy.ListFeatureClasses()
for fc in fcList:
with arcpy.da.SearchCursor(fc, ...
0
votes
3answers
93 views
Using ArcPy and Python to export Table View as PDF format?
I am using ArcPy to select from a layer and display the result on map as a table view.
Now I want to export the table view as a PDF format.
Anybody know about it?
If it is beyond ArcPy to export ...
1
vote
2answers
46 views
Issues Reading a table from Geodatabase
I have scripted a process to read a CSV file into a file geodatabase. Then, I want to read this imported file and work on it by adding new fields and calculating values. However, while using the ...
3
votes
1answer
51 views
Python MemoryError when running ArcGIS Python Toolbox tool
I have a Python Toolbox (.pyt) containing a single tool. Part of that tool is the following function, which creates a dictionary from an attribute table, where the keys are the rows' OBJECTIDs and the ...
3
votes
2answers
118 views
How do I know if I am running 64-bit background geoprocessing on ArcMap 10.2?
I'm running ArcMap 10.2 and just set up 'ArcGIS for Desktop Background Geoprocessing (64 bit)' and now I have both the ArcGIS10.2 folder and ArcGISx6410.2 folder inside my python folder. I have ...
0
votes
1answer
64 views
Iterative raster calculation script using NumPy arrays breaks after ~10 rasters, returns: “TypeError: Cannot create raster for numpy array.”
Here is my code:
#Generate Cumulative Thresholds
#5/15/14
import os
import glob
import arcpy
import numpy as np
#Enable overwriting output data
arcpy.env.overwriteOutput = True
...
1
vote
1answer
56 views
Raster calculation in for loop returning exit code -1
I've put together a python script that does some calculations on rasters by converting them to NumPy arrays, doing the math, then converting them back to Raster and applying all the same spatial ...
0
votes
1answer
94 views
ArcGIS 10.2.1 Table To Table tool in Python script gives ExecuteError: ERROR 001156?
I work for an organization that just upgraded from esri arcmap 9.3.1 to 10.2.1 and I'm currently in the process of updating the python scripts. When running a script I'm getting hung up on a portion ...
0
votes
0answers
23 views
Using GDAL and Python to replace the Spatial Analyst TabulateArea method
Has anyone tried to phase out the use of ESRI's Spatial Analyst extension by replacing it with GDAL in Python? I have a script that only uses the TabulateArea and Statistics analysis but not much else ...
4
votes
2answers
158 views
Is it a bad idea to convert a File Geodatabase table to a dictionary?
First, what am I trying to do?
I am building a Python script that should be called from an ArcMap 10.0 toolbox. This scripts uses (among other inputs) data contained in huge gdb tables. It processes ...
2
votes
0answers
117 views
Running x64 bit geoprocessing Python in Python IDLE 2.7.6 x64 error
I am trying to set the Python IDLE 2.7.6 x64 to run the arcpy module from ArcGIS x64 bit geoprocessing (10.2.2). I copied the file DTBGGP64.pth from C:\Python27\ArcGISx6410.2\Lib\site-packages to ...
3
votes
0answers
46 views
Arcpy in Python Plugin for SPSS
Is it possible to run the arcpy module in the Python for SPSS plugin to run the search and update cursors?
2
votes
0answers
209 views
Split a Polygon that Crosses International Date Line, ArcPy [closed]
I have a lots of existing data in WGS-1984 (too much to manually edit). I need to split these lines and polygons by the international date line.
More projection information:
...
0
votes
1answer
82 views
Batch renaming of shapefiles using ArcPy and folder name where shapefile is stored?
I am very new to Python and wondered if anyone had any idea how to do this?
I have ~100+ shapefiles named 'land boundary' within the folder of their site name.
Is this possible using Python in ...
2
votes
1answer
49 views
ArcGIS Toolbox, parameters for python script not as positional arguments
I have an ArcGIS Toolbox with a bunch of parameters. A python script is used to perform some raster operations, based on this parameters. I am using Python argparse in the script to get the ...
0
votes
0answers
29 views
when using arcpy.mapping.ListDataFrames, python.exe crash
Has anybody had this problem? this drive me crazy. what is wrong with my code?
import arcpy
mxd = arcpy.mapping.MapDocument(r"D:\Project\Project.mxd")
df = arcpy.mapping.ListDataFrames(mxd, ...
0
votes
1answer
61 views
How to select a feature and get its fields by mouse click using Python Addin in ArcGIS?
I'm building a python addin tool in arcgis and I would like to click a feature, say a polygon on the map, and get the polygon's attributes,i.e. ID=3,NAME = "CITY3"...It's similar as the arcmap tool ...
0
votes
0answers
18 views
Using file directories from a table
I have a toolset that will be using a set of file directories as input (shapefiles, raster etc.).The table can be stored as CSV or DBF.
Is there a way to read a specific cell (row,column) of the ...
2
votes
1answer
135 views
ESRI File Geodatabase with a field calculator with an incrementing number
I've got a python script that runs on the Field Calculator of a ESRI File Database. Right now it runs correctly in that it will increment the last three digits of the value. But this is a script ...
0
votes
1answer
82 views
How to compare two rasters and reclass the greater value(python script)?
I am working on an assignment that requires us to reclass a raster(via python) from two rasters. We need to compare the power received at one cell(on raster1) and compare it to the same cell on raster ...
2
votes
3answers
139 views
How to extract data using arcpy.da.SearchCursor
I have a shapefile of point features showing fire locations in a given year. One of the fields is named "YYYYMMDD" and indicates the corresponding date that that fire happened. In Python, I am trying ...
1
vote
1answer
49 views
Updating a Tool Validator Class from a CSV File
I have a CSV file which contains a list of clients and different project numbers and project names. This list is generated periodically. The list can contain multiple values for client name but ...