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

learn more… | top users | synonyms (1)

1
vote
1answer
17 views

Export attributes of shapefiles into text file

I'm trying to export attributes of multiple shapefiles a text file. I am multiple getting errors when I run my code not sure what the issue is. Any direction as to where to start to fix this would be ...
2
votes
1answer
10 views

Setting Two Definition Queries as Parameters in Python Script tool causes: RuntimeError: LayerObject: Set attribute definitionQuery does not exist

I created a script that adds definition queries to every layer in an mxd depending on the layer name. This worked fine as a stand alone script, but when I try to use it as a script tool with ...
1
vote
1answer
38 views

Getting index of active data frame in ArcPy?

I am a little surprised to see that there seems to be no way to get the index of the active data frame in ArcPy, or did I miss something? For example, what if you want to add a tool’s output to the ...
0
votes
1answer
28 views

Deleting output shapefiles which have no data/features using ArcPy?

Still working on cleaning this up but it runs fine. Below is the rough code for a tool that iterates through field rows and clips accordingly to that row's shape. Everything outputs nicely but there ...
1
vote
2answers
39 views

Can you access all tools in python/arcpy regardless of license level?

Is it possible to write a python script using arcpy that is for a tool not included in the current desktop license level? For example, write something using the Identity Tool when you only have a ...
0
votes
1answer
21 views

Python Script to batch compress .tif files using LZW compression

I am currently trying to batch compress a folder of .tif files using LZW compression in order to free up storage space. I've been using this script in ArcMap's python window, adapted from here: # ...
2
votes
2answers
78 views

Trying to re-project a folder of shapefiles using Python Script

I am trying to reproject multiple shapefiles in a folder. When I run my program this is the error I am getting: line 8221, in Project raise e ExecuteError: Failed to execute. Parameters are not ...
0
votes
2answers
35 views

Python Script to Add Multiple Fields to Feature Classes

I am trying to add 2 (multiple) fields to each feature class in a gdb. I based the script off of Python Script to Add Fields to Feature Classes. I feel like I am missing something and can't figure ...
0
votes
1answer
12 views

How to combine two rasters based on the relationship to a polygon mask?

I am looking to combine two single-band, 1-bit rasters of the same spatial extent based on their relationship to a polygon (mask). The image shows a polygon displayed with a cross-hatch and the two ...
0
votes
0answers
31 views

Using Spatial Join to copy a single attribute

I am attempting to use Spatial Join to combine tax parcels and zoning information, such that the parcels contain the designation of the underlying zone. However, I only want to take the "esmZONE" ...
2
votes
1answer
51 views

SelectLayerByAttribute and Where Clause

I'm trying to select the minimum value from a field to select and export that one feature to a temp shp so I can copy the field data from the point to a line. So far I have this: import arcpy from ...
0
votes
0answers
25 views

Error 010092 for FeatureToRaster in Pythonwin

would someone be able to help me with this problem. As shown the process works for three files (of approx 1000) and then throw the Error 010092: Invalid Output Extent. All the files have been ...
0
votes
0answers
35 views

Display Geoprocessing results of Python Script [on hold]

I have a python script that batch processes shapefiles to reproject them. I would like to include in my script some code that prints the processing results to the shell. I'm not sure what block of ...
-1
votes
0answers
37 views

Using Cursors in Python to Create ratio of area to length in attribute table? [on hold]

I am very new to both ArcGIS and Python and I am currently working on a problem I cannot seem to figure out how to do. I am trying to insert a table which has calculated the area to length ratio ...
3
votes
2answers
64 views

Looping field name change

I need to alter all of the field names through multiple feature classes. I have a pretty good idea of which tools to use but I'm not sure how to loop them through each feature class and each field. ...
4
votes
2answers
80 views

How to randomly move points?

I have a feature class with a large amount of points. My purpose is to randomly move these points to see what happens as a result. Are there specific tools or Python programming methods to accomplish ...
0
votes
0answers
20 views

ExportToPNG with definition query for unique values?

I have a MXD with a layer that has a field that has many values. I need to export multiple layouts to PNG, applying a definition query to show the unique values for that layer. i.e. Just show the ...
0
votes
2answers
37 views

Using SQL query with ArcPy?

I'm creating a tool that when you type in the city name it will select the city, zoom in and label it. I have the zoom and label working but can't figure out the SQL Query needed to select the city I ...
0
votes
0answers
23 views

How to geocode automatically through ArcPy without runtime error?

How to geocode automatically through ArcPy? My code always runs into runtime error. # Import system modules import arcpy # Set local variables: address_table = "C:\Users\Sibo\Dropbox ...
0
votes
0answers
25 views

Error when kriging: “output variance prediction raster”

I am trying to run a python script for kriging, but keep getting a following error message. It doesn't make any sense as the output variance prediction raster is optional. The code: # Create ...
2
votes
0answers
18 views

How to run Focal Stats on specific values in python

I'm a beginning programmer and am new to the site but it has helped me quite a bit so thank you! I'm trying to recreate a raster calculator operation using python scripts but am having a hard time ...
1
vote
1answer
26 views

ArcCatalog and python crash when running ConvertTimeField_management

I have a script which reclassifies a tif file, adds a new field to the tiff, and is supposed to parse the date from the filename and add it to the new date field. Everything works as it should, ...
0
votes
1answer
57 views

Geocoding arcpy slow startup time

When scripting with arcpy.GeocodeAddress_geocoding (http://resources.arcgis.com/en/help/main/10.2/index.html#//002600000006000000), there's always a major lag to start up the geocoder. The issue here ...
1
vote
1answer
18 views

Keeping layer name when exporting to CAD?

I am trying to export selected features from layers from SDE into a DXF using python, but it does not retain the layer name. But if I do it manually using the ArcToolbox tool, it does work. Example ...
0
votes
0answers
34 views

Perfom SQL queries in Python and process the result

I query column names from a PostGIS table with following Python code: colnames = [] sql_getcolumns = "select column_name from information_schema.columns where table_name='shp2py';" ...
-2
votes
1answer
83 views

Python script with ArcPy cursors won't stop looping?

I am running my script in ArcGIS 10.2 for Desktop and it doesn't stop processing. The process is overwriting itself because I have to shut down ArcMap manually. How can I stop the overwriting as its ...
0
votes
0answers
20 views

How to set floating point raster values to NoData when raster does not have valid statistics

I have a raster with some values of 99999 that I want to set to NoData in Arc 10.2.2. I've tried using the SetNull dialogue box, the SetNull arcpy function, and the Raster Calculator dialogue box as ...
3
votes
0answers
30 views

Field Calculator convert text to integer then populate new field with sum

I have a .dbf with about 50 text fields containing numerals, I would like to convert those to integers and then sum them all in a new double field I created, is there an easy field calculation that ...
1
vote
1answer
47 views

Add Item and Publish Service with ArcREST or ArcPy

I would like to have an automated process which does the following: Adds a CSV to our portaL/AGOL organization account. Publishes the item as a hosted feature service. Consumes hosted feature back ...
1
vote
1answer
14 views

Time.Sleep between arcpy.mapping.ExportToTIFF in Data Driven Pages

I'm building a code in Python to export in geotiff my imagery. I need specific spots so I created a Data Driven Pages with polygons. Everything works fine, except that my imagery layer takes a long ...
0
votes
0answers
28 views

arcpy fails to retrieve queried data from a layer using arcpy.da.SearchCursor

I am attempting to retrieve rows of data from an attribute table using arcpy. I have used a definition query on the data in ArcMap so that only one feature is present in the attribute table. I then ...
0
votes
2answers
41 views

Using Arcpy to search geodatabase for feature with smallest number of rows and export as .SHP

I have created a bunch of grids for a city boundary area. I would like to know how to use the Arcpy module to look through a geodatabase and find the grid with the smallest number of rows (assuming ...
0
votes
1answer
25 views

Find and Replace python script to replaces values in attribute table? [duplicate]

I am working on a stand alone script in python that will allow to me to specify a shapefile and being able to find a value and replace it with a new value. Does anyone know what code will allow me to ...
1
vote
2answers
42 views

Add folder name as attribute to all shapefiles in that folder

I have many folders with shapefiles in each of them. I want to use python to go through each folder, add a new field to all the shapefiles containing the folder name. Any ideas?
3
votes
0answers
24 views

Set picture marker symbol for a layer with arcpy (ArcGIS)

I have an ArcGIS map document with one layer symbolized with Categories > Unique values. I want to update symbology for this layer by specifying a path to a picture marker symbol for every unique ...
0
votes
0answers
16 views

Using a layer file from dropbox in ArcPy

Im wondering if anyone has had any luck using a layer file in ArcPy that is hosted remotely on something like Dropbox I'm trying to do myLayer = ...
-1
votes
1answer
60 views

searchcursor only takes first value in field

My script ArcGIS 10.2 is using the searchcursor to read the mLanduse feature class to return the value in lField, but it is only returning the first value in lField to populate the sField in mSoils. ...
0
votes
1answer
33 views

Using arcpy.mapping.ListLayers() with no filter, but some layers are missing in list

I am trying to use arcpy.mapping.ListLayers() to access and change some of the properties on specific layers in my mxd prior to printing to PDF. Here is a screen cap of my layer list: When ...
1
vote
2answers
36 views

Create Statewide Hydrologic Soil Group Map

This may be better for Engineering? Not sure. Background: Previously I have downloaded SSURGO soil data for the state of Pennsylvania by downloading each county and merging the shapefiles. I then ...
0
votes
1answer
49 views

Creating multiple fields with ranks using ArcPy?

While figuring out what I have to do, practically creating a field for each arrondise, and in each, rank each FID (which are part of the respective arrondise) by the size of its shape area. ...
-1
votes
0answers
47 views

Different ArcPy behavior in tools between ArcGIS Pro and ArcGIS for Desktop? [on hold]

I'm using ArcGIS Pro and ArcGIS 10.3 for Desktop. I made a python script where I projected several rasters with arcpy.ProjectRaster_management . Before projection the script set an extent (env.extent ...
0
votes
3answers
23 views

Ranking values by shape area using ArcPy

I'm trying to make a script that performs the following: it creates a new field that will hold values based on size of the shape area (from 1 to end of table), basically ranking them. I have a few ...
3
votes
1answer
37 views

When are the Workspace and its subfolders accessible in arcpy tools

I am wondering when I can access the workspace and its subfolders with Arcpy tools (using ArcGis 10.2). I have a raster in following directory: E:/folder/sub1/sub2/sub3/raster.tif Now I set the ...
0
votes
3answers
39 views

Creating layers for each attribute value via Arcpy script

I'm having some trouble starting this script. Not sure how to start, as I have to create/output layers for each attribute value from a certain column named that has integers. They are all unique ...
1
vote
1answer
45 views

Spatially Joining Many Shapefiles. Use Spatial Join or UpdateCursor?

I have a large number of tree records in 100s of point shapefiles. Each shapefile contains a number of trees that fall within 10-50 parcels. The parcel layer contains ~60,000 shapes. For each point ...
0
votes
1answer
37 views

Removing Slivers/Holes From Polygons using ArcGIS for Desktop?

I have a village level shapefile. Using Dissolve_management, I collapse the villages to district level. I also use Multi_Part option to prevent multiple entries for same polygon and so the resulting ...
0
votes
0answers
11 views

RuntimeError: ERROR 010240: Could not save raster dataset to G:\GHY_568\project\FlowDir_beth1 with output format GRID

import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension("Spatial") env.workspace = r"G:\GHY_568\project" #mystery_creek = r"G:\GHY_568\project\Mystery_Creek.shp" ...
0
votes
1answer
32 views

How to change output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script found in this post? import_path = r"..." # Path of .mxd ...
0
votes
1answer
17 views

How to specify raster name and how to designate the saved name of a created raster

import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension("Spatial") env.workspace = r"G:\GHY_568\project" mystery_creek = r"G:\GHY_568\project\Mystery_Creek.shp" ...
2
votes
0answers
57 views

arcpy.Delete_management does not delete the directory

I got a problem with Delete_management when I use the FeatureclassToCoverage_conversion function. I don't know why in the gdb I use (arcpy.env.scratchGDB), while the Delete_management is working, the ...