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

learn more… | top users | synonyms (1)

2
votes
1answer
57 views

AddJoin failing in Python ArcGIS

My AddJoin operation is failing: arcpy.CopyRows_management(lup_file,out_dir+'lup') try: # Perform copy rows on merged csv file print 'start' aa = arcpy.Raster(SEIMF) ...
-1
votes
2answers
173 views

How to compare values from a column in attribute table with values in Dictionary{}?

I am just entering to the python world, hence the level of my question. Can anyone tell me what Python function should I use to compare values stored in one column in an attribute table with values ...
2
votes
1answer
18 views

How to merge (append) ArcInfo coverages that are inside folder structure using ArcPy?

I'm having a bad time trying to create a script capable of merging a list of arcinfo coverages located inside a folder structure. My goal is to merge the coverages named "car" that are inside each of ...
0
votes
1answer
84 views

Duplicating Features To Create A Pattern

I'm currently trying to take the 'Shifting Features' script from ArcPy Cafe and this SE response and apply it to a similar script that will one by one, through all the features in a feature class, ...
0
votes
0answers
21 views

UnicodeEncodeError when using arcpy.gp.TraceGeometricNetwork_management() [closed]

I am creating a python tool (run through ArcMap) which will eventually go through a feature class selected by a downstream trace and use the obtained values to do some function. I am trying to follow ...
0
votes
0answers
46 views

arcpy.SearchCursor strangely throwing IO Error

I've been trying to use arcpy.SearchCursor on an xls file. Something I've done countless times before. I had a script running and then yesterday it started throwing: IOError: ...
1
vote
3answers
79 views

How to create a geodatabase feature class using a geodatabase table schema with ArcPy?

Is there a way in ArcPy to create an empty polygon geodatabase feature class that will acquire the schema of a geodatabase table? I know that it's possible in ArcCatalog (New -> Feature Class and ...
2
votes
1answer
96 views

How to generate dynamic legend using ArcPy?

I used this example to produce printing service. As the result I get map with too many elements in the legend. Is it possible ti show classes that are visible in the current map extent using python ...
0
votes
0answers
26 views

Unable to Import 3D Files with real-world position

The following link identifies a method of importing one or more 3D models into a multipatch feature class. http://resources.arcgis.com/en/help/main/10.1/index.html#//00q900000097000000 Test Case I ...
0
votes
1answer
62 views

ArcGIS arcpy reprojecting raster issue

I have a raster which I want to reproject from GCS_WGS_1984 to GCS_NorthAmerican_1983. I am using the following code: try: spatial_ref = ...
1
vote
1answer
110 views

How do I copy polygon features with a WHERE clause using ArcPy.da

This question is similar to Copy a polygon geometry in Arcpy, except within the context of using Arcpy.da instead. I want to copy the geometry from one feature class to another using ArcPy.da (I'm ...
0
votes
1answer
60 views

problem with SelectLayerByAttribute management in script

hello my problem is that this tool works perfectly in IDLE or PyScripter programs, but if I use in the script in ArcGIS desktop this problem occurs: arcgisscripting.ExecuteError:ERROR 000582... why ...
1
vote
1answer
76 views

Multiply a raster list with a field value list in a FOR loop in ArcPy

I'm trying to create a simple map algebra calculation not managed by ModelBuilder, but writing it in Python is trickier than I thought. I have a list of raster in a GDB and I must multiply them by ...
2
votes
3answers
71 views

Best way to find points outside state boundary that are supposed to be within specific State

I have a nationwide featureclass called bakeries. In the bakeries FC, there is a field called "State" and the field is populated with state abbreviations(AL,NJ,CT,etc). I have another feature class ...
2
votes
1answer
95 views

How to do a separate Python installation with ArcGIS?

I see a lot of threads asking how you can have a separate Python installation (e.g. the Anaconda or Python XY distribution) and get it to work with arcpy, while not 'breaking' ArcGIS at the same time. ...
1
vote
1answer
71 views

How to export Raster to JPEG in Python?

I built a model to import table data, create xy event, kernel density and clip density raster. I would like to export the clipped raster as a JPEG but I am not sure how to write the ExportToJPEG code. ...
4
votes
1answer
119 views

call Sql Server stored procedure form arcpy

Is there a way to execute a SQL Server stored procedure with arcpy or Python and retrieve the results returned by the stored procedure? There is a very similar question posted on ArcGIS forum with ...
0
votes
3answers
28 views

Minimum ShapeLength using arcpy.Polyline?

Please, i am creating lines using arcpy.array(point1,point2) --> arcpy.Polyline...but my ArcGIS create lines only with shape lenght 0.0002 and longer...why ?? I want to create also shorter lines cause ...
2
votes
1answer
35 views

How to check how much of a line (percentage-wise) is covered by a polygon in arcpy?

I'm searching for an efficient way to check if a line is covered by a polygon (see image, this case should return 2x "true"). Right now I only check wether a line is within a buffer with ...
0
votes
1answer
23 views

Multiple vertices after editing giving wrong start and end x, y co-ordinates

I have a small problem which I have been fighting to solve but in vain. Initially I generated some polylines across the river at various locations. I found some of them are smaller in size and not ...
-1
votes
2answers
60 views

Export to PDF in python with parameters

I need to export to PDF with some parameters, and I went through the help and it only explains the data frame portion. When I need the entire map or layout view. Here is what I need: 1.400 dpi ...
0
votes
1answer
56 views

How to get a kml from stored in a blob file of oracle with arcpy

How to get a kml from stored in a blob file of oracle with arcpy? i try get data or kml files contains in a database oracle in a field of a table, using cursos options of arcpy. import arcpy, os ...
1
vote
1answer
45 views

arcpy clip_managment migration from arcpy 10.1 to 10.2

i've created script using arpy with arcgis 10.1. One of the goal is to clip raster via shp file, which contains one feature. it worked perfect. after migration to arcgis 10.2 i've noticed some ...
0
votes
1answer
34 views

Add a field to output feature of a geoprocessing tool?

I am running the Watershed tool and RasterToPolygon tool in a loop for a number of points: flowdir = "flow.tif" flowacc = "flowacc.tif" pnts = [arcpy.PointGeometry(arcpy.Point(x=0.0, y=0.0, ID = ...
2
votes
0answers
51 views

arcpy export - unable to set exact extent of dataframe

I am trying to use arcpy's ExportToPNG function to produce tiles for Nasa WorldWind, which will require very specific extents of outputted tiles. Pretty simple code - abbreviated below: mxd = ...
0
votes
0answers
46 views

arcpy.mapping.Export creates some labels but not others

I've created a simple python toolbox (pyt) to export map layouts to multiple formats. My problem is that some labels which are defined in the layout are exported, but others are not. For example ...
1
vote
2answers
255 views

How to count number of feature classes in geodatabase using ArcPy?

I would like to count the number of feature classes in a geodatabase. Some of the classes are in feature datasets as well. I have tried get count management, but that returns the number of rows in ...
2
votes
3answers
80 views

Create in memory polygon with RasterToPolygon

I need to create a number of polygons in a loop from a raster. Essentially, the loop will call a function a number of times which needs to convert it to a polygon: def myfunc(raster): #do some ...
1
vote
2answers
70 views

Calculate field based on most frequently occuring text/value in other fields in attribute table (ArcGIS)

I was wondering if anyone knows if it is possible to calculate a field based on the most frequently occurring value in other fields. What I have is 5 fields with crop information over 5 consecutive ...
0
votes
1answer
76 views

How to add several layers to the table of contents in ArcMap using Python in one shot?

I am already able to add individual layers to ArcMap table of contents using the following codes: # Adding the layer to the table of contents mxd = arcpy.mapping.MapDocument("current") df = ...
0
votes
1answer
141 views

What might cause “python.exe has stopped working” when closing ArcPy script?

I created a script that take a .tab file and join it to a shapefile. The script works perfectly but when it finish, it gives me an unhandled exception which crashes python. I dont know what might be ...
1
vote
0answers
30 views

Using the geocode function with cursors

How do I use a cursor with a geocodeaddress function? I want to be able to: 1) read from a table 2) only geocode addresses(from table1) whose street number is not 0 using a cursor 3) then update a ...
-1
votes
2answers
111 views

Python script not working after exporting it from ModelBuilder

trying to figure out why my script wont work (I should mention I'm still at an intro level). This is a script I exported from ArcGIS model builder which worked fine using that: # Import arcpy module ...
3
votes
1answer
104 views

Arcpy - What's the best way to check whether feature class has selection? [duplicate]

In a sentence, how do you test in Arcpy whether a feature class has any selected records or not? More info below to explain: I am doing a batch process in which a sampling layer (10km grids) is used ...
16
votes
5answers
480 views

How to buffer raster pixels by their values?

The pixels to the left represent tree locations and their associated crown radii (i.e. pixel values ranging from 2 - 5). I would like to buffer these raster pixels by their crown radius value. The ...
3
votes
1answer
121 views

Use arcpy to connect to database without connection file

It seems like arcpy can only work with connection files. This creates one of two problems: Deployment requires manual creation of connection files. We have to write a bunch of code to recreate the ...
0
votes
0answers
112 views

ArcMap 10.2 SplitLineAtPoint setSplitRule not calculating RATIO

I am trying to set a length field to use the RATION split policy. I set the split policy for the feature layer but when I use the SplitLineAtPoint_management it does not calculate the RATIO length. ...
1
vote
2answers
71 views

Using python to get extent and split coordinates into list

I have the following code: for fc in fcs: desc = arcpy.Describe(fc) ext = desc.extent ext.split(" ") print ext I'm getting error: AttributeError: Point: Get attribute split does not ...
0
votes
1answer
103 views

Error Importing Arcpy - Python

I have written a script and am trying to run it in Python IDLE 2.7.6. I first try to import arcpy, but I get an error message saying "ImportError: No module named arcpy". Why doesn't it work? I'm ...
0
votes
0answers
41 views

How to bulk change the schema name of layer properties in ArcMap

I would like to change the data source location (schema) in layer property in ArcMap. Our data are stocked in an Oracle Spatial database. Recently, the DBA has changed the schema name and then I ...
1
vote
1answer
60 views

ListRasters not recognizing raster files in python

I have 2 rasters in my workspace, one in TIFF Format and the other in GRID format: "C:\ExampleFolder" When I use the python script: import arcpy >>> ...
0
votes
1answer
49 views

Listing Printer names in a Python Toolbox in Arcgis 10.1?

Here's my code for my third parameter in my Python Toolbox. When I run the toolbox and look at the list of printers, it only shows one of them. My print command of 'printerName' lists all of them in ...
1
vote
3answers
77 views

Assigning UNC Path to arcpy.env.workspace

For some reason my python script crashes ever time it reaches the following code which attempts to assign a unc path as my workspace. Can any of you please help me solve this problem? Also, I'm not ...
1
vote
1answer
63 views

Delete Turned Off (Unchecked) Layers from Arcmap with Python

I have about 100 figures that have been updated countless times and a lot of the old data was left in each .mxd but was only turned off (unchecked) and not removed. I would like to remove these ...
0
votes
0answers
177 views

How to use replaceDataSource to replace data source for multiple layers?

I appear to be having difficulty with using 'replaceDataSource'. ESRI has atrocious documentation on updating and fixing data sources, and almost everything I have read on the subject is almost what I ...
0
votes
0answers
30 views

ArcPad checkout/in process, only selected features

I am working on developing a python toolbox to automate the steps required for checking data out and back into a file geodatabase. My question is what is the best way to limit the features checked ...
1
vote
2answers
39 views

precision of positionalongline and/or SpatialJoin

I've been using positionAlongLine to create points that are supposed to line up with the lines from which they are derived. When I tried to use SpatialJoin_analysis with the match_argument set to ...
0
votes
1answer
42 views

Topo To Raster executing but not creating the raster

I am using Topo to Raster by File (ArcGIS version 10.1) via arcpy on a large stream and point dataset. Arcpy runs fine and executes without issuing any error message, however it does not create the ...
0
votes
0answers
41 views

CAD to GDB import using ValueTable function

I have several CAD files (DWG) that I want converted to Feature Classes within a file GDB. Each feature class will be based on a polyline attribute "LAYER" value, so I have a query filter applied ...
2
votes
1answer
161 views

Why does Raster Calculator (RasterCalculator_sa) give ERROR 000539 in ArcPy?

I am getting a not executed error for a raster calculator. Here is part of the output: File "C:\projectTemp\FloodAnalysis\floodxsectionanalysis.py", line 107, in makeSeemless ...