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

learn more… | top users | synonyms (1)

4
votes
2answers
122 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 ...
1
vote
1answer
41 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
57 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
40 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
45 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
41 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
39 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
74 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
57 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
48 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
110 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
37 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
63 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
158 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
29 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
41 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
44 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
50 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
59 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
59 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
18 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
75 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
54 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
70 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
52 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
35 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
43 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
60 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
102 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
76 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
26 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
94 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
21 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
91 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
57 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
134 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
156 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
125 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
40 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
58 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
69 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
76 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
43 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
28 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
335 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
24 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
52 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 ...