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

learn more… | top users | synonyms (1)

0
votes
0answers
12 views

ValueError: math domain error

Iam tring to find the angle value using three vertexes: def findangle(p1,p2,p3): """This function returns the angle p1p2p3 given tuple inputs of the coordinates.""" #The vectors from p2->p1 and ...
0
votes
0answers
15 views

UpdateLayer with arcpy

I am trying to use updatelayer in three mxd's. Each mxd has 3 data frames. I am getting an error, can anyone help? import arcpy,os,sys,string import arcpy.mapping from arcpy import env env.workspace ...
-1
votes
0answers
32 views

How to check out arcgis 10.2 desktop license using arcpy?

Referring to ArcGIS help it seems possible to check out advanced desktop license. But typing arcpy.CheckOutExtension('ArcInfo') gives Unrecognized extension code ArcInfo
1
vote
0answers
13 views

Upgrade Geodatabase crashes python and ArcCatalog

We are currently in the process of upgrading our ArcGIS for Server license (10.0 to 10.2.2) and our SQL Server instance from 2008 (SQL Express) to 2012 (Full blown). We have around 60 databases to ...
1
vote
1answer
31 views

Calculating centroid latitude in ArcMap throws error in Arcpy

I can create a centroid latitude field in ArcMap10.1 using "Calculate Geometry..." in the attribute table, but when I try the same thing using: arcpy.CalculateField_management(bins_WGS84, "cent_lat", ...
2
votes
1answer
38 views

Access ArcCatalog Window through ArcPY

I want to create a button in ArcCatalog that takes the metadata from the selected file in ArcCatalog and prints it to a text file. The metadata extraction part is done, and I have succssfully tested ...
2
votes
2answers
52 views

How to print selected page from Data Driven Pages using ArcPy?

I am looking to print DDP (Data Driven Pages) to a printer through a Python (arcpy) script which I will create in Arc Catalog. In other words, I would like for the script to have the following ...
2
votes
1answer
19 views

Output raster from IDW interpolation tool is from 3.40282e+038 to -3.40282e+038 in ArcPy

I am not familiar with Python in ArcGIS, so I used ModelBuilder first to set the environment and put the tool in. The model worked right and the output raster seemed good. Then I exported the model ...
0
votes
1answer
34 views

Can not SET a Value in table using Python?

I'am trying to set values in table, the code run good, i don't got errors, but nothing is done ! I'm using Arcgis10.1, arcpy and Python This is the code : import arcpy import math import arcview ...
1
vote
1answer
43 views

Creating Self Executing Python Script (*.py)?

Trying to figure out how to create self executing python scripts with using the ArcGIS python window. I'm ok (generally) when developing and running scripts inside the python ArcGIS windows but ...
1
vote
4answers
58 views

NameError: variable not defined even though set multiple times

This code original worked when run through the python command window in ArcCatalog. After I added the script to a toolbox I have had all sorts of troubles. The most frustrating error has been: ...
3
votes
1answer
27 views

Help with Python script to query feature server

For the purpose of saving the data locally from a feature server online I have written code below: import arcpy fcout = r'C:\Forum\Hydrants\test01.shp' url = ...
1
vote
1answer
77 views

Find and replace text based on feature class attribute

I've been struggling with this problem for a few days. It seems to be more programmatic than geospatial in nature, so I'm open to suggestions to redirect this elsewhere. I have a text file ...
0
votes
0answers
24 views

Meaning of AttributeError: 'module' object has no attribute 'da'? [duplicate]

error is : AttributeError: 'module' object has no attribute 'da' Code is below: import arcpy import os from arcpy import env # Set local variables inWorkspace = "Q:\\NHD project\\Connection ...
2
votes
1answer
39 views

Do I need to set arcpy.env.workspace at the beginning of my python code?

I am new to Arcpy and have been doing simple tasks such as AddField_management and updateCursor. However I have been getting error msgs, such as errors 99999 etc. The errors I get are related to ...
2
votes
0answers
34 views

arcpy.Intersect_analysis() returns empty result, but Intersect tool in ArcMap is succesful

I've got two large feature classes that I'm trying to perform an intersect on. Using the following python code, I get an empty output feature class: arcpy.Intersect_analysis(["Schools","Zips"], ...
1
vote
1answer
26 views

MakeFeatureLayer_management wrong output

I have a huge database with Sightings from whales and dolphins from 1995 till today. So I want to sort the database with python. Till now I can make FeatureLayers for each year for ...
2
votes
1answer
29 views

arcpy cursor not accepting float(Inf)

I have a vector layer in which I have added some fields of type 'float' using arcpy.AddField_management. I'm performing simple calculations between those fields using update cursors but the problem is ...
2
votes
3answers
58 views

How to change properties of an item in a legend in ArcMap 10.2 using python

For many of my projects I use a single mxd to create multiple maps using a python script to switch on/off various raster layers before exporting to pdf. Before beginning the exporting process I ...
1
vote
0answers
22 views

Custom error message with 'Error Code -1' in ArcGIS script tool

I have a script tool in ArcGIS 10.2 and I have altered the tool's validation code to show my custom error messages using setErrorMessage method. It works but when an error message is displayed it ...
2
votes
1answer
38 views

Subtracting columns (that include null values) in ArcMap Field Calculator

I’m desperately trying to run a very simple command where I subtract one column with others. However the problem is that some rows have NULL values, therefore the result of subtracting is also NULL. ...
1
vote
1answer
14 views

MakeFeatureLayer_management parsing error (for loop)

I want to make a Feature Layer for each month in the table "Sightings1995-2014". Why doesn't it work? for month in range (01,12): ...
0
votes
0answers
32 views

Rename open MXD using ArcPy

Is there a method in ArcPy that will rename the MXD you currently have open? I don't what to use mxd.saveACopy("newFileName") as it will just save a COPY with a new name, not rename the current MXD. ...
0
votes
1answer
27 views

Catch Execute Error and Continue (arcpy)

I've got a script that does a number of Date/Time conversions using arcpy.ConvertTimeField_Management. A common issue that I need to handle is when the field is empty and an execute error is raised: ...
1
vote
0answers
24 views

Using choice of one parameter to populate column of multi-value control ready to have values for second column chosen?

This relates to my earlier question Can one parameter choice on Python toolbox tool set Display Names of other parameters?, but attempts to describe the requirement, rather than my attempted solution, ...
3
votes
0answers
38 views

Can one parameter choice on Python toolbox tool set Display Names of other parameters?

I would like to be able to create a Python toolbox tool (or a Python script tool) where a choice made from the first parameter (Category in the images below) changes the Display Name of other ...
2
votes
3answers
182 views

Executing Python code takes a lot of time (more than 2 hours)? (Arcgis10.1)

I am executing this Python code, in which I am trying to determinate the position of neighbor parcel (north, south, east, west). It works fine but it took 2 hours for just 50 parcels! I think that ...
3
votes
2answers
44 views

ArcGIS Removing values from a shapefile with Python

I've got a monster shapefile with lots of duplicate records, however each duplicate record has an accuracy rating. I want to remove all duplicate records with a lower accuracy rating. This would be ...
2
votes
1answer
40 views

How do I import an ASCII grid using arcpy?

I'm trying to automate the setup of some flood depth/hazard maps. The user specifies a folder containing depth grids generated by a hydraulic model (.asc format) and some background mapping (geotiff ...
3
votes
1answer
24 views

ArcMap Using Python to Rename a Feature Class based on Print Results

I would like to rename a feature class based on the EDITOR and DATE fields. I wrote this code: import arcpy fc = "C:\Users\PythonTesting.gdb\MyFile" f1, f2, f3 = "EDITOR", "DATE", "OBJECTID" ...
0
votes
2answers
42 views

Join in GUI not the same as arcpy join

I'm trying to join up some data so I can make some rasters. I am doing this in Python but when I create the join in Python in results in an empty attribute table for my shape file. The columns from ...
2
votes
0answers
37 views

MakeFeatureLayer weird behavior from script

I am trying to add a feature layer to my map document as the output from my python script. The goal is to limit the number of fields in the attribute table to a pre-defined list. I am able to add ...
0
votes
0answers
26 views

Why Arcpy ExtractByMask returns a mysterious value “-128”

I'm getting an unexpected value of "-128" as a results of arcpy Extract by mask analysis. Input data is Esri GRID only containing values 0 or 1. Output format is .tif. For example, in this picture ...
0
votes
0answers
43 views

name 'row' is not defined error appears overnight

I'm using arcpy with arcgis 10.0. I strived days to write my first python script, and I finally get what I want until...a new error occured during the night. The script you can see below was tested ...
0
votes
1answer
53 views

Error 000728 field does not exist within table - field already exists

I am running arcpy.AddField_management to add a field called "cnid" and update it with x centroid values. For add.field I get the error "cnid" already exists. I tried print.field name and I cannot ...
0
votes
1answer
47 views

Syntax error using ArcPy Spatial Analyst module in Python [on hold]

I'm very new to using python and figure I'm missing something obvious in the following script. I keep getting a "syntax error" message no matter how much I fiddle around with the first few lines. I ...
0
votes
1answer
13 views

Trouble with AddJoin_management? [duplicate]

While i'am trying to execute this code IN IDLE, i got error : import arcpy import math import arcview from arcpy import env arcpy.env.workspace = "D:/Users/saadiya/Documents/ArcGIS/Default.gdb" ...
1
vote
1answer
38 views

Unable to Write to Text File Unless Python Script is Re Pointed

I have a python script running from ArcToolbox. Each time the script is run, it creates a new text file (testtext.txt), writes to it, then deletes it at the end. Before the script is re-pointed, the ...
0
votes
1answer
24 views

limit spatial extent of arcpy cursor

How do I limit spatial extent of features that is returned by arcpy.da.SearchCursor? Can I use arcpy.env.extent? Or somehow come up with sql statement to specify spatial relationship? Or do I have ...
2
votes
1answer
75 views

How to get information about layers using Arcpy

I have this layer structure in ArcMap: "Localities, Gazeteers, Bases, Regions, and Territorial Claims are all Group Layers. All others under these are layers. I have a script that uses the Arcpy ...
1
vote
1answer
54 views

Update a field for similar values in the second field based on third field value

So I have the table like this: City Distance NearFeature Comments A 90.5 131025 A 0 781446 B 15.5 131057 B 42.2 140521 C 21.7 784116 C 0 ...
-1
votes
2answers
46 views

Intro to Geoprocessing Scripting with Python for ArcGIS? [duplicate]

Can you point me to any recommended online resources where i can learn the fundamental basics of geoprocessing scripting and the different modules/python has available for an ArcGIS environment. I ...
0
votes
1answer
41 views

Feature Layer no longer accesible after MakeFeatureLayer_management

I am creating a new layer out of an old one with MakeFeatureLayer_management like this: arcpy.MakeFeatureLayer_management("layername", "newlayername", "DEPTH = 1200") This works for the first time ...
2
votes
1answer
19 views

How to find number of synchronized records in ArcGIS10.2.2 (Data Management)

I want to find number of records synchronized while using arcpy.SynchronizeChanges_management tool. Right now, I'm getting only messages like process is Executing, Synchronize successfully ...
0
votes
1answer
31 views

Ignoring group layers when iterating through layers

I have this nice code that goes through each dataframe in the current MXD, and through each layer in the dataframe, and generates a list containing the name of the dataframe, the name of the layer, ...
1
vote
1answer
30 views

how to get date from excel with xlrd as text in textelement

when I run the script below in arcmap in the python window the date gets print however I get the following error:Parsing error SyntaxError: invalid syntax (line 19) the date isn't showing as text in ...
1
vote
1answer
52 views

Run a custom model via ArcPy fails

I'm trying to geocode a few address using a custom model created. When running the model via model builder all runs perfectly. Also when running it via the embedded interactive python console in ...
1
vote
1answer
27 views

ERROR 000358: Invalid expression “Parcelles_class.OBJECTID” = 1 OR “output_table1.src_OBJECTID” = 1 Failed to execute (Select)

I'm executing this code. I don't know if i'm missing something, I'm using Arcpy, Python, Arcgis 10.1 whereclause1 = '"Parcelles_class.OBJECTID" = 1' whereclause2 = '"output_table1.src_OBJECTID" = ...
-1
votes
2answers
56 views

SelectLayerByLocation - arcpy

I have 2 layers: "atikot" and "ways" that located in C:\Project\layers\New File Geodatabase.gdb , and i try to use this code based on "ArcGIS Help 10.2" to select features from "ways" layer: import ...
2
votes
1answer
41 views

Methods for converting a regular polygon grid to a numpy array

I have a regularly spaced model grid, 5000 by 5000 feet (517,300 cells), which I need to convert to a numpy array. I am investigation a couple of different methods, using arcpy, by which I can convert ...