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

learn more… | top users | synonyms (1)

1
vote
1answer
238 views

Scaling DA UpdateCursor to large datasets?

I am currently having what appears to be a scaling issue with arcpy, da update cursors, and large file geodatabases. I have a piece of code that iterates through every feature in a feature class and ...
0
votes
4answers
96 views

Generate_arc — Not familiar with its usage and inputs/outputs

I'm using ArcGIS Advanced in order to generate a coverage (I've never worked with coverages before --nor ArcGIS really, know the basics, but not this). I am trying to write a python script to generate ...
0
votes
1answer
36 views

Points Solar Radiation reformat problem

I am trying to produce a set of monthly solar radiation maps based on a monthly parameterization of the diffuse proportion and transmissivity (i.e. new values for both parameters each month). The ...
1
vote
0answers
51 views

Creating sign locations from an existing database with offset & dist to nearest intersection (buffer analysis)?

I have a database of 22,000+ signs that contains the offset from centerline along with a distance to/from the edge of pavement to a specific intersecting road for each sign. I also have a street ...
10
votes
2answers
3k views

How to read an Excel sheet in ArcPy script

I'm writing a python code to convert X,Y points in excel to shapefile. In this process i have toread xy points from shhet1. What is the step i have to include in my process to read data from sheet1 of ...
2
votes
0answers
283 views

ArcPy x64 - Create Enterprise Geodatabase in SQL Server Fails

I'm using ArcGIS Desktop Standard 10.1 SP1 on Windows 7 SP1 x64. SQL Server Native Client 11.0 is installed for both 32 bit and 64 bit. I've also got SQL Server 2012 x64 installed (client tools and ...
3
votes
2answers
135 views

Should Python Add-In installed in map which is packaged be part of *.mpk?

Using ArcGIS for Desktop 10.1 SP1, I just created a map package (.mpk) from a map (.mxd) which had a Python Add-In (.esriaddin) installed. When I unpacked the .mpk the .esriaddin was neither ...
4
votes
3answers
594 views

Checking if python script is run from ArcGIS (arcmap or on server) or a stand alone python script

For debugging purposes I have created a hardcoded conditional that checks it the script is run as stand alone or as an ArcGIS tool. Is there anyway to fugure this out at run time? e.g. some ...
-1
votes
1answer
76 views

How to save a copy of the current data driven page to a new map file?

I need to copy the current data driven page to a new ArcMap Document using arcpy so that I can make sure the file name follows the naming schema that we have defined and the user cannot change. Is it ...
9
votes
6answers
624 views

How to programmatically check if the number of shapes = number of table records?

I have a handful of approximately 1000 shapefiles that are corrupted (see attached error message). The shapefiles were generated from eCognition Developer 8. There is a script tool that seems to ...
2
votes
2answers
685 views

Python script to read coordinate system of an input feature class? [duplicate]

How to read the coordinate system of an input feature class in python script. How we can use "Describe()" function and tool validator for that purpose
3
votes
2answers
503 views

How to control state of buttons in Python Add-In?

I have bunch of buttons to perform separate tasks within a Python Add-In. Buttons are greyed out and required to be enabled after initial tools run. In the following example, tool1 is turned off after ...
-1
votes
1answer
263 views

Raster produced by Con expression not saving

I cannot get a Con expression to work. Or, if it is working, I cannot get the raster produced by the Con expression to save. I have two rasters and I want the positive difference between the two, and ...
1
vote
2answers
153 views

how to add a raw input to a SQL string?

I have this py script for selecting one point. # Within selected features, select only those points of a chosen value arcpy.SelectLayerByAttribute_management("Stations", "NEW_SELECTION", ' "OID" = ...
1
vote
1answer
199 views

ARCGIS10: updatelayer results in error - LayerObject: Get attribute renderer does not exist

I'm quite new in using python in Arcgis 10. I wanted to use the symbology of a geostatistical layer in the TOC in another geostatistical layer in the TOC. Therefore, one should use ...
0
votes
0answers
57 views

Arcpy - loop through subfolders and change mxd settings [duplicate]

I'm trying to run a python script that uses arcpy and os.walk modules. The aim is to find all mxds by specyfying top workspace level only and for the tool to loop through all subdirectories and locate ...
1
vote
1answer
146 views

Improve Python script logic/structure for erasing features with arcpy

EDIT: Too big a question, I think - so, to refine it: Please help me define (and therefore, research/learn how to use) the Pythonic concept for writing a script that can take one input variable, ...
1
vote
1answer
73 views

How to update attributes of a shapefile using list values?

I am using an update cursor to update the attributes of a shapefile using values from a list. It seems very easy, but I couldn't make it run correctly. When I run the following code, it updates all ...
0
votes
1answer
127 views

Trying (+ failing) to use a Function in Field Calculator

I'm trying to populate a field using a function. When I run this in Pyscripter, it works fine: d = {} # Function # def find_dups(val): d[val] = d.setdefault(val, -1) + 1 return d[val] # ...
7
votes
2answers
486 views

How can I speed up my arcpy script?

I have written an application that does a lot of geoprocessing using arcpy. Once started, the application itself runs at an acceptable speed, but it is very slow to boot. It can take 30 seconds or so ...
1
vote
1answer
152 views

ArcPy - Dividing every raster cell value by the maximum cell value

I want to divide every cell of a raster by the raster's maximum cell value using ArcPy. Here is what I have done so far. densityRaster = LineDensity(shapefileName, None, "", "", "") maxVal = ...
1
vote
0answers
346 views

Arc10.1: intermittent Error using arcpy.Delete() on temporary rasters

I've been pulling my hair out with an intermittent error when running from either the MS-DOS prompt, PyScripter, or WingIDE. Haven't bothered to check w/in Desktop apps (but a colleague says it's the ...
2
votes
2answers
697 views

Add value in attribute field using arcpy

I need to add value in a field in attribute table, the value is to be determined on the basis of value in another field in same attribute table but i am unable to deifne value in another field in the ...
2
votes
2answers
440 views

How can I perform an inside clip on a raster file based on another raster file?

I have a raster file that I would like to use to perform an inside clip on another raster file. I have tried using the extract by rectangle tool, but it gives me values ranging from 3.40282e+038 to ...
2
votes
1answer
506 views

How do I use the SearchCursor where_clause to get a max value from a column?

This is my first time asking a question on StackExchange. I hope I phrase my question and describe my attempts to understand my problem well enough! While working with SearchCursor, I'm trying to ...
1
vote
0answers
105 views

Subset a GeoTIFF image into regular grids and extract mean latitude, mean longitude, and mean RGB for each grid

How can I subset a GeoTIFF image with 1000 by 1000 pixels into regular square grids of 50 by 50 pixels (400 grid objects in total); and calculate mean latitude, mean longitude, and mean RGB for each ...
0
votes
1answer
585 views

ArcPy SelectLayerByAttribute Error and how to control GP output layer name

I have a rather long script that first references an SDE feature class (non-versioned) to perform an attribute selection based on a SQL selection. I've been unable to figure out why the script will ...
1
vote
5answers
853 views

String variable substitution in selection expression

I'm trying to put a variable into a string used to do a selection. At the moment it's like this... expression = "'No_Props' > 5 AND %s < 200 AND 'ST_Ori' >60" % metres_field ...
2
votes
2answers
465 views

arcpy.CopyFeatures between file GDBs?

I'm trying to figure out why I can't copy a featureclass from one file GDB to another. I can copy the featureclass to within the source GDB. There's no name conflict in the target GDB. I don't think ...
8
votes
1answer
213 views

Where to find and share Python geoprocessing scripts? [duplicate]

Where are folks storing and sharing their Python geoprocessing scripts? For example, I know that GitHub has some shared scripts. ESRI is phasing-out ArcScripts, which is still really handy, and ...
3
votes
1answer
1k views

Change ArcSDE data source for mxds in specific folder using ArcPy?

I've searched all the forums and help and have made progess but recently got an error that has thrown me for a loop - also some mxds are not being changed at all! What I'd like my code to do: Iterate ...
2
votes
1answer
666 views

Better way to get raster values for a large number of point features?

I have several projects with tree point features (SpecialStatusSpeciesPoint) that contain up to 2,000,000 records. I am trying to record tree height (Hgt) and base elevation (BaseElev) values, based ...
0
votes
1answer
331 views

how to add HTML popup in exported PDF map?

I am producing some maps of a point layer using arcpy.mapping.ExportToPDF. Is there a possibility of creating HTML popup for the final PDF based on this link? ...
3
votes
1answer
399 views

ArcPy merge datasets with slightly different fields

i have many (>15) shapefiles which have slightly differing fields. s1: (Name, age, layer_1, ...) s2: (Name, age, layer_1, layer_2, ...) ... s_n: (Name, age, layer_1, layer_1_extra, ...) I want to ...
1
vote
1answer
170 views

arcpy update cursor: can't connect to a database table

I am using updateCursor to retrieve some rows from a non spatial table using a connection of type "Spatial Database Connection" (That creates a .sde file) from ArcCatalog. However, it doesn't work, ...
7
votes
3answers
4k views

Python - formatting path strings and checking if a path exists

I would like to use the following code to determine if a path exists. The path I would like to check is being passed to my code via parameter on a ArcMap 10.0 tool dialog box. The parameters data ...
0
votes
1answer
1k views

While looping with arcpy: ERROR 010240: Could not save raster dataset

Hi I am very new to python coding and have been struggling with this for a while I cannot see the reason for this error! Any help will be greatly appreciated. Here is the code that is causing this ...
3
votes
2answers
2k views

use a selection of features in ArcMap in Python script

I am trying to write a python script and am stuck on the first obstacle. I want the user to select features in ArcMap and then use these selected features in a python script. Is that at all possible ...
3
votes
2answers
379 views

Explicitly locking a file geodatabase

I need to lock a file geodatabase (or only a single Mosaic dataset) at the beginning of a python script (and release it in the end).. I looked and looked and couldn't find any explicit arcpy command ...
3
votes
1answer
1k views

Iterating through an numpy array and index to a value in another numpy array

I am struggling to get this code to work I want to iterate through an numpy array and based on the result, index to a value in another numpy array and then save that in a new position based on that ...
1
vote
1answer
128 views

How do I obtain layout coordinates of features using arcpy?

I just read the topic about Convert point XY to page units XY using arcpy? but I didn't find a solution to my problem. I have a point layer file, I know coordinates in map view, I'd like to know ...
4
votes
1answer
846 views

arcpy “The table name is invalid”

I wrote a script that, ideally, loads raw .las (LiDAR data) files into a geodatabase, then creates a terrain from the multipoint files that are created. When I run the script though I get: ...
2
votes
0answers
339 views

Cost Path tool in script randomly throws error

I have a script tool that is creating a least cost path for sets of points using a Cursor. When applied, the script runs great, except every so often the tool is stopped because there is an error in ...
2
votes
1answer
544 views

How to replicate an unversioned SDE geodatabase to a file geodatabase?

I need to implement a process for creating a file geodatabase copy (a read-only snapshot, essentially) of a production SDE geodatabase without using versioning, adding global ID columns, etc. I cannot ...
0
votes
0answers
206 views

How to convert shapefile to tpk using python(ArcGIS 10.1)?

I'd like to convert shapefile to tpk using Arcpy.I surf in ArcGIS 10.1 help but i couldn't find any desire reference to help me . How can i convert shapefile to tpk using arcpy ? which function i need ...
6
votes
1answer
187 views

Python in ArcGIS: How to add a space between upper and lowercase letters in TOC

I'd like to use python to update the TOC by adding a space (white space) for layer names that are like this: "BoundaryBuffer" or "WaterEdge" and replace them with "Boundary Buffer" or "Water Edge". ...
3
votes
2answers
405 views

scratch files left behind by arcpy.sa.Con

I have a Con() statement that creates two "extra" scratch files during it's processing, but that do not get cleaned up once the operation is over and the output is saved. r=arcpy.sa.Con(elv, ...
4
votes
4answers
546 views

How to rename a file in the output (ArcGIS python)?

raslist=arcpy.ListRasters() for ras in raslist: arcpy.ProjectRaster_management(ras,outfolder2+ras+'_Albers',spatialref2) print ras+' has been reprojected' I was using the above code for ...
2
votes
3answers
492 views

ArcPy(10.1) distanceTo using dynamic geometries?

I am struggling to get the arcpy point class method distanceTo to function with dynamically generated geometries with a Python addin. I have used the default tool addin function and set self.shape ...
4
votes
1answer
192 views

How to implement multiprocessing with multiple geoprocesses?

I am relatively new to Python and thought I would give a stab at multiprocessing. I have a script that runs well in IDLE or as an ArcMap toolbox script. After perusing these forums and docs.python, I ...