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)

5
votes
2answers
97 views

SQL MAX Subquery in arcpy.MakeFeatureLayer_management

I am having an issue with subsequent subqueries in making a feature layer in arcpy. My table has fields: OBJECTID, pointid (long), grid_code (double) I can successfully extract MAX(grid_code), ...
2
votes
1answer
53 views

Arcpy make raster layer function does not produce right output

I am trying to extract bands within rasters: import arcpy arcpy.env.workspace = 'd:/Rstack' raster_list = arcpy.ListRasters("*RADIOMETRY.tif", "TIF") list1 = [] for i in raster_list: arcpy....
0
votes
1answer
64 views

Python Script to update all feature classes/datasets in gdb with search and update cursor?

I have two geodatabases, one is a production sde database, the other is a backup in a local file geodatabase. The script runs as a task once a month and is very resource intensive. I am using ArcGIS ...
3
votes
1answer
121 views

Using erase tool in Python?

I am trying to create a python scrip to batch erase shapefiles. I have created a script that works, however, I know there is a better way and I just am not good enough at scripting to figure it out. ...
3
votes
2answers
72 views

Alternative to 'Editors Merge' feature using Arcpy

I'm looking for a work around that has had me in a pickle for sometime. It involves combining a multi-part feature polygon into a single feature. Obviously if you were editing a shape you would select ...
1
vote
0answers
29 views

Prevent ModelBuilder Tools From Running if Published to ArcGIS Server

I'm looking for a way to prevent an ArcGIS ModelBuilder tool from running if it's been published to ArcGIS Server. Or, even better, for a way to prevent the tool from being published to Server in the ...
1
vote
1answer
34 views

Is it possible to make an installer for a published tool, to install the tool to someone else's ArcGIS server?

I have a geoprocessing tool that works on my instance of ArcGIS for server. Is there a way to easily install this on someone else's Server, without having them run the tool and publish it through ...
4
votes
1answer
75 views

Time Delay in Importing ArcPy

I've got a few on demand scripts via the web that run ArcGIS in the background via Arcpy. Now, every one of these scripts takes a solid 15-30 seconds to run, which I find okay. After doing some trial ...
0
votes
1answer
23 views

Arcpy TabletoExcel input error

I have a very big dataset in a gbd. I would like to export it to an excel file. I use the following code: startingP = r"C:\Directory\ArcGIS\By_Coding.gdb\MyInput" endingP = r"C:\Directory\ArcGIS\...
3
votes
1answer
67 views

How to use search cursor in a given extent

I want to perform a selective search cursor for a feature class for a given extent. I have tried setting env.extent in the below code but it is returning the whole feature class instead of a fixed ...
-1
votes
1answer
50 views

How to aggregate a list of raster in Composite Bands arcgis

I created a list of raster using ListRaster. However, composite band tool does not support list input. I want aggregate the list of raster into one raster, is there any other tool to do it in ArcGIS(...
3
votes
1answer
43 views

Select Features within a distance and direction

Is there a way to select features in a layer by location based on their proximity to another feature and the direction? E.G., select all features within 10 meters north of current selection? I am ...
1
vote
0answers
55 views

Can a map be added to a report generated through ExportReport using Python?

I am currently able to generate a PDF report using arcpy's ExportReport that contains attribute information for records within an attribute table, but is there a way to add a map to that report, as ...
1
vote
0answers
37 views

Arcpy ApplySymbologyFromLayer color problems with extent

I am batch automating PDF maps with many overlapping layers and many different symbology colors. When the map is zoomed far out- two of the layers, lets call it line1 (the only blue layer) and line2 (...
1
vote
2answers
113 views

Python script to check if feature class exists in geodatabase if not convert feature class to feature class

I would like to check in one geodatabase and list the feature classes that are in it; check another geodatabsae for the list of feature classes, if they do not exist in the 2nd geodatabase then ...
1
vote
1answer
58 views

How to add a script tool in a toolbox without the Add Script Wizard?

I have been put on a project where I need to modify and optimize an existing PythonToolbox and associated Toolbar (each button calls a script). I want to add a new script tool in there but the Add ...
1
vote
0answers
25 views

How to cut polygons to fit grid ArcGIS 10.3

I have a map that displays the distribution of different types of karst all over the US. The different types of soil are portrayed through polygons. I've also created a grid that divides the US, and ...
2
votes
1answer
56 views

Change which default python install runs .py scripts a the command prompt

I have 3 installations of python on my machine currently, the ArcGIS install, the QGIS install, and an Anaconda install. The Anaconda is the on that I use predominantly. If I run a .py script (...
4
votes
1answer
54 views

Change entire label style after certain extent

I need to design a dynamic label in ArcMap that changes its entire style after a certain zoom extent. The research I've done suggests to me that there is currently no way to use VBscript to manipulate ...
2
votes
1answer
68 views

Implementing UpdateCursor?

I previously asked Updating attribute information about this script last week. I have amended it and am confused. I need to write the ADMINAREA value to the empty LOCALITY fields from TWB_Suburbs to ...
3
votes
1answer
47 views

Defining a required output field parameter for an existing or a new field

I need to define a required field parameter, and I'd like it to work with both existing and new fields, i.e. regardless of whether the field already exists. The problem is, if I enter a new (non-...
2
votes
1answer
73 views

Python script hanging forever in Pycharm with import arcpy?

I'm trying to get arcpy to work in Pycharm. I've done this successfully in the past. However, now when I try to do anything involving arcpy in Pycharm, the program runs then hangs forever. I have it ...
1
vote
0answers
24 views

Creating new feature class in ArcPy gives error 000210? [closed]

I am trying to create a new attribute table and I keep getting the same error. import os import arcpy import math folderpath = 'C:\Users\Michaelf\Desktop\GEOG M173' arcpy.env.workspace = folderpath ...
1
vote
1answer
37 views

Populating Fields in Table with GUIDs from Feature Class?

Is there a way to add GUIDs from a feature class to a table based on specific attributes? I have a large maintenance record table that is tied to specific points through the GUID of that point. I have ...
1
vote
1answer
30 views

Correlating 3 data sets and extracting information from each in ArcGIS for Desktop?

I am currently trying to find a way to correlate 3 separate datasets as point shapefiles. I would like to import all three shapefiles, and apply a 5 metre buffer to each point. Then, for each point,...
4
votes
1answer
109 views

Error when using arcpy.ArcSDESQLExecute() to connect to SQL Server - ArcGIS 10.4

I am able to connect to a MS SQL Server 2012 geodatabase with the arcpy.ArcSDESQLExecute() when using the .sde connection file pre-created in ArcGIS. I am not able to connect to a MS SQL Server 2012 ...
5
votes
2answers
104 views

How to export an mxd using python without opening it?

I would like to be able to update a load of pdf and jgeg maps once the data has been updated. Currently people have to open each mxd and export the map in each format. I've written a short python ...
4
votes
1answer
79 views

How to get fieldnames in a value table depending on the input value

I would like to add a parameter as value table with one of the fields being a value list. The value table consist of 3 columns, namely "table","field","description", whereas "field" is a value list. ...
0
votes
1answer
42 views

after to make join between 2 tables a field is not recognize [closed]

I made join between two attribute tables with a common field and then I tried to use python to read a field and now field is not recognized on the new table.. Is it normal? How can I solve this ...
1
vote
1answer
39 views

How can I test if a layer is using SDE

I find that when things are not working as they should repairing the geometry on everything is a good first point of troubleshooting so I run a few lines of python: mxd = arcpy.mapping.MapDocument("...
0
votes
0answers
30 views

Invoking-command in powershell 2012 (remotely) for ArcPy errors but local cmd or python shell work

I've written a data update script that works really well, it deletes a target feature class and uses the feature class to feature class geoprocessing tool to copy data from SQL 2012 into it's ...
1
vote
1answer
68 views

Arcpy update cursor: stop iteration error

I have 1 csv with municipalities and their corresponding zip codes and a GDB of houses which contain address, municipality but no zip codes Objective: add the zip codes to the GDB table import csv ...
3
votes
1answer
29 views

TypeError in Script Tool [closed]

I am currently recieving this error: TypeError: unsupported operand type(s) for -: 'float' and 'NoneType' arcgis for line 22: invert_out = updateToRow[2] Could anyone explain why this is happening? ...
2
votes
1answer
42 views

Tabulate Area produces weird results

I have a raster of land cover (resolution roughly 300x300 m) and a raster grid of zones (cells about 14000x14000 m). What I need is to calculate the precentage of each land cover category within each ...
-3
votes
1answer
32 views

Insert layer using Arcpy- Code error [closed]

I'm trying to add "roads" layer to all the maps that do not have this layer in the table of content, by using this code: import arcpy,os,sys,fnmatch from arcpy import env env.workspace = r"G:\...
1
vote
1answer
53 views

Deleting features with arcpy on ArcGis SDE 10.0 SP5

I am new to ArcGIS and arcpy and am learning largely through trial and error. Anyway, the overall task is to delete, edit and add rows to feature classes. I thought it would be good to start with ...
2
votes
1answer
74 views

How to add my own algorithms to ArcGIS toolbox [closed]

I want to implement and test some algorithms for line generalization tool in ArcGIS software by Python programming, but I do not have any access to its tool bar script. My question is, how can I add ...
1
vote
2answers
58 views

How to insert layer excluding MXD files using arcpy?

I'm working on 24 MXD files. Several maps include "roads" layer in them, the other maps don't have this layer. I'm trying to add "roads" layer to all the maps that do not have this layer by using this ...
3
votes
1answer
80 views

Updating attribute information

I need to write a script that updates the "LOCALITY" field in a feature class if it is empty with the suburb it is in. I have identified the number of properties with select by location and the ...
3
votes
2answers
60 views

ArcGIS Script Tool RuntimeError: cannot open 'GPL0'

I Cannot find what this error means or what could be causing it? Script worked until I added the lines under "Set map label to containing quad name". My environment is ArcGIS 10.1 SP1, Windows 7. Here ...
1
vote
2answers
153 views

Python Script to iterate through folder and copy all feature classes in MXDs to new file geodatabases?

I have a folder and would like to iterate through each MXD and take each SDE feature class that is in it and place in a new folder and file geodatabase, with a new MXD using the file geodatabase paths....
2
votes
1answer
32 views

Script Tool Automation of Search and Update Cursor?

I keep recieving the following error: RuntimeError: An invalid SQL statement was used. [SELECT [ID_NUMBER,COLLECTION,COLLECTED_,COLLECTI_1], OBJECTID FROM OFFICIAL_STRUCTURES2015] import arcpy as ...
3
votes
1answer
110 views

Calculate Field using variable in arcpy

I've got a problem with my script and hope that someone can help me. What I´d like to do is using the field calculator to calculate values for a field using values from another field and a variable ...
2
votes
1answer
46 views

How to add “Edit with Pyscripter” back to the Windows context menu?

Using Windows 10 64 Bit, ArcGIS for Desktop Advanced, ArcGIS Pro 1.2 I use PyScripter pretty extensively, and after I installed ArcGIS Pro (which installs Python 3), I noticed that I can no longer ...
1
vote
1answer
29 views

Arcpy: Insert a text if filed is empty

I want to run a python code that, if 4 fields are empty, insert in the first of them a text. The fields are all designed to contain text. My code is: import arcpy import xlrd import numpy import ...
0
votes
1answer
58 views

Using InsertCursor and SearchCursor with Nested Loops

I have a script that's parsing through text within each record of a table/field, and inserting those values into field/records of another table. Here's an example of the text being parsed (from "...
0
votes
0answers
19 views

aggregate Grouplayer to one result in arcpy same as Identify result

how can I merge the Grouplayer into one result same as Identify result in arcpy? My grouplayer has multiple featurelayer with different geometry types. What is the best method for doing this? ...
1
vote
1answer
42 views

Determine data format from file names

I was given the data which is arranged in folders as shown in the following picture I am using ArcGIS 10.1. I believe feature dataset in ArcGIS only exist in geodatabase. But the datasets are ...
3
votes
1answer
94 views

Distance between points along polyline ArcGIS for Desktop (pt. 2)?

I read over the solution in Distance between points along polyline ArcGIS for Desktop? and I have a slight variation of that problem: I need to find the distance of each red point (transformers) from ...
2
votes
0answers
32 views

Creating a Legend with arcpy and comtypes

I am relatively new working with python and arcobjects. Under normal limitations I know that you cannot create a Legend or any arcobject with arcpy.mapping. Is there a generic example of creating a ...