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

learn more… | top users | synonyms (7)

0
votes
0answers
8 views

Sublayers do not exist or are not supported in the geoprocessing tool?

I'm trying to batch export selected layers that I drag and drop in the tool that I've created by a selecting feature class. It's working when features are input from the source and layers in TOC. ...
1
vote
0answers
88 views
+50

ArcPy - Get number of intersected points based on attribute

I am trying to get a number of points in polygons based on row values, and write them into attribute table of polygons. I have polygon (Zones), and points (Objects with fields such as schools, ...
0
votes
0answers
15 views

using arcpy.SearchCursor for multivalue field [on hold]

I need to make a multivalue field to be selected as:   Input_Features = arcpy.GetParameterAsText (0) Num_Pop = arcpy.GetParameterAsText (1) And be calculated for each field chosen Num_Pop a ...
0
votes
1answer
33 views

Which is the faster way to copy data to another feature class: Feature Class to Feature Class or Insert Cursor

I have a feature class with 1 million records. Which is the faster way to copy data to another feature class: Feature Class to Feature Class or Insert Cursor?
0
votes
0answers
15 views

How to symbolize 3D polylines segements? [on hold]

Using ArcGIS, I created 3D polylines by extending the sample code here: ESRI Sample Code import arcpy # A list of features and coordinate pairs feature_info = [[[1, 2, 5], [2, 4,10], [3, 7,25]], ...
1
vote
2answers
14 views

Arcpy label white color

I have this label expression within a function that works great. I want to turn the color to white. lblClass.expression = '"{}" + [OBJECTID] + "{}"'.format("<FNT size = '10'>","</FNT>") ...
1
vote
1answer
2k views

Using a Select By Location in Python and Calculating a field based on what State Plane a point falls in

Here's what I have so far. Do I need to make another feature layer based on the selection? import arcpy arcpy.MakeFeatureLayer_management(r"PATH TO THE POINT", "point_lyr") ...
0
votes
2answers
27 views

Arcpy Select by attributes IN operator with Tuple

I have two layers 1. Buffer zones with a string ID 2. the same buffer zones with the String ID plus an extra field call it zone B *this process is taking place within a loop already, just to give ...
0
votes
0answers
32 views

How to know when a program finished when they run in background? [on hold]

I'm using ArcGIS 10.2 to create an interface. I'm using Python 2.7 to call and run Gams in background using: import subprocess ...
2
votes
0answers
38 views

Reading Jp2 compression level using ArcPy?

Is the compression quality level used to create a JPEG2000 image stored somewhere inside the file, and how to read it? I would like to know if my images where generated using a lossless compression ...
3
votes
3answers
2k views

Labeling features and converting them to annotations with ArcPy?

how could I do the following steps with arcpy: right-click on the layer with the features Label Features Convert Labels to Annotations ... The annotions should be saved in a new shapefile. How ...
1
vote
1answer
2k views

Automate converting labels to annotation in ArcMap at multiple scales? [duplicate]

I need to be able to convert labels to Annotation feature classes at multiple scale levels for both address and street data. Similar in concept to generating tiled layers for a web service, I have 5 ...
3
votes
0answers
29 views

using arcpy to convert labels to annotation [duplicate]

I am trying to use ArcPy to convert a specific shapefile in my TOC to annotation in the map. I am not so much in the need for the tiled annotation tool that I've seen talked about as this is going to ...
1
vote
1answer
22 views

Zonal Statistics ArcMap 10.4

I have a problem using Zonal statistics in python using ArcMap 10.4. This is a completely random error, and I have no idea what to do. Some back ground is that I have been running a script doing ...
1
vote
1answer
490 views

Error in Select Numeric type column in pyodbc with ArcCatalog?

I created a python script that uses "pyodbc" plugin to connect a SQL Server database and write out data. It was imported in an ArcGIS 10.1 tool and run from there. try: arcpy.AddMessage('FLAG 0') ...
1
vote
1answer
30 views

Finding tool to divide polygon into specific areas in ArcGIS?

I am using ArcGIS 10.3.1 and am trying to divide a polygon into several smaller polygons based on a percentage. I have found a theoretical answer How to divide a polygon into specific sizes using ...
0
votes
1answer
78 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', ...
11
votes
2answers
4k views

Efficiently selecting related records using ArcPy?

Below is the code I'm using to replicate the "related tables" button in ArcMap. In ArcMap that button selects features in one feature class or table based on the selection of features in another ...
2
votes
2answers
9k views

Debugging ImportError: No module named arcpy?

I have written a script and am trying to run it in Python IDLE 2.7.6. I first try to import arcpy, but I get an error message saying "ImportError: No module named arcpy". Why doesn't it work? ...
0
votes
1answer
51 views

Update rows based on other rows as script tool?

I am trying to convert python script to tool. Tool would update row values based on other row values. For example, if in row One values are Water, Rivers, Streams, in row Two, updated values would be ...
6
votes
4answers
2k views

Count number of attributes for unique field values in ArcGIS for Desktop? [on hold]

Running ArcGIS 10.1 for Desktop, I have two feature classes in a geodatabase. One is a point FC for polling stations, the other is a polygon FC for states. The polling station FC contains over 1000 ...
2
votes
1answer
648 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 ...
4
votes
1answer
79 views

Converting python script to toolbox?

I am trying to convert my plain python script to script in ArcToolbox to share, where user can set input data (in this case, feature class). Unfortunately, Converting Python (ArcPy) script into tool ...
8
votes
2answers
2k views

Calculating Date Field with 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 ...
0
votes
2answers
38 views

Change text\ font size element using Arcpy

I try to change the font size and the element xy position of text element for several maps. Right now the font size is 21.79 and the xy position is: elm.elementPositionX = 8.204 elm.elementPositionY ...
1
vote
1answer
959 views

Debugging Select By Attribute tool within loop giving ERROR 000358: Invalid expression Cannot acquire a lock?

I have seen several similar posts related to this technique but I am still having issues. The following script is intended to select all points from one shapefile that are within the boundaries of a ...
5
votes
2answers
76 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), ...
9
votes
1answer
4k views

Cast arcpy result as an integer instead (arcpy.GetCount_management)

I am trying to get a number by counting how many points are in a shapefile. And this works (I think), except I then am running into trouble using that number somewhere else. Eventually, I'll be using ...
1
vote
2answers
269 views

how to find that two polygon boundaries are connected?

I am working on a Geo database where there is a layer with many polygons. i want to find that which polygons boundaries are connected so that i can create new layer from that polygons and which ...
4
votes
1answer
56 views

Nested Con statement arcpy

I am trying to combine three conditions into one con statement line: ndvi_adjusted = Raster(ndvi_raw) * 0.004 - 0.08 con1 = Con(Raster(ndvi_adjusted) >= 0, ndvi_adjusted) con2 = Con(IsNull(con1), ...
1
vote
1answer
322 views

multiple shapefile export to kml

I 'm new in Python script and i want to export shapefiles in the folder as the kml file with define layer files. for single shapefile it work perfectly refer below script. But I want to export 4 ...
0
votes
1answer
961 views

ArcPy SelectLayerByAttribute Error and how to control GP output layer name

I have a rather long script that first references an SDE feature class (non-versioned) to perform an attribute selection based on a SQL selection. I've been unable to figure out why the script will ...
2
votes
1answer
30 views

Exceptions for invalid files/ filenames that already exist in database

The script below is functional, but it runs into issues if it comes across duplicate files (even when overwriteOutput=True) and corrupt shapefiles when running feature to feature. Are there ...
3
votes
2answers
118 views

Optimizing arcpy.da.Walk performance?

I'm trying to automate a workflow that currently costs a co-worker about 45 minutes. General run down is this person copies files from a network drive onto a local one, and process it through four ...
1
vote
1answer
50 views

Calculate Field throws an error when parsing python with backslashes

I have an FTP I need to access through a python script. It works fine with forward slashes, but I don't need it to be read as an html. Below are both sets of code: Working: ...
7
votes
3answers
452 views

Performing Feature to Point (no advanced license) using ArcPy?

I have a set of polygons I have calculated the centroids of, but am having trouble finding a way to output these values to a point shapefile. I dabbled with arcpy.MakeXYEvents_management, but it only ...
0
votes
1answer
23 views

Feature Class to Feature Class using os.walk, fnmatch and renaming

I have a script for traversing a directory tree and finding shapefiles with a particular name. The issue I'm having is that the shapefiles are named improperly for databasing i.e. ...
0
votes
1answer
15 views

How so I solve FDO error: 0?

I used python add in to make a tool bar in Arcmap that edits features on a map. It works on a file geodatabase, but not on an ArcSDE version one. I've been getting an FDO error: 0. The potential ...
3
votes
1answer
2k views

Converting Python (ArcPy) script into tool or toolbox script?

I've written a simple python script that allows me to quickly create a copy of a template Mxd, pointing to different shapefiles. The user specifies the new location, a name for the new mxd, then the ...
1
vote
0answers
23 views

Exporting Data Driven pages as JPEG with World File

I have a script that works to export my pages as jpegs, but I want to add the world file to them. I don't want to have to do all the {df} args and whatnot, I just want to skip to the world file. How ...
0
votes
2answers
26 views

Arcpy fails to refresh page layout after changing the definitionQuery of a layer

I am trying to automate an export of map images in JPEG format. My script creates the map and exports it, but the export does not honor the changes made to the definitionQuery of the layer in the map ...
0
votes
0answers
34 views

Authenticating to ArcGIS Online Server with ArcObjects / python

Below is working script that outputs a layer file from an arcgis Server feature service (AGOL or AGS) I am struggling to implement the authentication needed to access the secured services in AGOL. ...
2
votes
1answer
301 views

Unsupervised raster classification using GDAL

Is there an equivalent in GDAL to the Arcpy ISO data unsupervised classification tool, or a series of methods using GDAL/python that can accomplish this?
0
votes
1answer
206 views

Extracting, stacking and calculating Standard Deviation from NetCDF (.nc) to produce single standard deviation and Mean image in ArcGIS for Desktop?

I have a NetCDF file for several years of monthly Climate data ( Precipitation,PET,Temp,etc) data from CRU 3.22 (Climate Research Unit). I want to extract a subset of the dataset namely 2000-2010. And ...
1
vote
2answers
45 views

Why can't I open this workspace?

I used python add in to make a tool bar in Arcmap that edits features on a map. It works on a file geodatabase, but not on an ArcSDE version one. I've been getting an FDO error: 0. The solutions that ...
3
votes
1answer
48 views

Creating one layer through use of SQL queries for land use categories

I have a map with about 63 grids and trying to determine the land cover user category of the greatest area size in each grid. The land cover categories have been converted to polygons and I already ...
1
vote
1answer
30 views

Finding correct service for arcpy.createArcSDEconnectionFile_management in ArcPy?

I'm working on a toolbar for modifying an SDE database in acrmaps. My code works in a file geodatabase so I'm trying to use this function to make it work in an ArcSDE. I've gotten every other variable ...
2
votes
1answer
650 views

arcpy export - unable to set exact extent of dataframe

I am trying to use arcpy's ExportToPNG function to produce tiles for Nasa WorldWind, which will require very specific extents of outputted tiles. Pretty simple code - abbreviated below: mxd = ...
1
vote
1answer
20 views

Checking availability of ET Geowizards license

I would like to run a script that uses some tools from the ET Geowizards toolbox. I have a valid license for it but sometimes the license server at work is off. If the server is off then some of the ...
0
votes
0answers
22 views

from lxml import etree; ImportError: DLL load failed: %1 is not a valid Win32 application

I am attempt to automate report writing within ArcMap with a program utilizing python-docx. Can anyone explain what this error means and how I should go about fixing it? from lxml import etree ...