A site-package created by Esri to expose GeoProcessing from ArcGIS to Python.

learn more… | top users | synonyms (7)

1
vote
1answer
96 views

Using arcpy.GetParametersAsText() into Text file? [closed]

I've just started using Python for ArcMap. I'm trying out a script that works before I put arcpy.GetParameterAsText(0) into it. Does anybody know what I'm doing wrong? (I put the parameters on the ...
0
votes
0answers
16 views

Nested Set Model for Spatial Data?

How can I create a nested set model for a spatial line dataset? The nested set model is a technique for respresenting hirarchies of a tree (see https://en.wikipedia.org/wiki/Nested_set_model). If ...
0
votes
1answer
20 views

How to export joined feature classes without losing field name?

I want to export a feature class uisng arcpy that join with other feature class.I use the below code to join and export feature class. The problem is that field names of the result feature class have ...
0
votes
2answers
40 views

How to edit the capabilities with python when publishing map services

Publishing map service the normal way is done here using arcgis desktop. But I decided to do it with python so I can automate the process or something like that but first off I need to edit some of ...
1
vote
1answer
80 views

How to set up geoprocessing tool and geoprocessing service to produce downloadable output in Web AppBuilder

I want to create a simple application in ArcGIS Web AppBuilder which uses geoprocessing service to generate output file. I have a simple Python script which generate a TIFF image from a complex map ...
1
vote
1answer
43 views

Set up definition query with variable

I am writing a script which supposed to get a value for a field from user and use that value for a definition query. If I write it without variable, it works: my_Layer.definitionQuery = ...
2
votes
2answers
158 views

Terminology for distinguishing ArcPy installed with ArcGIS 10.x for Desktop from that which comes with ArcGIS Pro?

ArcGIS Pro uses Python 3 whereas the other ArcGIS for Desktop applications (ArcMap, ArcCatalog, ArcScene and ArcGlobe) use Python 2 and the changes introduced with ArcGIS Pro were significant ...
2
votes
1answer
65 views

Add/Remove Relate using ArcPy without ArcGIS Pro?

I am trying to add a relate between 2 feature classes so that I can use the area of the related table to update a field in the original table. I found that ArcGIS Pro ...
1
vote
1answer
55 views

Invalid parameters using ArcPy dissolve and statistics_fields

I am trying to use the Dissolve_management tool using ArcPy. I keep getting an error that reads "Parameters are not valid.", and I cannot figure out where I am going wrong. Here is the code: ...
0
votes
2answers
42 views

clipping or masking a raster by individuale polygons in a feature layer

I have a shape file(polygon) layer consisted of 4 polygons and I have a raster. I want to calculate statistics for every raster part which is beneath any of these polygons. I tried the following ...
1
vote
1answer
50 views

Raster processing in ArcPy seems to “simplify”/“round” my resulting values

I'm working off a DEM and doing some raster algebra with it (real simple, add this decimal value, then divide by this value). The DEM in question is super high resolution LiDAR, that's both spatially ...
0
votes
0answers
34 views

Finding duplicates of same point in feature class and only keep maximum of field using ArcPy?

I have a feature class with fields: Latitude, Longitude, Type, Magnitude, City, State, Comment. If Latitude, Longitude , and Type are the same, I only want to keep the record with the highest ...
0
votes
0answers
33 views

ERROR 000358: Invalid expression Failed to execute (SelectLayerByAttribute)

My python script in ArcMap has an initial dialog box with two inputs: REG_CODE (values are in a list and include 'AKR', 'IMR', 'NER', etc) and Selection_type which offers 'NEW_SELECTION', ...
1
vote
0answers
23 views

Trying to automate clip for multiple polygons based on unique field ID? [duplicate]

I have two feature classes, one that contains all counties for 5 states and the other contains 90 polygons I need clipped only to their pertaining county boundary, but they overlap/ cross the county ...
0
votes
1answer
37 views

arcpy: I would like to join a .xls table to a .shp table using two common fields

arcpy: I would like to join a .xls table to a .shp table using two common fields, instead of one common field. Is this possible in ArcGIS using python?
2
votes
1answer
24 views

Arcpy.addTable() error

I am having a little trouble debugging an ex-coworkers code. I was wondering if the SE community could be another set of eyes and help me. I am receiving this error: RuntimeError: FieldMappings: ...
0
votes
0answers
86 views

Geprocessing Service: ERROR 000816: The tool is not valid. .Pyt file is fine but .tbx has red x's

I have a .pyt Python toolbox which runs fine in ArcMap and then gives the dreaded "ERROR 000816: The tool is not valid" when published as a GP Service. I've dealt with this issue many times before, ...
1
vote
0answers
52 views

Calculating areas in metric units on polygons that are stored in geographic coordinate reference system using ArcPy?

If one uses arcpy to calculate areas for a field in metric units on a polygon shapefile in a geographic coordinate system it will work, and give you plausible results. According to the documentation ...
1
vote
2answers
27 views

arcpy select points - chessboard style

Could you please help with selection problem. I have about 1000 of shapefiles. Each shapefile has points located in a rectangular net. But size of that nets (and as a result number of points) differ ...
3
votes
3answers
137 views

Forcing Python Toolbox tool to break loop and do cleanup when user clicks Cancel?

I am writing a Python tool that perform heavy tasks in a loop. When the user clicks "Close" I want to break the loop, perform some cleanup, and then finish. Consider this example tool that counts ...
0
votes
1answer
23 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 ...
1
vote
0answers
50 views

Replacing text.element from feature class value using ArcPy? [closed]

Sorry every one for my old confusing post which i have deleted. I have corrected by code from the help mentioned below about using search cursor as shown in the image.
0
votes
1answer
68 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
28 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 ...
0
votes
3answers
91 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
66 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
63 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
50 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
21 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
54 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
45 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
46 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
30 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
39 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
24 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
18 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
57 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
148 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. ...
3
votes
1answer
42 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
73 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
18 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
41 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
30 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
159 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
80 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 ...
1
vote
3answers
236 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
51 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", ...
1
vote
2answers
91 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 = ...
0
votes
0answers
28 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
47 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 ...