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

learn more… | top users | synonyms (7)

3
votes
1answer
36 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 ...
0
votes
2answers
26 views

Change text\ font size element using Arcpy [on hold]

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
265 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
45 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
318 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
28 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
117 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
48 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
449 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
20 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
9 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
14 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
0answers
19 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
2answers
25 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
32 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
205 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
41 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
647 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
16 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
19 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 ...
3
votes
1answer
32 views

arcpy label function string formatting

I have this function works totally fine. But i want to be able to change the font size def label(wah, field): for lyr in arcpy.mapping.ListLayers(mxd): if lyr.name == ...
3
votes
0answers
30 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 ...
0
votes
1answer
20 views

Eps files from map export are not containing a vector image

I have made a custom map export service, which exports my map in a range of formats. However I have noticed that .eps files, exported using the arcPy function: arcpy.mapping.ExportToEPS(mxd, ...
0
votes
1answer
20 views

Arcpy label function

I have this function for labeling layers using arcpy This function works totally fine but I have the field hardcoded into the function def label(wah): for lyr in arcpy.mapping.ListLayers(mxd): ...
1
vote
1answer
31 views

Arcpy Freezing on Field Calculation

I am trying to populate a grid with the number of features in each grid cell. I've gotten this script to work with a subset of the data, but when I try to run it on the full (52,000+) cell feature ...
3
votes
1answer
34 views

Clear combo box in ArcMap Python Add-in

Recently created my first Python Add-In for ArcMap. It has been deployed for about a month now and the users like it. There is one thing I want to fix. The Add-in has two combo boxes: In #1 the ...
0
votes
1answer
180 views

arcpy.mapping.Export creates some labels but not others

I've created a simple python toolbox (pyt) to export map layouts to multiple formats. My problem is that some labels which are defined in the layout are exported, but others are not. For example ...
5
votes
2answers
657 views

Randomly select a record to update using arcpy.da.UpdateCursor

This question is related to Correct usage of a counter using arcpy.da.UpdateCursor. What I would like to do is use a cursor with a where clause to select a number of records. For each row, the values ...
6
votes
1answer
514 views

Pause ArcPy script until feature class lock goes away

My script needs to copy data into a feature class to an SDE geodatabase that might have a lock on it from another application. I shouldn't break the lock (that app has priority over a data update), ...
9
votes
4answers
4k views

Python script - how to avoid exclusive schema lock error?

I have a script for updating some features on my database every night (just for copying and replacing some features). This features are "read-only". My problem is that I can't avoid that these ...
-4
votes
1answer
315 views

Handling ArcPy locks in Python script?

i am writing script which uses different Tools of arcgis and implementing different functionalities .. My script consists in different Functions running in an order. Each function is connected to ...
1
vote
1answer
28 views

Splitting shapefile into features and keeping attributes

I want to split a shapefile so each feature becomes its own shapefile. The below works: with arcpy.da.SearchCursor(catch10, ["FID", "SHAPE@"]) as cursor: for row in cursor: out_name = ...
3
votes
1answer
179 views

Export Stretch Function values - Arcpy

I'm looking for a way to export Stretch Function values from images that’s stored in a Mosaic dataset. Not values from the whole set, but specific stretch functions per image. The set is stored in ...
0
votes
0answers
28 views

Cannot get python-docx to work with Custom Tool : DLL load failed: %1 is not a valid Win32 application

I am currently using ArcMap 10.2, Python 2.7, and Anaconda aka SPYDER to make my output code populate a Microsoft word report. When I use the custom script tool this is the error message I receive: ...
1
vote
1answer
33 views

ArcGIS ArcPy update attachments table rows

Some background: We were using Collector on Android to collect data for a layer, and we found out that the pictures that were attached contained no EXIF tags at all, including the orientation tag - ...
3
votes
1answer
104 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. ...
0
votes
0answers
17 views

Using ArcPy to compare two feature classes and export deltas

I would like to use a Python script to iterate through feature classes 1 and 2 and export the differences to a new table. So if feature class 1 contains 100 features and feature class two contains ...
2
votes
1answer
44 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 ...
5
votes
1answer
232 views

Can I automate the transfer of symbology information of a raster to a polygon feature?

I have a raster dataset that is symbolized using Natural Breaks (Jenks) classification (9 classes). To reduce file size for web service display and download, I used the Reclassify tool to remap pixel ...
3
votes
3answers
1k views

How to filter out multipart polygons and then buffer?

I've written a small script trying to accomplish the task described in the question title. It basically looks like: in_fc = '...' # Some shapefile goes here # Get the fields (column names) of the ...
2
votes
1answer
24 views

changing text in an MXD textbox with items from a list in ArcPy

I am trying to create a text label for a series of maps over time. I have a text box with the element name "DateBox" in my mxd. As a filler, it says "Week # here". I want to it say "Week XX", where XX ...
0
votes
2answers
61 views

What data type is excel in Arcgis Add Script wizard?

When creating tool from a python script in ArcGIS, data type has to be chosen in Add Script wizard and one of my parameters is Excel and another one specific sheet whereas there can be more sheets in ...
1
vote
1answer
181 views

Accessing bands in .pix (PCIDSK) file in python/arcpy

I am trying to perform zonal statistics on a single band from a multi-band raster in .pix format. I have things working great with a tiff file. I am able to access the bands using this code: desc = ...
0
votes
0answers
17 views

Using Python to copy the “Export Data” feature [closed]

Complete newbie here looking for some assistance. I need to convert a shapefile into a KML file and as i do this often was looking at Python to automate it. The shapefile has a join to another ...
4
votes
1answer
2k views

Create overlapping polygons from contour lines

Working in ArcGIS 10, I have a set of contour lines representing density of commercial square footage, and I have a set of points representing local maxima for each peak of the dataset. For each ...