A site-package created by Esri to expose ArcObjects to Python.

learn more… | top users | synonyms (1)

2
votes
4answers
92 views

How to get values of last row in table with ArcPy/SearchCursor?

I would like to base my query on the last row of a table? I know the basic syntax/functionality for my search cursor, how do I query only the last row; Below is an example of my search criteria, ...
1
vote
0answers
20 views

Are there any conditions that could break the creation of an arcpy.Polygon object?

I have a script that generates a mesh network from vertex and centroid inputs, and it works for almost all my points. But for some records that get created in the feature class via the script, their ...
0
votes
0answers
11 views

Using ArcPy update cursor to update overlapping feature values?

I have a Geodatabase in ArcGIS 10.2 and would like to update the blank values in the 'Soils' field from the 'Landuse' Feature Class in the 'soils' Feature Class where the 'SoilType' falls within ...
8
votes
3answers
1k views

How to get full path of layer selected in drop-down box for ArcGIS Python tool

I have a Python script-based tool in ArcGIS. One of the parameters for the tool is an input raster file, which I've set (using the properties of the tool within the toolbox) to be a Raster Layer. This ...
2
votes
2answers
282 views

Weird File Path Returning from Print Statement Causing ERROR 000732

I have created a python script in ArcGIS 10.1. My first parameter type is a 'Feature Layer' set to as a multivalue input. I was running my script quite well off of data from one of my drives (my ...
1
vote
1answer
15 views

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 ...
0
votes
0answers
12 views

Error 999999 “The table already exists” “No spatial reference exists” when using “import arcserver”

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 ...
4
votes
1answer
4k views

How to add field in attribute table using ArcPy?

I have researched How to add attribute field to existing Shapefile via Python without ArcGIS? but could not implement it. Can give me examples of how to add field name in attribute table? I have ...
8
votes
3answers
10k views

How to create shapefile from lat/long values using ArcPy?

How can I create a shapefile using Python in ArcGIS 10? I have lat & long. From this I need Python code which will create a shapefile in ArcGIS Desktop 10.
1
vote
1answer
51 views

why does my script not save a layer when it encounters a “ \” character in the string

i have some code that takes a field and finds every unique value in that field. it then creates a layer for each unique value. The code is working ok , but it is failing when there are \ characters ...
0
votes
0answers
50 views

Not matching schema problems when appending a list of CSV's into an existing FGDB table

So far I have the following code for creating the FGDB table and defining fields which works just fine. But when I try to append a list of csv's to this table I always get a matching schema error. Do ...
1
vote
1answer
264 views

Database Connections folder is empty when viewed with ArcGIS tool

I'm trying to create an ArcGIS tool which accepts an SDE connection file as an input. I made a new interface with an input parameter and set the type to Database Connections. When I open the tool and ...
1
vote
1answer
12 views

Most efficient way to retrieve pixel distributions inside many polygones (custom zonal stats)

I want to get the distribution of pixels from a 1 band raster that fall in each polygon of a shapefile to proceed to some statistics. I guess a zonal statistics does it in some kind of way but I need ...
0
votes
0answers
21 views

Wrap Legend Text in ArcMap using Python

Is it possible to use Python to wrap text in a legend in ArcMap so that the entire legend element will fit on a page? Here's a screenshot of my problem: http://s21.postimg.org/ss1x2rgpz/before.png ...
1
vote
1answer
33 views

Exporting shapefile to csv with cursor

I'm trying to export a shapefile to a csv file using a cursor. I found this quesion asked and answered here: Exporting table to XYZ ASCII file via ArcPy? However I only want to export several ...
0
votes
0answers
49 views

UpdateCursor not iterating as desired, updating erroneously

(EDIT BELOW WITH WORKING CHANGES) I have a script in which I am trying to compare attributes in row n to row n+1. If all the attributes match, I want row n+1 to have a field ([Modifier]) updated to ...
1
vote
1answer
82 views

Change field names automatically

I have an attribute table with over 2500 fields. About 2000 fields start with the name "All_txt_" (eg "All_txt_Watermelon"). Is there a way to remove this "All_txt_" from all the fieldnames ...
1
vote
1answer
46 views

What defines where the files will be saved?

Hi I have a script I am using to save out layers automatically I have posted another question here ArcGIS creating individual layers for unique attribute in a given feild. Limitations of Where ...
1
vote
1answer
15 views

How to make a loop for select by attribute?

I am trying to pull out a sample out of a geodatabase file. I have 100800 sample and I need to select 28 records, basically every 3600, I am going to start with FID=0 and go from there. Unfortunately ...
2
votes
2answers
27 views

Controlling default value of arcpy.AddField_management

I have a large collection of shapefiles that use text fields to hold numerical values. I have created new fields, and populated them with the numerical equivalent of the text field. When adding the ...
0
votes
0answers
33 views

ArcGIS creating individual layers for unique attribute in a given feild. Limitations of Where Clause

I am putting together some code that makes a layer for each unique attribute within a given field. So if I had a shapefile that contained point data for locations of say postboxes in every city , for ...
1
vote
0answers
27 views

Is it possible to consume an ArcGIS Hosted Table into a local or SDE geodatabase?

I would like to publish a table to our ArcGIS Online organization account, is it possible to consume hosted features in AGOL to a local db or sde database connection? By consume I mean import a ...
4
votes
2answers
263 views

Why does arcpy.da.SearchCursor() class not autocomplete within Eclipse?

I am very new to GIS. I just installed eclipse luna with pydev plug-in and ArcGIS 10.1 for Desktop. When I write a script, trying to import arcpy.da.SearchCursor I see that no SearchCursor is ...
1
vote
2answers
50 views

Convert a string field to a number field using arcpy

Accidentally posted this in the general stack overflow forum first. I have a large (>1000) number of shape-files in which there are fields containing numbers that are defined as text fields. I need ...
7
votes
6answers
326 views

Divide polygons into *n* number of groups of equal counts with ArcGIS 10.2

One of my tasks for work is to divide parcels into groups. These groups will be used by agents to talk to property owners. The goal is to make the agent's job easy by grouping parcels that are near ...
0
votes
0answers
16 views

Arcpy MakeGraph “Parameters are not valid”

I have a Python add-in that should create a graph based on the location ID of a water quality testing station. The user clicks on the point and a relevant graph should be created in the layout window. ...
3
votes
3answers
75 views

Insert cursor for first row in unique value set arcpy

I really need some guidance on how to create a python script with arcpy to: 1) Search through a table for unique values in a field. 2) For the first row in each unique valueset, insert that row into ...
6
votes
5answers
3k views

How to interpolate points along a line in Python for ArcGIS 9.3?

I am building a Python geoprocessing script for ArcGIS 9.3. In the script, I have a simple LINE feature class with one row, one line. How can I use a linear referencing system to interpolate a point ...
1
vote
3answers
316 views

How to place points along a line in a specific offset using python / arcpy?

I have a street shapefile with information about the street name, house number from / to on the left side and house number from / to on the right side. My aim is to create a point shapefile that ...
2
votes
0answers
26 views

Error inserting new column in ArcSDE table (ERROR 999999)

I am using a python script to populate a table with values I get from rasters files. I use arcpy.AddField_management to add a new column and arcpy.CalculateField_management to insert the values for ...
0
votes
0answers
28 views

Python error in array declaration

I am getting a error as follows File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy__init__.py", line 2292, in NumPyArrayToRaster return _NumPyArrayToRaster(*args, **kwargs) ValueError: ...
0
votes
1answer
250 views

How to create polygon feature class from UTM coordinates?

I am working to create a polygon from UTM coordinates. The script I am using fails with a "must be a sequence, not float" error: Traceback (most recent call last): File "F:/sample/clipTiles.py", ...
1
vote
2answers
224 views

Extremely slow processing time to map lat/lon data onto census shapefile with ArcPy?

I am a newcomer to ArcGIS and Python so I would greatly appreciate any and all input on this issue. What I am trying to do is very simple: map 400K business locations using lat/lon coordinates onto a ...
0
votes
1answer
23 views

ArcPy Lists, describe funtion, loop [on hold]

could someone please help with me with the following? Just need to get an idea of the flow of the code. i) How do you use the ListFeatureClasses function to create a list of all the shapefiles. Loop ...
-2
votes
0answers
24 views

Another set of questions - Cursors [on hold]

yet another set of question please: i) How do I use a cursor to parse through the features in this dataset to determine if any hydrants are more than ten years old (hint: use the Year_Const field). ...
2
votes
3answers
2k views

Possible to add multiple fields in single arcpy statement?

I'm trying to add multiple fields to a table using arcpy and am wondering if it's possible to have multiple fields declared in the AddField management, and their values, separated by commas or ...
0
votes
1answer
24 views

pop() method returns error with feature class list in ArcGIS python toolbox

I am trying to do something very simple, but I'm pulling my hair out with this one. In an ArcGIS python toolbox, for one of my tools I ask the user for a list of feature layers, using the following ...
0
votes
0answers
42 views

Generate individual Maps for each Point in a shapefile or a csv file

I am using ArcGIS 10.1. Lets say I have a shapefile or a csv file with 10 points and their address. First column consist of point ID, second column consist of full address.Lets say I want to create a ...
3
votes
2answers
32 views

Using field mappings to not carry over fields

I've tried multiple times to understand field mappings and continue to be rather baffled. I assume it can be used to perform a geoprocess (in my case it will be a spatial join) and limit the fields in ...
0
votes
1answer
21 views

Python error in polygon to raster conversion

I want to convert polygon to raster. I converted the dbf file ( "cntymam") to table view to make use in the conversion. I am getting a error that the parameters are not called and also with the grid ...
1
vote
1answer
44 views

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 ...
0
votes
1answer
28 views

Hyperlink Script to Open Shapefile in ArcMap?

I'm new to Python and need some help please. I have a shapefile (Index.shp) that is used as an index for the world splitting it into 264 areas (polygon). I'm trying to create a Python script (for the ...
1
vote
1answer
622 views

Why does CON statement give ERROR 010240: Could not save raster dataset to (value) with output format GRID?

I am receiving the following error when trying to run the following code: import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension = "Spatial" env.workspace = ...
9
votes
1answer
202 views

The role of '#' in a python 'if':

I recently exported an ArcGIS model to python and was reviewing the script and am confused by the following line: if TRU_W_DatableFeatures == '#' or not TRU_W_DatableFeatures: I can't seem to find ...
0
votes
0answers
27 views

arcpy.da.Walk not adhering to datatype filter “Locator”

I have a file gdb containing feature classes and address locators. I am listing and storing the names of the datasets using arcpy.env.workspace = "C:\input.gdb" (root, fds, ftrs) = ...
0
votes
1answer
12 views

Using Update_Cursor to fill new field

The goal is to crate a new field call "Full_Address" in which the "ADDRESS", "CITY","ST_ABREV" all appear together. I can get use row.getValue for 1 field but not more. import arcpy in_table = "C://" ...
0
votes
1answer
21 views

Python error in search cursor function

I need to access the dbf file to extract variable list (i.e. "CODE"). Basically I am calling dbf file to allMamrows variable and then I am appending using for loop. On running the script I am getting ...
1
vote
1answer
26 views

Script to Mark and Zoom to UTM Coordinate

I am currently working with ArcGIS 10.2.2 and need a script to create a tool (if possible). I have USGS 7.5'Quad Maps as my base and a series of UTM coordinates representing sites. I would like the ...
1
vote
1answer
42 views

Stand alone - Python Append (multiple shps from a folder to one dataset)

I have users creating data (shp) daily into a specific folder, I already know how to invoke GP tools to append these data sets into one. What I am trying to do is run a task (which I already know) to ...
1
vote
1answer
623 views

Using a Select By Location in Python and Calculating a field based on what State Plane a point falls in

Here's what I have so far. Do I need to make another feature layer based on the selection? import arcpy arcpy.MakeFeatureLayer_management(r"PATH TO THE POINT", "point_lyr") ...