A site-package created by Esri to expose ArcGIS for Desktop (and ArcGIS Pro) geoprocessing, mapping, etc, to Python.

learn more… | top users | synonyms (8)

0
votes
1answer
41 views

ArcPy function for changing data source server properties inside mxds?

Is it possible to change the parameters highlighted in the screenshot below? If so which ArcPy function would do this? I know about and do not want to use the function that references .sde files on C:\...
0
votes
1answer
102 views

Debugging error 999999 from Python Script using feature layer?

I'm attempting run a calculate field for a feature layer that I'm creating in this tutorial. I can't seem to set it up to run though. ERROR ...
0
votes
0answers
32 views

Concatenating unique fields in ArcPy?

In ArcPy, I want to concatenate 16 fields, but just when they are unique. You can view the example at the table below. I am using ArcGIS 10.2 for Desktop. I tryed this code fc="...\...
0
votes
3answers
344 views

Iterating Intersect_analysis over polygon shapefile using ArcPy?

I am using ArcGIS 10.3.1 for Desktop and I have two shapefiles: A set of stream (vector line) data A fishnet of polygons I want to know, for each polygon in that fishnet, what the total length of ...
1
vote
2answers
163 views

Checking if SQL where clause is valid with Make Feature Layer?

Unfortunately it's possible to apply an invalid SQL where clause when using arcpy.MakeFeatureLayer_management. This can cause issues later in a script. For example, I created a feature layer and ...
-1
votes
1answer
78 views

ArcPy - layer.Describe not working across MXDs

I am using the following code to determine if something is selected within a layer: if arcpy.Describe("layername").FIDSet: It is working fine and running the following code when I first open ...
0
votes
0answers
59 views

Mass ArcPy GDB Load

Looking for a best practice for loading mass quantities of data into an Oracle GDB using ArcPy. I'm attempting to load ~10 million records of Polygon and Point shape data into a GDB (~5M per table). ...
0
votes
0answers
22 views

Python Merge Error After Spatial Join Loop [duplicate]

I'm running into an error saying my Dataset doesn't exist when trying to merge a number of buffers that had be run through a Spatial join loop. I named my variables with the correct path(and double ...
1
vote
1answer
142 views

Change length of string fields in featureclass using arcpy v10.1

I am trying to edit the length of all the text fields in a feature class. The feature class has a lot of fields so I want to do this in python. I only have access to v10.1 so cannot use the ...
0
votes
1answer
88 views

Spatial Join Loop

I have a series of buffer polygons that I need to perform a spatial join on to get overall counts within the buffers. I can do this by copy and pasting the spatial join script over and over and just ...
0
votes
1answer
101 views

HyperLink Script ArcGIS 10.3

I am trying to write a script (python) to open an external exe file on the server once I click on a feature in ArcGIS. The script must have 2 parameters in namely FacilityId and UserID. The exe file ...
1
vote
1answer
60 views

Creating a menu interface to update an sde feature class in ArcMap using arcpy?

I work in electrical utilities and we have stacks of paper records that need to be updated into an existing SDE feature class attribute table. My problem is that someone in the city's GIS office would ...
0
votes
0answers
44 views

Creating custom toolbar from field calculator scripts

I am new to Python and have a few simple scripts I have created by saving code I entered into the field calculator. They are all .cal files and was wondering if it is possible to add these directly to ...
0
votes
0answers
36 views

arcpy.mapping.UpdateLayer error when 'symbology_only' set to 'False'

I'm writing a python script tool that finds and replaces a layer in a set of MXDs in a folder. It creates a sub-direcory containing the new set of MXDs.The original MXDs are not changed. The user ...
0
votes
0answers
26 views

SearchCursor to find a feature that intersects 5 of another feature?

I am using ArcMap 10.2.2. Currently my code looks like this: count = 0 features = arcpy.da.SearchCursor(fc, subtype) for feat in features: if feat == (100161,): count += 1 print count ...
2
votes
1answer
100 views

Getting different results using Select by Location with ArcPy vs ArcMap

I have two different layers. One layer contains features that are supposed to sit directly on top of features in the other layer. With ArcPy I'm doing a SelectLayerByLocation with "ARE_IDENTICAL_TO" ...
1
vote
2answers
420 views

How to select by attribute and loop through values to GetCount per month with ArcPy?

I would like to write a script where I select a layer by the [District] attribute and loop through the field [PickUpDate] to get the count per district per month. My month format is m/d/yyyy, i.e. 1/...
3
votes
1answer
69 views

How to create checkboxes to select multiple inputs?

I am working on a script (to publish as a geoprocessing service) that will take multiple feature layers and use them as inputs to the ExportCAD_Conversion tool. What I ultimately want is a set of ...
1
vote
2answers
92 views

ArcGIS 10.2 Python-addin Zipfile locked

I made a Python-Addin-Button with the function to create a zip. Everything works fine, but after creating the zip-file, the zipfile is locked, when the mxd-Project is open. Any suggestions why I can't ...
0
votes
0answers
37 views

Looping all features of cursor onto SQL Server feature class?

It might be me but I've been experiencing something weird. (I actually tried what suggested in this thread Arcpy MakeFeatureLayer won't loop with no luck) What I'm trying to accomplish is to use ...
1
vote
1answer
77 views

Making table from MySQL query with ArcPy?

I am trying to interact directly with data from a MySQL database in ArcMap using Python. So far, I have successfully connected the database using the MySQLdb.connect() function and have successfully ...
0
votes
1answer
33 views

Parcel Owner to see only his parcel in map application

How can i create a map where user can only see his parcel. parcel are defined has one unique ID. I have Arcgis online Server and Desktop Advanced license. the map to be published in a web application ...
3
votes
2answers
198 views

Problem creating parameters for a tool

I am still an arcpy newbie, but I think I have a basic understanding of fundamentals including syntax, variables, modules, etc. My question is regarding the usage of parameters while creating a tool. ...
0
votes
1answer
199 views

ArcPy and File Geodatabase Character Encoding

I have a JSON file containing special characters, which can be represented in Unicode. However, as soon as I export that JSON file to a file geodatabase using arcpy, the special characters all "break,"...
3
votes
3answers
495 views

why is python toolbox script not working standalone in PyScripter?

I am learning Python Toolboxes with PyScripter. I have a test python toolbox that outputs a raster file. It works when run from ArcCatalog. As I understand it, it should also run standalone within ...
0
votes
1answer
66 views

Crash/error in ArcPy using Create Random Points?

I'm trying to deal with an odd crash that occurs irregularly in arcGIS's arcpy, specifically under the create random points tool. This occurs under ArcGIS 10.1 to 10.3. During "CreateRandomPoints", ...
2
votes
2answers
466 views

RuntimeError: cannot open “feature class” with SearchCursor?

I have a very simple script that isn't working. import arcpy workspace = "C:\\Users\\Work\\AppData\\Roaming\\ESRI\\Desktop10.3\\ArcCatalog\\master.sde" arcpy.env.workspace = workspace wire = "gis....
0
votes
0answers
41 views

ArcPy to select the location of two layers

I am very new at using python for geoprocessing I have a buffer layer 1 with a distance of 5 from each point I have a buffer layer 2 with a distance of 1 away from each polyline How do I show all ...
0
votes
0answers
60 views

Python for validating domains

I need to create a Python code for validating domains compared to another set of domains. The initial premise here is taking Collector data, downloading the attributes, and comparing certain domains ...
5
votes
1answer
304 views

Using Python to discriminate Personal Geodatabases and MS Access Databases

I need to list a server's geodatabases, to analyze and process them. My users are however creating both personal geodatabases and MS Access geodatabases. Listing mdb files reports both types of ...
0
votes
1answer
35 views

Writing only final raster with intermediate bands going to disk using ArcPy?

I have a raster with 4 bands. I would like to create a new raster (its individual bands called new_band) from this raster (its individual bands called old_band) in with : new_band1 = old_band1 * 2 ...
1
vote
1answer
28 views

Arcpy CalculateField not working on ArcGIS Server 10.0

I'm working on ArcGIS 10.0 sp5. I have a very strange behaviour. In an arcpy script I have these two very simple commands, to add a field "ID_UDF" to a table and then fill it with a value: arcpy....
0
votes
2answers
117 views

Python FeatureClass To Geodatabase conversion Issue

When I run this part of my code, I get an error that says the parameters of the MakeFeatureLayer are not valid. However, when I run the first half of this script (the first try/except) and then run ...
3
votes
2answers
225 views

Setting input parameter to be float for Python script tool?

I made a Python (2.7.8) script, where one of the parameters is height (float) and I wan to make tool in ArcGIS 10.3 now. However in data type list there is only double. If I input integer value into ...
1
vote
1answer
65 views

Arcpy scripts freeze on reaching a certain level on big datasets

I have a geodatabase with 300 featureclasses with around 4.5 million features in each featureclass. I am updating each featureclass with a value calculated through an algorithm. The IDLE ide for ...
0
votes
1answer
52 views

Delete tables from SDE including archive-tables

I want to delete some tables from my SDE as well as some featureclasses located in a feature-dataset. As some of those tables and featureClasses are enabled for archiving I get both the base-table/FC ...
1
vote
2answers
120 views

Error adding row - sequence size must match size of row

I have this table with one row timestamp_pretty 3.1.2014 9:13 timestamp 1,38874E+12 msgid 3 targetType A mmsi 205533000 lat 53.4346 long ...
0
votes
2answers
32 views

What is wrong with this code? my query is not updated with the new value [closed]

query='"depth">1700 AND "depth"<1750' with arcpy.da.UpdateCursor(out_layer,"depth",query)as cursor: for row in cursor: row[0]=0 cursor.updateRow(row)
1
vote
3answers
170 views

Find Max Value and next highest two in Column using ArcPy?

I have a piece of code where I am able to find the max value. How can i edit this code to find the second largest, and then the third? I found this code here (https://geonet.esri.com/message/237880#...
1
vote
2answers
265 views

Random Value Generator

I have a python code where I am trying to assign a unique, random value to every row. I have tried: maxvalue = int(arcpy.GetCount_management(shape).getOutput(0)) + 10000 for row in arcpy.SearchCursor(...
2
votes
1answer
68 views

Only Black & White text in Python editor in ArcGIS for Desktop?

When opening IDLE or Pyscripter in ArcGIS by right clicking on a toolbox and Edit... the specified editor opens with the code - BUT all text is only black and white not the context colors of blue, red,...
0
votes
2answers
126 views

Using Select By Location in ArcPy?

How do you create a new feature class from the select by location tool in python? This is my script that works but I just don't know what the next step is. arcpy.SelectLayerByLocation_management("...
0
votes
1answer
108 views

Invoking Context-sensitive Help for Python AddIn Button?

In an experimental Python AddIn that I've created using ArcPy from ArcGIS 10.3.1 for Desktop I have put some test help into my config.xml for a button called Button4: <Button caption="Button4" ...
4
votes
1answer
188 views

Setting “Always run in foreground” within ArcPy code?

Is it possible to set the "Always run in foreground" option within ArcPy code? I haven't found anything on this yet? It would be nice to be able to specify within a script, instead of through the ...
1
vote
3answers
70 views

Clip one folder of shapefiles by another with same name endings

I have two folders with shapefiles: r'E:\SO\Polygons' and r'E:\SO\Districts' Within each folder I have 215 shapefiles named with similar naming conventions: poly_100 or dist_100. I need to clip the ...
1
vote
2answers
153 views

Symbolizing polygon fill color based on HTML hex color attribute value in ArcMap?

I have a set of polygons that I need to symbolize with a certain color. I have an column in the attribute table that contains the contains the html hex color value (#FF0000 Red) that I want the ...
1
vote
1answer
37 views

Fill a field according to the value of an other field with Arcpy

I am very ill at ease with Python. I am working on ArcGIS 10.3. I am working on a table in a gdb. I want to fill an empty field of this table with an expression (words) according to the value of a ...
1
vote
4answers
75 views

When to use ArcPy over ArcMap GUI?

I've recently began trying out basic geoprocessing tools by using arcpy (clipping layers, buffering, etc). However, this seems slower than using the ArcMap GUI. Are there any advantages to using ...
0
votes
0answers
74 views

New to Python and going through GIS Tutorial for Python Scripting

I'm following the Tutorial directions and I've tried some alternative approaches but PyScripter keeps coming back with the exception message: Process did not complete. try: #Import Python ...