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

learn more… | top users | synonyms (1)

2
votes
2answers
58 views

Delete Files in a folder and disregard an existing folder

I did a lot of geoprocessing steps and now I like to delete all files including result, result, _join, _interand reclass in their name. I can do this with the following import glob import os for fl ...
2
votes
2answers
48 views

Using Python to move Text Elements for creating multi-page PDF

I have a map document which contains several text elements that I have grouped and am able to programmatically update. These groups represent a page of data. Now I'd like to export this data as a ...
1
vote
1answer
33 views

Performing multiple “Closest Facilities” analyses for multiple feature classes

I am trying to calculate network distance from 10 points within 896 polygons "SA1s" (a total of 8960 facilities), each to ten points within 186 polygons "DZNs" (a total of 1860 incidents). I would ...
7
votes
2answers
128 views

How to Determine if Layer is a Point

I have been working on a Python toolbox which contains 6 parameters. I am a little lost on all of the different data types available in ArcMap (it seems like there's hundreds of them!). However, one ...
1
vote
2answers
36 views

Creating multiple address points for each unit using arcpy

I have a point feature class of addresses and an excel spreadsheet of all the suites associated with each address. I need to create a point for each suite belonging to an address. Is there a way, ...
1
vote
0answers
36 views

Clip Management won't work outside of ArcMap/Catalog

Okay so I have a short script that works great when copied into the python window in ArcMap or ArcCatalog, but refuses to work in an IDE for whatever reason. The error that is thrown is: Start Time: ...
2
votes
2answers
32 views

How to Change Parameter Type from Optional to Required

I am creating a Python toolbox with 5 parameters. One of the parameters is a Boolean/checkbox, which checks if the user wants to edit the labels of a shapefile. What I would hope to do is if the user ...
1
vote
2answers
36 views

Optional Parameter Not Being Optional in a Toolbox

I have been creating a toolbox that contains 4 parameters. Two of my parameters involve editing the labels of a shapefile. I want to have these two parameters as optional: if the user does not want to ...
0
votes
1answer
22 views

How do I define 'KrigingModelOrdinary'

How and where do I define the KrigingModelOrdinary Here is the code: rasterKrig = "run{}_Krig_{}".format(counter, field) outKrig = arcpy.sa.Kriging(Stations2010o3Data__2_, field, ...
7
votes
2answers
153 views

Calculate Date Field - today's date from datetime.date.today

I'm working on part of tool that will use arcpy.CalculateField_management to add the current date to the attribut table. I've wandered far and wide on the interwebs and can't seem to find the ...
1
vote
4answers
164 views

Arcpy: what tools are most suited for this job?

I'll try to be as much detailed as possible but please let me know if anything is missing: I'm trying to get the number of lines in layerA that intersect with each line in LayerB and stores that ...
2
votes
0answers
63 views

Error 000212 Cannot create XY event source from arcpy.MakeXYEventLayer_management?

So I am using arcpy to create an output feature layer. I am using the command: arcpy.MakeXYEventLayer_management(wells, "longitude", "latitude", wells_layer, GEOGCS, ""), where wells is my ...
1
vote
1answer
33 views

Extract polygon attributes from covering polygon with highest area

I have a fishnet grid (polygon layer) and another polygon layer containing some hexagons. I would like for each square polygon in the fishnet layer that covers a hexagon (even a tiny edge of it) to ...
4
votes
1answer
42 views

Installing scipy.spatial with ArcPy gives DLL load failed error on import?

I am running python 2.7.6 from an ArcGIS installation. I have tried to install scipy from the Python Exchange Packages here, using the scipy-0.14.0.win32-py2.7.exe executable. I get no error importing ...
6
votes
1answer
45 views

Ordering tool display within a Python Toolbox

I have created a python toolbox containing a number of classes which define the various tools within. As these classes are part of a workflow in which the tools are to be executed sequentially using ...
1
vote
0answers
35 views

Esri Python Toolbox(pyt) corruption in ArcToolbox.dat

Symptoms: Open ArcCatalog and all tools within Python Toolbox(pyt) have a red-x error next to them claiming that "Arcpy module has no attribute Parameter" Close ArcCatalog Delete ArcToolbox.dat file ...
1
vote
0answers
41 views

Does anyone know why this Kriging isn't working

Process: Kriging tempEnvironment0 = arcpy.env.extent arcpy.env.extent = "56662.1788730418 308952.917606764 1698384.17317964 1912328.52737378" rasterKrig = "run{}_Krig_{}".format(counter, field) ...
1
vote
1answer
32 views

Using dynamic text elements from ArcMap in conjunction with text elements derived from Python

I have a script that cycles through features based on attributes and makes a PDF centered around each feature. I would like to be able to include both a dynamic text element for the date as well as a ...
2
votes
2answers
70 views

ArcGIS - Getting Python toolbox to function properly

as the header says, I do have a problem in getting my toolbox to function the way I want it to. In the following my parameter definition is shown, where from I would expect to get only feature classes ...
0
votes
0answers
30 views

Using ListTransformations function in ArcObjects, C# and ArcGIS Engine?

I need to call arcpy.ListTransformations function in C#. I have to pass 2 spatial References (ISpatialReference objects, I guess) and an envelope(IEnvelope object) to this function. This function ...
1
vote
0answers
40 views

Using gdal ReadAsArray or Arcpy.RasterToNumPyArray on python 2.6 32bit without it crashing

I am trying to run ReadAsArray on an entire raster and on a single band, python will crash without an error message when trying to do either. Is there a way I can create a 3d array without having to ...
0
votes
1answer
37 views

Arranging elements horizontally in ArcGIS tool

Is it possible to arrange multiple check boxes horizontally in a tool and changing the parameters dynamically (adding/removing) based on user selection of check boxes?
2
votes
1answer
29 views

Cut polygon shapefile with 2 parallel lines to derive new inside polygon?

Using Python scripting: How can I clip a polygon shapefile with parallel lines (polyline shapefile) to derive new inside polygon?
0
votes
0answers
16 views

How to disable featureset completly even draw option

I need help in developing a python tool. I have few queries in FeatureSet datatype. When i am using featureset in 10.2, it is giving options to draw on the map or to select some features from ...
1
vote
1answer
32 views

Set default projection of geometry objects in arcpy

I have a script that creates a polyline geometry from scratch using some math to generate coordinate pairs. At the same time, there is a user-defined polygon shapefile that is used to "erase" the ...
3
votes
1answer
52 views

Trying to generate a PDF for each feature in a feature class based on an attribute with Python.

I have a feature class of points that represent storm water inlets. I am trying to automate a process that does the following. finds all of the inlets that have a field called "Marker" populated ...
1
vote
0answers
27 views

Error writing defaultdict values to feature class rows

I originally posted building dictionary from feature class field values, how can I ensure there are no duplicate values per key. The goal is to update another field with all the values per key, which ...
0
votes
0answers
57 views

Python trainings comparison

My employer provides me with a generous annual training budget and I'd like to use it on one of the following two Python courses. As a GIScientist, I would like to attend the course which will give ...
2
votes
0answers
49 views

Returning distances in meters from Near (Analysis) tool of ArcGIS for Desktop?

I'm trying to write a python program that returns the distance from each point in a set to the nearest road. Specifically, I was looking for any points within 10 meters of the roads. Both sets of ...
1
vote
2answers
45 views

building dictionary from feature class field values, how can I ensure there are no duplicate values per key

I found this code sample that builds a dictionary from two fields; the end result is a concatenation of all values per key to a new field. It's a great tool except that it doesn't account for ...
0
votes
2answers
34 views

Select Layer by Attribute: SQL and variable problems

I've had a good look around the site and haven't been able able to find any 'select by attribute' questions regarding string variables and how to integrate them into an SQL statement. In my particular ...
2
votes
1answer
34 views

ERROR 001243 preventing automatic publishing of geoprocessing service

I am trying to automate the process of publishing a geoprocessing service to ArcGIS for Server 10.2.2, using a python script: import arcpy result = r"C:\data\ContourLineFunction.rlt" ...
3
votes
2answers
51 views

How to calculate the a list of rasters?

I'm writing ArcPy code in ArcGIS trying to calculate a list of rasters. I get an error message that says: TypeError: unsupported operand type(s) for -: 'unicode' and 'unicode'. Here's my ...
2
votes
1answer
43 views

Parameter Not Being Included in Tool

I have been attempting to make a Tool within a Toolbox with four different parameters. My code consists of the following: def getParameterInfo(self): """Define parameter definitions""" # ...
2
votes
1answer
52 views

Appending feature classes from one geodatabase to another geodatabase for python

I am attempting to write a stand alone python script which will loop through the first GDB and append each feature class to its corresponding feature class in the second GDB. The error code that I ...
2
votes
2answers
81 views

Use updatcursor to replace values in multiple fields

I have spent a couple days digging through forums here, ESRI help and elsewhere and each variation of the codes I have tried has not worked. As best as I can tell this is due to my attempt to loop ...
3
votes
1answer
34 views

add-in to open automatically "data frame properties

How can created an ArcMap Python add-in using ArcGIS 10.1 to open automatically data frame properties And change the background color of another?
3
votes
0answers
32 views

Get value from Metadata in Python Script for attribute

I am working on a python script to create some feature classes from dbf tables. As part of the script I would like to pull two values (FGDC "publication date" and ArcGIS Spatial Reference ArcGIS ...
1
vote
2answers
145 views

Calculate Fields with Null Values using arcpy.da.UpdateCursor of ArcGIS for Desktop?

How do you calculate fields with null values? I have multiple fields that may have null values, that aren't being calculated in the third field. import arcpy with ...
2
votes
1answer
35 views

Performing equivalent of ArcGIS Identity_analysis (line with poly) using PostGIS?

I've got a section of arcpy code that I need to port PostGIS: Identity_analysis with the in_features being a line featureclass and the identity_features being a polygon featureclass. I'm primarily ...
2
votes
0answers
66 views

How to extract polygons from a road network?

I need to extract faces (or polygons) from my road network and calculate their areas. I mainly use Arcpy packages but even if you know it in QGIS APIs, I'd appreciate if you'd share it with me. If it ...
1
vote
1answer
30 views

Issues with FME and the ArcInfo licence

I have ArcInfo 10.2.1, Python 2.7 and FME 2013 SP4 installed on my Computer. I want to run a python script I exported from ModelBuilder (where it ran without issues) and imported in FME as shutdown ...
1
vote
2answers
38 views

How to provide a default value in an arcpy script?

How do I provide a default value like recommended in every Arcpy script? This script is exported from ModelBuilder where every output except the last one is set to temporary and managed. I want this ...
1
vote
1answer
19 views

buffer by objectid in arcpy

is there a way in Arcpy (arcgis 10.2.1) to buffer lines by selecting thier objectid? arcpy.Buffer_analysis("MY_JUNK","d:/data/ArcGIS/Default.gdb/MY_JUNK_Buffer1","10 ...
0
votes
1answer
15 views

ERROR 000539: Error running expression_NameError: name 'shape title' is not defined

I'm trying to get the title of the shapefiles or feature classes that are in a workspace (folder or GDB), into the field as a Name in python. I know this is easier in modelbuilder by adding %Name% in ...
1
vote
1answer
27 views

How to Set Label Expression Using a Long Field Type in Toolbox

What I am hoping to be able to achieve with this Tool within my Toolbox is to allow the user to input a number of layers and to set all of the labels with the same font settings (font style, color, ...
2
votes
1answer
39 views

using arcpy to get all database names within a server?

I am trying to populate a folder with ArcSDE database connection files for all the databases within a server instance. I need to be able to do this for several of our servers. Although I know within ...
0
votes
2answers
47 views

arcpy calculate string field: Any ideas what how to fix this?

I'm trying to store a string value obtained from a loop through a tuple into a field called ROW_1. The code goes like this: for creekclass in listOfClassTuples: (classname, Permanency, ...
2
votes
2answers
106 views

How can you alter label styles (font, color, size, etc.) using Python scripting? (ArcGIS 10.2)

I am trying to write a python macro that will automate the process of labeling points in a layer based on different types of apartments. For example, one style of apartments would have a blue square ...
0
votes
0answers
32 views

mxd.saveACopy(outMxd) not working

Getting an intermittent error. I'm opening an MXD, modifying, and then trying to save out with a new name. I think it's because the output MXD name is similar to the input MXD name. Note that I ...