A site-package created by Esri to expose ArcObjects to Python.

learn more… | top users | synonyms (1)

4
votes
4answers
453 views

How to get arcpy to work with Anaconda?

I am trying to follow the step-by-step directions in the answer to "how to separate Python installation with ArcGIS" but cannot find the path file, DTBGGP64.pth, in ...
9
votes
2answers
3k views

Is there a ArcGIS python script development API?

I'm a somewhat experienced software engineer new to the GIS world. I started working on a GIS project that supports ArcGIS 9.3 and 10.0 and looking through existing code it looks like the main ...
0
votes
1answer
15 views

Creating Tkinter dialog box in arcpy?

I would like to create a dialog box which pops up when the user click on a button from a Python Add-In toolbar. The user will navigate to their preferred file and select any shapefiles they wish to ...
-1
votes
0answers
9 views

setting data frame extent set to a shapefile

I need to set the data frame extent set to a specific shapefile in my Table of Contents. I am not sure how to go about this. Some of the codes I have found deal only with zooming into a selected ...
2
votes
1answer
180 views

Is it possible to run a search cursor on a multipart feature class?

I have a multipart feature class of cities. I want to run a search cursor on a cities feature class where: one city is selected and a select layer by location is run to select all parcels that are ...
0
votes
0answers
11 views

Converting multiple File geodatabase into multiple Personnel geodatabase [on hold]

Individually I will Export the gdb to XML Workspace then import that into the personnel geodatabase and all Domains go over fine. But... Let's Say I have several file geodatabase in a folder and Each ...
0
votes
0answers
11 views

How can I create text using Python in ArcMap 10.1

I am using data driven pages to create a map book and I want to create the neighboring labels. Is there a way to create the label with a background? And when there is a NULL value in the attribute ...
0
votes
0answers
12 views

Spline tool using arcpy

Trying to use an arcpy script to operate the spline interpolation tool in spatial analyst on point data that represents soil sample points. When background processing is enabled I get an error of ...
1
vote
0answers
18 views

What is causing these streaks in my output tif using arcpy.CopyRaster_management?

This is the line of code that is creating these ... arcpy.CopyRaster_management(raster, fname, "DEFAULTS","0","","","ColormapToRGB","8_BIT_UNSIGNED") and I did have a colormap file with specifics ...
1
vote
1answer
23 views

Arcpy script- Update cursor error

This is a follow-up question to a previous post. For some reason the following script in Arcpy does not want execute the command. Please see fields and script below. (All credit to Aaron for the ...
2
votes
1answer
35 views

Arcpy.da.UpdateCursor, Error - Sequence size must match size of row

I am trying to use an UpdateCursor fill in a field but I keep getting an error, can anyone tell me what I am doing wrong? My code is below: import arcpy fc= "C:\Users\Keri\Desktop\GEP_690\Project ...
1
vote
1answer
38 views

Why is Update Cursor adding Object IDs incorrectly?

I am using an update cursor to add values in a try:except block of code using ArcPy. If the code is successful I log yes in the success field, if it reaches the except block I log yes in the fail ...
0
votes
0answers
27 views

Dissolving features by attribute(s)

How to apply ‘statistic_field’ to just one ‘dissolve_field’? I have a feature class that I need to dissolve by PageName but also by earliest year in SERVED_YEAR. So, how to apply MIN to SERVED _YEAR ...
0
votes
2answers
61 views

How to change different projections of feature classes in geodatabase to one projection in new geodatabase?

I want to create a script that iterates through feature classes with different projections in a geodatabase and exports them into a new geodatabase, all with the same projections. What I want is to ...
0
votes
1answer
18 views

ListFeatureClasses overriding ListRasters in ArcMap script

What is preventing the script from identifying the spatial reference for the .tif files? It appears that the script below lists the fc first, then gives the false spatial reference to the subsequent ...
1
vote
1answer
26 views

Arcpy: Using where clause in append_management

I would like to write a script where I select a feature class by attributes, add a field for a timestamp, and append the selected features to another feature class. My code is below; Do I need to ...
1
vote
3answers
55 views

Shapefile list gone missing in dialog window

I have updated my script in ArcGIS 10.3 to include the copyFeatures_management geoprocessing tool because I want to only copy the features that already have the same projection, not reproject them; ...
1
vote
4answers
116 views

Using Python new line (\n) with ArcGIS geoprocessing progress dialog? [on hold]

I am currently using in my ArcGIS 10.3 toolbox script; # Get the spatial reference spatialRef = arcpy.Describe(template).spatialReference.name #Loop through shapfiles in folder and reproject for fc ...
1
vote
1answer
20 views

Arcpy - handling intermediate raster files

I have 8,760 (24*365) GRID rasters in a directory. I'd like to use use FocalStatistics analysis to reassign cells to the maximum of a 5x5 window/kernel and extract the resultant values at points ...
2
votes
0answers
18 views

Making Python Add-In using tools built in ModelBuilder?

I have made a set of tools in a toolbox using ArcGIS 10.2 using the model builder. I would like to distribute them as a tool bar, and so created a ArcGIS Python Add-In I was hoping that I could ...
4
votes
1answer
48 views

Buffering Points Directionally

I have about 10,000 points that I want to apply a partial circular buffer to based on an angle, from -30 to 135°. A similar question for polygons seems to have been answered here, but I cannot make ...
0
votes
1answer
32 views

Select by location-arcpy

i work with arcview 10.3 on 20 mxd's (each mxd has 25 layers) and i try to do select by location (with arcpy) and want to see a layers that are visible in the current map extent only. All Other layers ...
2
votes
0answers
30 views

DBSCAN gives “AttributeError: NoneType has no attribute issparse”

I am running a Python script invoking the DBSCAN tool to cluster feature points. When I open ArcMap, load the feature layer, and run the script, it works the way I expect it to. But if I run it ...
0
votes
0answers
17 views

Python script can't find custom module in ArcSDE

I've been working on a python script for some time. Its working well but I'm having trouble running it in SDE. My main issue is that the python script, when run in SDE, cannot find any of the ...
1
vote
1answer
20 views

arcpy.GetCount_managment not returning result in dialog window

I am having trouble with GetCount to work in my script. It is not printing the GetCount arcpy.AddMessage in the geoprocessing window dialog; # Get the spatial reference spatialRef = ...
0
votes
0answers
17 views

Arcpy - Updating fields using time.localtime()

My objective is to change the values under field "DATE_IMPOR" which are currently set at to the current time using time.localtime function. I'm having some problems getting there, above all one line ...
1
vote
1answer
23 views

Clipping rasters

We are clipping one raster to another and our teacher gave us this hint for the 2nd parameter "Remember that the Describe function returns an object. The Clip tool will need the string representation ...
0
votes
2answers
47 views

Placing message in geoprocessing progress dialog?

I am after a way on using arcpy.GetMessage to achieve the following message in the geoprocessing dialog result window?; The above 4 datasets have been reprojected to: WGS Web Mercator (auxiliary ...
0
votes
1answer
45 views

Using the mouse to select records in ArcPy

I am running ArcGIS 10.1 Basic license with Python 2.7.2. I have a two spatial files: the first listing vessel positions and the second activity on board. I also have a collection of reports in ...
3
votes
3answers
753 views

Why does import arcview/arceditor give gp.setProduct() RuntimeError: ERROR 999999: Error executing?

I am developing a script that will be used in ArcGIS Desktop 10.2 of Standard (formerly called ArcEditor) license level and thus importing arceditor to make sure I don't use GP tools that require ...
3
votes
1answer
351 views

Selecting raster values at random locations in a raster in python/arcgis

I have a large dataset of integer rasters, and was hoping to find a way to generate a "random" selection of pixels for four of the rasters, while making sure all 5 classes, which I've specified based ...
2
votes
2answers
27 views

Assigning Default Value Using ModelBuilder?

Task: add several new fields to a feature class table and assign a default value to one of the fields. Software/Environment: Using ArcMap 10.2 (Advanced License) and Python 2.7. Data is stored in ...
1
vote
0answers
26 views

ArcGIS/arcpy: add field to table iteration

I want the average precipitation for 50 regions in my country for each hour. To do this, I have built a arcpy script that performs 50.000 iterations (hours) over .nc files. The result of each ...
5
votes
3answers
3k views

Clipping raster by multiple datasets or polygons?

I would like to clip a DEM using a grid of polygons. It's probably easier to use multiple polygons in one shape file, but I haven't managed this so I'm trying to use a for loop so I can loop through ...
0
votes
0answers
25 views

Import addresses from an Excel file via Python for route optimisation

relative newbie here. Apologies if this is very obvious or basic! I have created a route optimisation model through ArcGIS modelbuilder, then exported the Python script. Within the model I had a ...
9
votes
2answers
918 views

ArcPy method to determine ArcMap document version

Is there a way with ArcPy to identify the version of a Map Document (MXD). I am working on a solution to inventory our MXD's and would like to know if a document is 8.1, 9.2, 10.0, etc. I am ...
0
votes
0answers
9 views

Error when loading ST_Geometry into SQLite

I have created a new .sqlite database running the arcpy code in ArcGIS 10.3 (with Python x86): import arcpy sqlite_database_path = 'C:/Data/Counties.sqlite' ...
-1
votes
1answer
62 views

Rewriting VB codeblock as Python for ArcGIS Field Calculator?

I am looking for assistance to rewrite my VB codeblock into Python. Im on Win7, Arc10.2 and Python 2.7 The code below works fine for me, I am simply looking to port it to Python so i can progress down ...
1
vote
2answers
35 views

Adding shapefile names in message to progress window/dialog of ArcGIS for Desktop from ArcPy?

How do you use python in a ArcGIS 10.3 script to list/print the shapefiles with a message from the result of a geoprocessing tool in the progress window/dialog box. For example; abc.shp 1234.shp ...
1
vote
1answer
192 views

Copying XY to clipboard using Python Add-In (ArcMap)

I am trying to create a simple tool to copy XY from where i click the mouse button. What i have done already is: create add-in files using Python Add-In Wizard create toolbar and tool inside it in ...
0
votes
2answers
62 views

Add in copyfeatures into script

I am having trouble with CopyFeatures in my script. The files went being copied to the output folder. Can someone please assist. Here's a snippet of my script for ArcGIS 10.3; #Loop through shapfiles ...
0
votes
1answer
22 views

AttributeError: Result object has no attribute save (when trying to save output in separate directory)?

I am trying to convert more than 100 ascii files to raster using python code. All the lines (except Last two) in my code presented below is successfully converting Ascii to tif format in the working ...
0
votes
1answer
22 views

Using search/update cursor of features based on other values or feature [on hold]

I have a workflow with the following scenario when consuming a web-service. This script runs every 5 minutes and I have a time variable to consume all data that has been added to the service between ...
0
votes
0answers
4 views

Turn-off layers in Arcscene using python [duplicate]

I am trying to turn off the layers in ArcScene when a sxd file is opened. sxd files are not supported by arcpy mapping. Is there any other way to use python for the same? Previously I was doing this ...
1
vote
3answers
65 views

Removing filepath from ArcGIS geoprocessing result?

This is my python script code in ArcGIS 10.3; projectResult = arcpy.Project_management(fc, outFolder + "\\" + fc, template) #Name of shapefiles re-projected arcpy.AddMessage(projectResult) ...
2
votes
2answers
691 views

Clip_management to raster extent outputs larger raster than raster extent

Using Python and ArcMap 10.0 SP5, I'm trying to reproject and clip a large input raster to exactly the same grid as a smaller target raster (same extent, pixel sizes and projection). The problem is ...
2
votes
0answers
24 views

ArcSDE reconcile versions and keep edit version in its current state

Reconciling versions makes both target and source(s) point to the same state. I have an arcpy script that essentially will create a version from a parent of the db - in a state that is empty - adds ...
0
votes
1answer
31 views

A script that only deletes fields within an attribute table specified by the user

I would like a script that will be executed in ArcGIS that only deletes fields within an attribute table that are specified by the user. As I understand it, this can be done in Modelbuilder but was ...
1
vote
0answers
15 views

Python Script to iterate numerous, single-band rasters for arcpy.CompositeBands

I have a large collection of single-band geotiffs (NIR, Green, and Red) that I would like to composite using a Python script. The goal is to iterate through multiple folders in a main directory, ...
0
votes
1answer
24 views

Combine string and OBJECT ID

I would like to update the Map_Feature_ID field with a String " WP_" and then follow the "WP_" with the OBJECTID field. So I will end up with "WP_1", "WP_2" all the way to the end in the Map Feature ...