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

learn more… | top users | synonyms (1)

0
votes
0answers
16 views

How to get an ArcGIS custom tool to run fom the command line?

I have been experimenting with ESRI's CalculateArea custom tool and it works fine running within ArcGIS from a toolbox. Then I wanted to see if I could run it as a standalone script from the ...
-1
votes
0answers
16 views

How to work data driven page with arcpy? [on hold]

Can somebody share any video or something how to work with data driven page with arcpy?
-1
votes
1answer
29 views

Search layer in MXDs

I work on arcview 10.3 and i try to find layer called "ways" in several mxds. i try this code but it does not work. anyone know how to do it?: import arcpy,os,sys,string import arcpy.mapping from ...
2
votes
1answer
34 views

How to add Attributes to a polygon with arcpy

I have a question about arcpy. I want to create a polygon FeatureClass with attributes. The code below ist just a test-code that generates some polygons for speed testing. I want to add some ...
4
votes
2answers
57 views

Performing a 'far analysis' using ArcGIS for Desktop?

I would like to perform an analysis that is the inverse of Near_analysis for ArcGIS. Instead of my result being NEAR_DIST and NEAR_FID, I'd like each feature to have a FAR_DIST and FAR_FID populated ...
1
vote
1answer
73 views

Calculate Date field in ArcPy

I'm trying to use arcpy.ExtractValuesToPoints() to get raster values to a points feature class for several raster files (8760). The goal is to get a time-slice view of how the values at certain ...
1
vote
1answer
46 views

How to checkin ( release, make it free) arcgis 10.2 desktop license using arcpy?

There is a way to do this using AcrGIS license Server Administrator, but I need a command to use it in arcpy scripting.
2
votes
1answer
28 views

Converting geographic units with ArcPy

I am trying to compare a set of point features to the centroid of a single feature polygon using ArcPy. The problem is that the polygon generates a set of XY coordinates in meters, whereas the set of ...
2
votes
2answers
52 views

List all feature layers

I will often create many temporary layer files with MakeFeatureLayer_management. I was wondering if there was a means to list the temporary layer files I've created. I've tried setting the workspace ...
0
votes
1answer
51 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 ...
0
votes
0answers
48 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
17 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
35 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
72 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
54 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
2answers
27 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
35 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
47 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
63 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
78 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
40 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
37 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
60 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
40 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
33 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
28 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
26 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
43 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
186 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
46 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
42 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
1answer
45 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
45 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
54 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 [closed]

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
14 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
39 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
34 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
77 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
57 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 ...