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

learn more… | top users | synonyms (1)

0
votes
1answer
155 views

how can I add all feature classes of the same name to an mxd in python

I have a bunch of folders which all have (almost) identical folder structures and file geodatabases of identical structures which in this folder structure. I need to add all of the same type of ...
2
votes
1answer
54 views

Arcpy Calculate Field Formatting Syntax

I am trying to field calculate a double field (PID) to a new string field (PIN). Using: qry = '"139-{}".format(!PID!)' arcpy.CalculateField_management(out, "PIN", qry, "PYTHON") Given a PID = ...
0
votes
0answers
36 views

Visualizing Layers with lyr-files in ArcGIS API for JavaScript

I do have a probably very simple question. I'm currently running a Python-Script on my Desktop-machine. In the end of this script the different layers that I've created will be visualized according ...
0
votes
1answer
30 views

Copying extents between features

I have a Building feature class whose individual building footprint extents I want to match to associated Level feature classes. Unfortunately, the Level data was converted from DWG files with only ...
0
votes
1answer
65 views

name 'AddressLocator' is not defined, Python created Address Locator

When I run this tool, I get the error 'name 'locator_AddressLocator_n_' is not defined'. My guess is that this is an issue with the path where the locator is trying to save to? So, I am assuming I ...
0
votes
2answers
120 views

How to use Field Value from arcpy.GetParameterAsText()?

I want to to is have a user select a feature class, which then populates the fields that can be selected (this works), create a new field in that feature (works), and then populate the new field with ...
1
vote
2answers
135 views

Run a model from python problem

I am using arcGIS 10.0 SP5 I have the following code : import arcpy arcpy.ImportToolbox(r"C:\Documents and Settings\Derek\FRAME\FORTEST.tbx", "Derek") arcpy.TEST_Derek() The model is names TEST ...
0
votes
2answers
78 views

Add value to a field Python

I was wondering if anyone can help me with some Python? I have a featuers Class with the columns KOMMUNE and GKR and some other columns.. Both columns are string. In the column KOMMUNE I have the ...
2
votes
1answer
229 views

Multiprocessing issues with ArcPy

I am using ArcGIS 'watershed' routine in a script which makes use of multiprocessing. This works fine, but during execution I get the message: Unable to remove directory. Possible causes: 1- Not ...
0
votes
0answers
21 views

Is it possible to scale an ArcGIS feature in a multipatch feature class using Arcpy?

I've imported a number of features in Python using the following method: - Import3DFiles_3d Unfortunately they are all extremely large so I would like to scale them using arcpy. I have seen that ...
2
votes
2answers
93 views

Is there a way to do a python batch script for Analyze and Compress on SDE Databases?

I created and modified python scripts based off of ERSI's example (http://resources.arcgis.com/en/help/main/10.2/index.html#//003n000000v7000000), however, what would be great is to be able to batch ...
3
votes
1answer
104 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
497 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
26 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
91 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
76 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
59 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: ...
2
votes
3answers
158 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
153 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
37 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 ...
1
vote
1answer
111 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
222 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
76 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
146 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
93 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 ...
5
votes
1answer
297 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
89 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
288 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
34 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
43 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
26 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
120 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
65 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
58 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
40 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
108 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
64 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
442 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
109 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
97 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
128 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 = ...
1
vote
1answer
481 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
36 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
134 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
168 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
573 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
279 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
128 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
107 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
244 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 ...