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

learn more… | top users | synonyms (1)

0
votes
0answers
56 views

Error in importing arcpy in arcgis python console

I have been coding in eclipse using arcpy 64 bit. the pythonpath in eclipse is set to the 64 bit, the pythonpath in environment variables is also set to the same address. but when I want to improt ...
1
vote
1answer
64 views

Compute annual mean of overlapping cells using daily rasters

I am stuck at somewhat simple looking calculation. I have daily temperature rasters from 2001 to 2014 with following name format: `2001001` `2001002` | | `2014365` I want to compute annual mean ...
0
votes
0answers
41 views

After execute arcgis script, what happen with the variables?

After the execution of a Arcgis script (I wrote the script in python language) on a Arcmap session. What happen with the variables that I used in the script? They remain stored somewhere in ArcMap (So ...
3
votes
2answers
94 views

Displaying estimated computational time when running tools in ArcGIS for Desktop?

I'm almost positive I have set up models to display the estimated runtime/computational time for the models/tools in the past, but I can't seem remember how to turn on this option. I've looked around ...
2
votes
1answer
36 views

How to set empty date field with arcpy.CalculateField_Management?

I want to simply set my date field to empty i.e "". No problem directly in ArcGIS , but with arcpy I can´t seem to get the syntax right. When I try with a date this is no problem e.g '22.06.2015' But ...
1
vote
0answers
49 views

How to automatically generate pour points along stream network?

The following screenshot shows the results of a water flow analysis where I identified stream order via the Strahler method in ArcGIS. Now I need to generate watersheds for 2nd order streams and ...
0
votes
1answer
62 views

arcpy.da UpdateCursor where_clause

I am trying to get a where_clause working on a UpdateCursor (arcpy.da). I can get it to work fine with a SearchCursor, but for some reason the same clause throws a RuntimeError: General function ...
2
votes
0answers
53 views

Using Python to iterate through directory to create event layer and perform kernel Density for each file?

I am new to Python for ArcGIS, but have been using ArcGIS a while. I have a large directory of tables with point data. For each file of each folder I want to create a kernel density layer. I have ...
0
votes
1answer
36 views

Using Python to Union two polygons from separate gdb? [closed]

I'm in the processes of learning python and am stuck on an exercise. One part of the exercise requires me to union a polygon from one gdb with a polygon in another gdb. Here is what I have, which ...
2
votes
2answers
80 views

definition query with 3 plus variables to loop with python and save layer files

I have a script that takes an input feature class and uses a field within this class to create a definition query for each unique field. A question on how to do this is listed below saving layers for ...
0
votes
1answer
19 views

arcpy CSV file to raster attribute table?

Using TableToTable_conversion I can convert a CSV file to a table in a geodatabase, but how can make this table be the default attribute table for a raster in the geodatabase? I can't seem to find ...
0
votes
0answers
55 views

Configuring Python to avoid conflict with ArcGIS for Desktop (ArcPy)?

I am trying to find the best way to configure a new version of python in my computer (windows) so that I do not have any problem with the python version that I have with ArcGIS. Is there anyway to ...
1
vote
1answer
26 views

Why is there a lock when using arcpy.DeleteField_management in arcgis 10.0?

This code only works when ArcCatalog is closed or the featureclass has never been opened by ArcCatalog. For other arcpy management functions this is not the case, but when ArcCatalog is open, I get ...
1
vote
1answer
55 views

How can I programatically set the “Description” for a ArcPy Geoprocessing Service?

When I create a Python Toolbox (pyt), I set the name and description of the toolbox. When I create the parameters, I can set their name, type, default value, in/out, etc. Basically, everything that ...
0
votes
1answer
60 views

ArcGIS 10.0 Python script not working with ArcGIS 10.2.1. Looping through SelectLayerByLocations

Last year I got assistance from StackExchange to write a Python script for ArcGIS 10.0 which loops through SelectLayerByLocation with buffer until it returns no new rows. Then it uses the selection ...
1
vote
1answer
18 views

Calling a variable in SelectLayerByAttribute

I am trying to code a Python add in for ArcGIS 10.2. I have a shape called FACILITIES which contains facilities, a field CATEGORY and I wish to select all the entities that are categorized as "school" ...
2
votes
2answers
99 views

Ignoring field types in Python list returned by arcpy.ListFields()?

I am generally just wondering if there is a nice and easy way in python to ignore all fields of a specifiy type (eg string) in a feature class. At the moment I am doing it with field_names = ...
1
vote
1answer
23 views

Field mappings object not functioning with Merge_management

I'm trying to limit the number of fields when I perform a merge to two. Below is the script I have created to do so. However, the merged feature class carries over all fields, despite my use of a ...
0
votes
0answers
28 views

SQL fails in python. In ArcMap error FDO error: -2147024871 returned

I'm having issues with an SQL expression for a feature class in a file geodatabase. When working in ArcMap, the SQL will fail on its first attempt, and produce the following error: However, when I ...
1
vote
0answers
24 views

Why is arcpy ChangePrivileges_management adding a second feature class to map?

I am new to GIS and pretty new to python, so sorry if this is ugly code. I am creating a feature class in a postgres database if it does not already exist and the user wants it created. That works ...
0
votes
1answer
64 views

cannot concatenate str and list objects

I'm trying to rename a group of rasters to "I1986_" + [The 1st 3 letters of the raster]. For example, if a raster is named "Raster1", the output would be "I1986_Ras". I've tried including str() ...
1
vote
1answer
42 views

How to replace field name with a variable in exported whereclause?

In the select by attribute how do I replace "AADT", with a predefined string variable? I don't understand the pattern in "\"AADT\">=" , can you please explain why is it that way when exported from ...
0
votes
1answer
64 views

Python Script to Select records based on user input

I am running Arc 10.3 in a versioned environment. I am attempting to write a simple code that will select service records coming from Oracle CRM to a separate feature class containing only records ...
1
vote
1answer
33 views

How to search for fields in a GDB and add them if they don´t exist with arcpy?

I have a list of files that need to be present in my featureclasses - myFields[]. I need to add these fields if they are not present in my FeatureClasses. import arcpy myField="Field01" myFields = ...
0
votes
0answers
21 views

Assign a dummy value for removed features in a Polygon-Grid

I want to calculate the entropy index for landuses classes for an area based on a 100m Polygon Grid. I did find an existing toolbox that does all the required calculation. Input features are the 100m ...
4
votes
2answers
178 views

Fastest way to numerate intersecting polygons in ArcGIS

I need to numerate a thousands of polygons in groups, so each group will get unique number. Every intersecting polygons is unique group (see picture). So polygons have field "groups" with values: ...
0
votes
1answer
54 views

TypeError: value #0 - unsupported type: datetime.timedelta

The following code runs fine minus receiving the error below, which doesn't make any sense (to me) as I have other UpdateCursors and perform UpdateRow(row) with other date values. As can be seen ...
1
vote
2answers
65 views

Export feature classes in geodatabase to CSVs

I am trying to export feature classes within a geodatabase to CSV format using "Export Feature Attribute to ASCII" in ArCGIS. I am getting the following error Traceback (most recent call last): ...
2
votes
2answers
67 views

How to access Spatial Analyst extension from stand alone script?

If I run this script: import arcpy arcpy.AddMessage(arcpy.CheckExtension("Spatial")) from arcpy.sa import Con from arcpy import env fDir=r'd:\scratch\fdir' outFolder=r'd:\aerials\images' ...
2
votes
1answer
79 views

How to use %i%“.csv” in arcpy to name an output csv file?

I am using arcpy to describe datasets and output the results into a csv file. I am doing this via a script in arctoolbox and would like to save the file in the same folder as the file being analysed. ...
0
votes
2answers
93 views

How to enter date with arcpy.GetParameterAsText with arcpy?

I want to allow users to enter a date as a parameter through a dialog window in a toolbox script. I have obviously defined the field with a "Date" data type but something is wrong with the ...
2
votes
1answer
66 views

Polygon found with search cursor, but not update cursor

Here's my issue. I am doing two things with arcpy: 1) I search a feature class using arcpy.da.SearchCursor() and pull out a UID field and the geometry in WKB format for all polygons in the file, ...
0
votes
4answers
171 views

Is there a site with templates for Arcpy where I can just fill in the blanks?

I have a Shapefile containing near 7000 pour points across the globe (GCS, WGS84). I'm using the following model to select the first feature point of the Shapefile, copy the selected feature in a new ...
0
votes
2answers
45 views

Comparing field names and field formats for featureclass using ArcPy?

I have a strict data model which needs to be enforced for a project. For all featureclasses which exist, I need to check if the fields which are present conform to the data model. I want to do this in ...
1
vote
1answer
63 views

Returning feature class from Python toolbox

I am trying to return a feature class (my sample data is a polygon fc) from a Python toolbox and cannot find any information about what I have to set to get it to work. This runs successfully and ...
0
votes
0answers
22 views

How to align big polygon over smaller ones using ArcPy?

I have to write a python script which is supposed to align an area polygon on the borders of other polygons coming from a cadastral plan. These polygons come from an official source, so they are not ...
2
votes
1answer
12 views

Pass buffer as variable using arcpy.Buffer_analysis

I am trying to pass a buffer variable and seem to have run into some sort of limitation of the command. The buffer will vary each time the script is run so I need to have this parameter variable ...
0
votes
1answer
56 views

Script not working as expected

I'm newbie to python and I wrote this script. It is supposed to check the text in the fields fld_o and fld_d and write a value (just numbers in a sequence) to a newly created field fld_name. While ...
0
votes
0answers
25 views

CopyDatasets will not overwrite some datasets

I used a script from esri found here http://support.esri.com/en/knowledgebase/techarticles/detail/40831 to import all the feature datasets and feature classes from one file database to another. In the ...
2
votes
2answers
65 views

How to remove duplicate polygons having different attribute values from Python Arcpy?

I'm trying to create a national.shp to cover the entire countries land. I made index called "province" to help me update the information in my attribute table from the national shapefile. The idea is ...
1
vote
1answer
57 views

How can I dissolve adjacent polygons based on minimum attribute value? [duplicate]

I'm trying to merge the polygons (administrative boundaries) in a dataset untill they reach a minimum value. Lets say that the polygon dataset consists of the number of people per polygon and I need ...
3
votes
3answers
184 views

Is there a better way to compare lists in arcpy?

I simply want to create a script which compares a list with the field names of a featureclass and if the fields do not exist in the featureclass add them. My code works, but is very inefficient. How ...
1
vote
1answer
82 views

Listing data sources in ArcGIS map (*.mxd) without opening it?

Is there any routine I can use to read the data sources out of mxd´s without waiting 30 seconds to open each one? I need to create lists of all data sources as we are migrating data and altering our ...
0
votes
1answer
50 views

Convert field types in GDB with Python

I want to create a python script (ArcGIS 10.1) where I loop through a GDB with several feature classes and select all the fields which are of text type and convert them to float type. I always want ...
1
vote
1answer
27 views

Calculating lat/long in NAD 83 and NAD 27 using arcpy or modelbuilder

I have four double columns for lat/long with NAD 83 and NAD 27. The native projection of the data is in NAD 83, but the client want's the attributes filled out for NAD 27 as well. I want to ...
0
votes
1answer
49 views

Arcpy scripts run time dialog keeps deactivating tkinter window

I'm using tkinter in my scripts to get field names of the user in case the hard coded field names were not found in the target feature. it runs from python IDE, but when run from arcmaps toolbox the ...
0
votes
1answer
47 views

How to add an image (jpg) to an existing layout using Python?

I have 1500 MXD whit the same template layout, and need insert other image for the al mxd thanks for your time. version arcgis 10.1
1
vote
1answer
53 views

Listing Data sources using arcpy: ListLayers very slow

What I am trying to do is create a list of all the data sources in a directory filled with mxds. So I have this code pasted below. For some reason when listing layers it can take up to 50 minutes even ...
1
vote
1answer
96 views

Value Error with Float/Integer/double Fields in Python?

When running this Code: import arcpy from arcpy import env import os #Specify the map document and the data frame mxd = arcpy.mapping.MapDocument(r"G:\\PythonCode\\mxd_test.mxd") env.workspace = ...
3
votes
1answer
123 views

Checking .mxd version using ArcPy?

I am looking for a way to check the mxd version of a bunch of mxds. I found a script here at ArcPy method to determine ArcMap document version I am using ArcGIS 10.3.1 on my desktop. It goes through ...