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

learn more… | top users | synonyms (1)

1
vote
2answers
1k views

Python code does not work with RasterCalculator after exported from Model Builder

I have a model authored in Model Builder that uses "RasterCalculator" to process input raster datasets. arcpy.gp.RasterCalculator_sa("OutRas = Con(\"%STATIC_forestland%\" == 0, -255, ...
0
votes
1answer
513 views

ArcPy Create Point Along Line A Specified Distance From A Specified Point

In ArcGIS Basic I am trying to take a road polyline(one segment for the entire length of road) and get a point placed on the map a specified distance from an intersection. I have a layer of ...
0
votes
2answers
562 views

Help writing script using a shapefile - select by attribute

I am trying to take an existing shapefile and narrow down the attributes using the 'select by attribute' The problem I am trying to solve is: Find parcels that have an acreage >= 100. The code I ...
1
vote
1answer
772 views

Select By Atribute using python script on .Shp file getting error 000840 the value is not a raster layer

I have a script that calculating vertices angles on Polyline layer and the selecting features in that layer at a specified angle. at the end of the script i'm using select by attribute and getting ...
1
vote
1answer
671 views

How to list raster bands?

I am interested in looping through a directory and listing only the red bands (Band 1) from 4-band NAIP imagery. From there I would like to mosaic all of the band 1 layers into a new single band ...
2
votes
0answers
182 views

Call ArcPy script via CGI on IIS

I have an ArcPy script that does a whole bunch of processes with ArcGIS 10.1 to write the output data to a SDE geodatabase. What I want to achieve is to enable an online user to call the script and ...
-3
votes
1answer
160 views

How to create a polyline feature from a point layer

I would like to create a route line based on a point layer. The existing tool does not meet the customer requirement. But using the code snippet below, the start point and end point are always the ...
2
votes
2answers
1k views

How to set linear units for Buffer distance from arcpy.GetParametersAsText()?

I am trying to run a buffer tool as part of script that I will both use as a standalone script and import into ArcToolbox. I'm just wondering, if I use GetParametersAsText for the buffer distance, how ...
5
votes
1answer
1k views

How to arcpy.Describe() a layer when script is run from outside of ArcMap?

The following code will work if I run it from the ArcMap Python dialog, or from a GP tool, but not from PyScripter IDE: import arcpy mxd = ...
1
vote
1answer
92 views

How to create point features from 1-Many relationship?

I have an address point shapefile for buildings in a city. The point shapefile shows only a single point for each building; apartments are listed in a table called additional addresses. I need to ...
0
votes
1answer
112 views

Help with Point on Polygon overlay in ArcPy

I am trying to do this simple task but not sure how to do this in Python. I have a point shapefile and I want to overlay with polygon layer to get all the polygons for each point. After this would ...
7
votes
5answers
746 views

How to programatically identify the “Joined Field” in ArcMap?

Is it possible to programmatically identify the Join Field that is being used to Table Join two datasets together in ArcMap? I am currently using ArcGIS 10.0, SP5 and would prefer an ArcPy solution, ...
1
vote
1answer
57 views

ArcMap ArcPy - Place signs with no lat/lng on map

I'm new to ArcPy and ArcMap but I do have programming experience. What I am trying to accomplish is to take over 22,000 signs from a database and place them on a map in reference to a street layer ...
0
votes
1answer
118 views

OD Cost Matrix Settings (Arcpy)

I have what is hopefully a fairly simple question. I am trying to run an OD cost matrix for every minute of a day for research I am performing. All of the settings will be the same for each run, ...
1
vote
1answer
889 views

Creating a layer after using SelectLayerByAttribute_management

Is it possible to use an existent layer to do a selection by attributes without having to use MakeFeatureLayer_management first? Because I already have a layer with the same name as the feature class ...
5
votes
1answer
430 views

Can ArcPy 10.1 be used to generate true curve elliptical polygons in a file geodatabase?

As background, this question arose from trying to answer a question on How to generate overlapping polygons from lines output from Table To Ellipse tool? Using the ArcMap GUI it is very easy to ...
4
votes
1answer
312 views

How to generate overlapping polygons from lines output from Table To Ellipse tool?

I have a feature class of line-based ellipses generated by the Table to Ellipse tool that looks like this: What I want is polygons of the individual ellipses, however tools like Feature to Polygon ...
3
votes
2answers
1k views

Python Search cursor: Error handling

I have a search cursor that using a SQL query to match addresses and then returns the associated roll number with that address. However, some addresses do not match the roll number and then I believe ...
2
votes
2answers
834 views

Clip_management to raster extent outputs larger raster than raster extent

Using Python and ArcMap 10.0 SP5, I'm trying to reproject and clip a large input raster to exactly the same grid as a smaller target raster (same extent, pixel sizes and projection). The problem is ...
-1
votes
1answer
548 views

How to calculate the length of clipped lines using buffered points using ArcPy? [closed]

I need to create a buffer around each point of a points feature class. I would then want to use the point buffers to clip the streets feature class to calculate the length of the clipped streets using ...
1
vote
3answers
437 views

How to place points along a line in a specific offset using python / arcpy?

I have a street shapefile with information about the street name, house number from / to on the left side and house number from / to on the right side. My aim is to create a point shapefile that ...
0
votes
0answers
39 views

How to use na.Solve() on layers already created?

I am fairly new to arcpy and I am having troubles recreating the following set of instructions with a python script. Open the KeyChainTest.mxd Enable the Network Analyst extension. Click solve on ...
0
votes
1answer
277 views

In Arcpy, Erase function error: “XML being loaded could not be parsed”

Here we go! A error in my previously-smooth-running arcpy script has me confounded. The error occurs where the script selects individual features in two different feature classes, and then performs ...
1
vote
1answer
163 views

Python: Grabbing X,Y coordinate from matching fields

Here is my table. What I am trying to do is write a python script to go over the Zip_Crid values. If there are matching values, I need to grab x1, y1, x2, y2 and put it in a new field. Haven't ...
6
votes
1answer
565 views

ArcGIS Desktop 10.1 SP1: how to install/use additional Python modules?

I'm currently working on a project where I have to identify geomorphological features in a digital elevation model. Since the aim is to have a single ArcGIS Toolbox integrating all processing steps in ...
2
votes
3answers
230 views

Software needed to recreate VBA forms using python for Arc 10.0

I'm new to programming and need to convert VBA scripted tools for the 10.1 upgrade. I need to recreate the forms and use Python scripting. How do I do this? I need the form to function in 10 ...
0
votes
1answer
49 views

ArcPy space in textfield [closed]

I got a tiny script: def calc(value): if value is '123': return 'ok' elif value is '12 3': return 'not_ok' else: return value if the value is without spaces it works perfectly, but ...
1
vote
0answers
80 views

Insert last coordinates from a list of coordinates with line ID into a multipart polyline feature class

I'm having problems creating the last line from a list of coordinates that I have. I have a text file with coordinate data with a X, Y, and a Line ID (LID). I read the file and inserted each ...
1
vote
1answer
309 views

Batch Aggregate Raster using Python

Trying to write a python script to batch Aggregate a bunch of different rasters. get a Parsing Error Syntax error for line 11. # Batch Aggregate raster tool import arcpy from arcpy import env from ...
0
votes
1answer
1k views

Why does AddField give ERROR: 000732 Input Table: does not exist or is not supported?

I was handed off a a bunch of state shape files and wrote a script to add a few new fields and calculate some attributes. The first line in my script is - ...
6
votes
6answers
5k views

How to move / offset point locations using ModelBuilder or ArcPy

I have a number non-georeferenced CAD layers (see this question) that have text annotation features. I have created a model to convert the text to points, but after converting the annotation to a ...
4
votes
1answer
335 views

extend line to feature. programatically

Thanks in advance for any help. I'm trying to programmatically extend hundreds of lines (blue in image) to a single polyline feature (red in image). Sometimes the lines intersect each other, but I'd ...
2
votes
1answer
303 views

Using update cursor on a field with a domain

I have been replacing field calculations with python update cursors in many of my work flows and today I ran into a problem. The fields being updated have an attribute domain. so now, when I ...
2
votes
2answers
190 views

Determine ArcCatalog's currrently selected folder using Python

Is there a way to get the current directory opened in ArcCatalog 10.0 using Python? Something like os.getcwd() but instead gives the selected folder on the catalog tree. Cheers
0
votes
1answer
263 views

Why does script exported from ModelBuilder give ERROR 000733 at SelectByLocation?

I created a model in ModeBbuilder, and I exported the model as a script, but when I try to run it I get the following error. I have added my error below and the code below that. Thanks for any help. ...
1
vote
1answer
157 views

How do I change the isNullable property for a field?

Once in awhile I encounter a field in my featureclasses that have their isNullable property set to No. Is there a simple way using python to correct this? I came up with this code, but ...
1
vote
1answer
132 views

arcpy selectByLocation

EDIT: OK, added two lines to the code below including a projectAs(). When I start my mxd and run this code it selects a polygon. However, if I then pan to a new location - still within the bounds of ...
0
votes
3answers
357 views

Why does CalculateField set values to <Null> when output extent is in a different coordinate system?

I'm quite new to ArcGIS, and now I have to work on a script that goes through a list of feature classes to: add a field to their attribute table and fill that field with a number that I retrieve ...
2
votes
2answers
341 views

“ERROR 000840 | The value is not a Relationship Class”

I'm stumped here. I've seen this error in other posts but not quite in the same context. I'm trying to run the arcpy.management.CreateRelationshipClass() tool in ArcGIS 10.0. Absolutely everything ...
2
votes
2answers
359 views

Looking for ArcPy tool for calculating statistics on field with summary field AND boolean fields

What I'm searching for is a tool that will sum a field by a secondary unique field AND booleans... Let's say I have 12 table each with 4mil records and the following fields: Donation_Amount ($ ...
0
votes
1answer
404 views

Opening/closing an MXD that uses “production mapping” for dynamic tables in Python

I am currently working on a project that requires using a python/arcpy tool to allow a user to create a map series report PDF. Without getting into much detail, the tool is used when in ArcCatalog or ...
-1
votes
2answers
1k views

Error 000368 selectbylocation in script from model builder

Can anyone help? I created a model-has buffer,clip, selectbylocation.... I exported the model as a script but when i try to run it i get this error: Executing: IGISprogrammingscript ...
2
votes
3answers
2k views

How to get index number of list item using Python?

this gives me a list of all 55 layers in my mxd import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layer")[0] for lyr in arcpy.mapping.ListLayers(mxd, ...
2
votes
1answer
190 views

Renaming shapefiles with prefix while running arcpy.FeatureClassToGeodatabase?

I'm fairly new to the arcpy world. I am trying to create a script in 10.0 that will load a dataset (file geodatabase) into ArcSDE and rename the feature classes with a prefix, i.e. San_Diego_Bay -> ...
2
votes
0answers
36 views

How to include checkbox or radio button in python script for arcgis tool? [duplicate]

I created an arcgis custom tool for converting an excel file to both kml and shapefile . Now I want to include radio button or checkbox to select according user interest for either kml or shapefile.
1
vote
1answer
303 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
112 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
39 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 ...
11
votes
2answers
4k views

How to read 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 ...