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

learn more… | top users | synonyms (7)

1
vote
2answers
149 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
42 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
160 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
81 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
238 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
92 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
48 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
253 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
30 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
26 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: ...
0
votes
2answers
82 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
126 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
51 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
33 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
85 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
28 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
57 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 ...
1
vote
2answers
251 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 ...
2
votes
1answer
45 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, ...
0
votes
2answers
43 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. ...
0
votes
1answer
75 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" ...
3
votes
1answer
84 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
58 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 ...
0
votes
2answers
86 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
29 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 ...
0
votes
4answers
54 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
63 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 ...
1
vote
1answer
44 views

Using ArcGIS Feature Compare in ArcPy?

I am trying to write a script partially in ArcGIS ModelBuilder and adding an if statement on my own. It uses the Feature Compare tool in arcgis and I want to use the result.getOutput in an If ...
0
votes
1answer
40 views

Broken Project Data Source

I have built a Script Tool (from a modelbuilder model) in ArcGIS 10.2 which works perfectly fine in ArcGIS. However, I am getting the following error message when I try to publish this script tool ...
3
votes
2answers
75 views

Creating Feature Class in ArcPy gives RuntimeError?

I am new to Python. I am trying to create a new Feature Class within a long script but before I do so, I am running it separately to make sure I have the syntax correct. The code below mimics the ...
0
votes
0answers
31 views

How to test if a point shapefile is in a raster in ArcMap using Python?

I have a shapefile where the features are points. It should be about 500 points. All of this points are on top 5 different rasters. Some points are in one raster, but some others are not. I need to ...
0
votes
2answers
53 views

Iterating field calculations in arcpy

I was successful in adding multiple fields but had trouble running multiple field calculations in a loop. Now what I want is loop through these existing fields listed in mult_fields variable and fill ...
0
votes
1answer
72 views

Writing shapefile field values to txt file using SearchCursor? [closed]

I'm having trouble finding a way to write the output of a SearchCursor function to a txt. file. I can print it just fine in a format that is desirable. I just don't know how to get from there to a ...
1
vote
2answers
86 views

Speeding up Python code to convert multiple csv to shapefile?

I am trying to work with some crime data from https://data.police.uk/data/ The data is organised in several .csv files, one for each month and each crime is geocoded with Lat and Long. As the file ...
2
votes
1answer
63 views

Accessing selected features in the sublayer output from tracing geometric network

I have a geometric network setup with stream lines and water users. I am trying to use arcpy to automate tracing downstream of each node/junction in my geometric network to get userIDs for all ...
0
votes
1answer
22 views

Listing geodatabases in local SQL Express Workgroup ArcSDE using ArcPy/Python? [duplicate]

I would like to create a list of the multiple geodatabases that sit in my local SQL Express Workgroup SDE server. I have set up a connection using the "Database Connections\Connection to ...
2
votes
2answers
218 views

ArcGIS Python Script Tool Field Name Drop Down?

I have a python script that checks file path names for corresponding files in a drive location. All of the inputs were originally hard coded, and it works well enough: import arcpy import os ...
0
votes
1answer
48 views

Parsing error with in ArcPy code

I have the following code in Python for a tool I want to build. For some reason I viewshed don't exist in the folder I have chose (out). Also when I am trying to define the output workspace every time ...
2
votes
1answer
46 views

Determine the number of fields of a certain field type there are in an input feature class

So I am wondering how to get the number of field types "String" by creating a custom function? Can anybody point me in the right direction? I have a shapefile named streets and there are 73 field ...
0
votes
0answers
20 views

How Show shp Selected [duplicate]

I need help with code to know if a SHP a MXD this selected or not. I have the following code which only shows me all shp'sy layers are in the layer , I need a list if there is a selecionado shp, ...
1
vote
2answers
84 views

Replicating Summary Statistics tool with case field using own calculation within ModelBuilder?

I thought this would be a simple problem to solve, by my googling hasn't provided the answers so far. I have created a near table (Using the 'Generate Near Table' in Arc) comparing two sets of ...
0
votes
0answers
35 views

Using ArcPy Insert Cursor with NEXTVAL of Oracle sequence?

I have the need to be able to set a value of a gdb table to the NEXTVAL of an Oracle sequence. I have to be able to do this through an ArcPy function that will also handle setting the ArcPy OBJECTID ...
0
votes
1answer
40 views

Arcpy processing pairs of shapefiles

I have a problem I need to figure out but don't have idea how. I have two separate directories with shapefiles. In dir 1. shapefile names are like 1.shp till 1000.shp. And in dir 2 W1.shp till ...
0
votes
0answers
85 views

using arcpy.UploadServiceDefinition_server to publish to portal

I'm using arcpy.UploadServiceDefinition_server() to publish SD files to a server that is federated with portal. Using this ESRI Documentaion I am able to publish the service to a specific folder on ...