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

learn more… | top users | synonyms (1)

0
votes
2answers
51 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
36 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
40 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
34 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
32 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
70 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
2answers
49 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
44 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';" ...
-3
votes
1answer
104 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
32 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
59 views

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

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
128 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
26 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
39 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
42 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
38 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
51 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
52 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
17 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
69 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
47 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
4answers
62 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
51 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. ...
0
votes
3answers
34 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
41 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
52 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
83 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
54 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
24 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
81 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
20 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
80 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 ...
0
votes
1answer
51 views

Extracting from attribute tables by arcpy

I'm having some trouble connecting ideas on how to solve a problem. What I have is a shapefile from which I have to extract from one field, which contains 3 types of attributes (BS, RS, BRN). For each ...
0
votes
1answer
111 views

Python geoprocessing tool for ArcGIS online

I am looking to create a geoprocessing tool using python in arcGIS 10.2 that will be used in the ArcGIS online web app builder. This will be my first tool for a web application and I would like some ...
-1
votes
4answers
149 views

arcpy search cursor not working

Im running my script in ArcGIS 10.2 and the dialog window says completed, but the empty fields in the 'SoilsType' row of the 'mSoils' Feature Class aren't getting populated with the values from the ...
1
vote
0answers
91 views

Import shapefiles into PostGIS using Python with psycopg2

I want to import shapefiles to PostGIS using Python with arcpy & psycopg2 to connect to PostGIS. I don't want to use the existing shapefile loader nor ogr, just write my own import tool. My steps ...
1
vote
1answer
35 views

Using “calculate field” in python script fails to display Arabic characters correctly

Using “calculate field” in python script fails to display Arabic characters correctly. I have exported the modelbuilder to python script, but unfortunately the Arabic characters cannot by displayed ...
4
votes
1answer
57 views

How to check spotheight in closed polyline contour data using ModelBuilder or ArcPy?

I'm new in using ModelBuilder or Python script. So, i have a set of contour data and a good contour data should contain a spotheight* in every closed polyline contour data. Is there any solution to ...
1
vote
1answer
57 views

Using layer file to apply symbology to shapefile with ArcPy?

I have code that doesn't work at the moment: # Import arcpy module import arcpy # Script arguments Input = arcpy.GetParameterAsText(0) if Input == '#' or not Input: Input = "frame" # provide a ...
0
votes
1answer
60 views

Error 999999 “The table already exists” “No spatial reference exists” when using “import arcserver”

I'm hoping someone can help me understand why I'm getting this error. I have a python script tool that throws this error when it is run through the task scheduler: Traceback (most recent call ...
0
votes
0answers
14 views

Using a layer file to apply symbology to shapefile [duplicate]

I have code that doesn't work at the moment: # Import arcpy module import arcpy # Script arguments Input = arcpy.GetParameterAsText(0) if Input == '#' or not Input: Input = "frame" # provide a ...
1
vote
1answer
61 views

why does my script not save a layer when it encounters a “ \” character in the string

i have some code that takes a field and finds every unique value in that field. it then creates a layer for each unique value. The code is working ok , but it is failing when there are \ characters ...
1
vote
0answers
40 views

Are there any conditions that could break the creation of an arcpy.Polygon object?

I have a script that generates a mesh network from vertex and centroid inputs, and it works for almost all my points. But for some records that get created in the feature class via the script, their ...
1
vote
1answer
27 views

Most efficient way to retrieve pixel distributions inside many polygones (custom zonal stats)

I want to get the distribution of pixels from a 1 band raster that fall in each polygon of a shapefile to proceed to some statistics. I guess a zonal statistics does it in some kind of way but I need ...
1
vote
1answer
52 views

What defines where the files will be saved?

Hi I have a script I am using to save out layers automatically I have posted another question here ArcGIS creating individual layers for unique attribute in a given feild. Limitations of Where ...
2
votes
1answer
320 views

Change field names automatically

I have an attribute table with over 2500 fields. About 2000 fields start with the name "All_txt_" (eg "All_txt_Watermelon"). Is there a way to remove this "All_txt_" from all the fieldnames ...
1
vote
1answer
22 views

How to make a loop for select by attribute?

I am trying to pull out a sample out of a geodatabase file. I have 100800 sample and I need to select 28 records, basically every 3600, I am going to start with FID=0 and go from there. Unfortunately ...
1
vote
1answer
46 views

Exporting shapefile to csv with cursor

I'm trying to export a shapefile to a csv file using a cursor. I found this quesion asked and answered here: Exporting table to XYZ ASCII file via ArcPy? However I only want to export several ...
2
votes
2answers
54 views

Controlling default value of arcpy.AddField_management

I have a large collection of shapefiles that use text fields to hold numerical values. I have created new fields, and populated them with the numerical equivalent of the text field. When adding the ...
0
votes
0answers
59 views

UpdateCursor not iterating as desired, updating erroneously

(EDIT BELOW WITH WORKING CHANGES) I have a script in which I am trying to compare attributes in row n to row n+1. If all the attributes match, I want row n+1 to have a field ([Modifier]) updated to ...