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

learn more… | top users | synonyms (1)

0
votes
1answer
36 views

ArcGIS python script validation to update the text based on a list

I'm having issue with using validation to update an input box. Some background: I created a tool to update and resize text in ArcGIS. This is done by having a series of text elements and shape ...
0
votes
1answer
11 views

Get Shape Type of Several Shapefile with If Statement

Can you loop over a series of shapefiles with a if loop and either copy them or not? Existing code... import arcpy import os arcpy.env.workspace = r'c:\Shapefiles' outWorkspace = r'C:\Output' ...
0
votes
1answer
15 views

raster to point in batch mode using Python

I have a list of raster files in tiff format and I want to convert that tiff to point using raster to point conversion (tool of ArcMap). This tool will convert the raster into a point shape file. I ...
0
votes
1answer
140 views

How to automatically generate least-cost paths between several polygons?

What is the fastest way to automatically generate least-cost paths (LCPs) between several polygons with ArcGIS ? I created a python program to do this by using the functions "CostDistance" and ...
4
votes
2answers
66 views

Command syntax in ArcGIS python script

I'm in the process of learning to use python to automate some tasks in ArcGIS, and while I've done a couple of on line courses about python I'm still learning to use it within ArcGIS. I've had some ...
1
vote
1answer
211 views

How to add layer in Arcscene using script tool

import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "*")[0] addLayer = arcpy.mapping.Layer(r"F:\project\Final\Ground floor\steps.lyr") ...
2
votes
1answer
35 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 ...
1
vote
1answer
44 views

Add layer to mxd files ignoring specific item- arcpy

I try to add layer (abc) to several mxd files with arcpy and ignoring mxd file which called "land use" . I work with arcview 10.3 : import arcpy,os,sys,string,datetime import arcpy.mapping from arcpy ...
3
votes
1answer
213 views

Exporting records from an attribute table and placing them in a txt file

I am trying desperately to grab records in a shapefile's attribute table and copy them, with additional formatting to a txt file. Below is the code I have developed thus far: I have used the ...
0
votes
2answers
86 views

Multiprocessing with arcpy and Solar Analyst (spatial analyst)

I need help getting multiprocessing to work with the spatial analyst tool - Solar Analyst. I have tested the multiprocessing bit and it works fine. This sample is passing it a file containing 2 lines ...
2
votes
1answer
67 views

Alternative to an arcpy script for points to lines to polygons?

I'm relatively new to arcpy and python, so I feel like I could be missing something obvious in regards to tool options for what I'm trying to achieve. I have a script that creates triangular ...
1
vote
1answer
41 views

Converting multiple File geodatabase (.gdb) into multiple Personal geodatabase (.mdb)

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 ...
1
vote
2answers
1k views

Getting print statements in Python script to print through a batch file

I'm starting to learn Python and batch files. I have a Python script which selects data by location and exports the selection to a new feature class. The script runs just fine - included in this ...
4
votes
2answers
205 views

How to access raster NoData value?

I am trying to programmatically access the NoData value in a raster dataset as shown in the screenshot. Two tools that come to mind to describe raster properties do not seem to be able to describe ...
0
votes
1answer
36 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 ...
4
votes
4answers
473 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
0answers
20 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
12 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
18 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
24 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
27 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
36 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
40 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
39 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
68 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
28 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
56 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
122 views

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

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
24 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 ...
4
votes
1answer
53 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
38 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
32 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
22 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
24 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
53 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
46 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
353 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
29 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
28 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
26 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
921 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
11 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
65 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 ...