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

learn more… | top users | synonyms (1)

0
votes
1answer
82 views

Arcpy SelectLayerByAttribute for loop with “ADD_TO_SELECTION”

I am a little bit confused with the "ADD_TO_SELECTION" possibility. I process a point layer. First, the idea was to process the points with the different GBAUPS attribute separately. And it worked ...
0
votes
1answer
147 views

Automating calculation of Population Density in Census Tracts?

I am quite new to Python and I am attempting to practice by making a simple program with ArcGIS. I wanted to make a script that automated the calculation of population density of selected census ...
0
votes
1answer
56 views

How to store both fixed and variable attributes as a feature class?

I have a live data feeds as an XML file from the Internet. I need to use Python and ArcPy lib to store each feed as a point feature in a feature class of an ArcSDE datbase. The xml looks like: ...
0
votes
2answers
67 views

Trouble using saveACopy with group layers [closed]

This code works fine on layers in the TOC that are not group layers, but errrors out if there are any group layers in the TOC. import arcpy, re, os arcpy.env.overwriteOutput = True #loop through ...
0
votes
1answer
172 views

How to read shapefile of road segments into Python data structure to get begin and end point coordinates? [duplicate]

How can I take a shape file that has road segments and read it into a data structure in python that I can use to get begin and end points with? For example x, y to x2, y2. It's not a large shape ...
0
votes
1answer
343 views

ArcGIS ModelBuilder pass arcpy.SetParameterAsText as input to next tool

I am trying to build a model which uses two simple scripts, Script A and Script B. I want to use arcpy.SetParameterAsText to set an output in script A, which is then used as an input in script B. In ...
0
votes
1answer
196 views

How to compute geometric intersection using ArcPy?

I want to take geometric intersection of line and polygon shapefile. ArcPy has a tool: arcpy.Identity_analysis but it is available with "ArcGIS for Desktop Advanced" and I have "ArcGIS for Desktop ...
0
votes
1answer
206 views

ArcPy Mark ALL duplicated values

I'm sorry if this is too similar to other posts but I'm an arcpy newbie and I can't quite get what I need. I have accomplished this task in the field calculator (thanks to another post here, but I ...
0
votes
1answer
102 views

make a selection by attributes of the fourth part of a range of numbers with arcpy

I am using Arcmap 10.1 and I need to create a script (for use on shapefiles) where I have a input field named "sequence" which is numerical data. I need to select the fourth part of a range of ...
0
votes
1answer
103 views

Is there an event handler for a Selection being made using ArcPy?

I want to be able to capture an arcpy.SelectByAttribute() or arcpy.SelectByLocation() event being triggered. There doesn't seem to be an extension that is able to handle this. Is there a way to do ...
0
votes
1answer
66 views

Is the loop in this python code breaking because of duplicate values in the column?

This code is meant take a shapefile in the current mxd, loop through all of the values in a collumn of said shapefile. For each value it will create a definition query, zoom to features then save a ...
0
votes
1answer
145 views

Error with save path. Does not exist or is not supported

The final save raster file errors without message with Does not exist or is not support. But it does exist. If you can find anything wrong with this script I would be very greatfull. I had a vast ...
0
votes
1answer
292 views

“shutil.rmtree” doesn't get rid of my intermediate folders

I have a script that works fine, but now I'd like to remove all the intermediate folders I created therein in order to save memory and to be clean. I've been trying using the "shutil.rmtree ()" ...
0
votes
1answer
234 views

Problem with converting rasters to arrays and adding them to main array, then converting to raster via NumPyArrayToRaster : output is NoData values

I have a process that aims to loop through a list of rasters (testing with only 3) covert each raster to an array, add the array to an existing 'template' array, then save the final array back to a ...
0
votes
1answer
109 views

Arcpy & ARCGIS10: Make netCDFRasterlayer, error attribute not found

I am trying to create a raster layer from a NetCDF File using Python. If I am using the Arcgis 10 Python window it works without issues. But executing the same script in Pythonxy gives the error: ...
0
votes
1answer
106 views

ArcMap toolbox script with draw geometries parameter

I have an arcpy script in toolbox, that need one additional parameter to draw geometry(ies) which will work as a filter. I have done something similar using arcobjects using ...
0
votes
1answer
651 views

nested SearchCursors to loop through two tables whilst adding rows and calculating fields

I'm trying to loop through each row in table "Sites_Copy" and look at "OID1" and "OID2". Then take these and loop through "BLPUs_PolygonNeighbors" and compare these to "src_OBJECTID" and ...
0
votes
2answers
256 views

Arcpy Insert Cursor

The below code quits at the "cur = " line. Is it an error with arcpy module, my other scripts have worked with importing arcpy. I cannot determine if it is not recognizing the 'InsertCursor'. Any ...
0
votes
1answer
154 views

Cursor not working in ArcGIS 10.2

I just simply tried print arcpy.SearchCursor(...) A 'None' was printed. But arcpy.da.SearchCursor works. Has anyone run into the same issue, or is arcpy.SearchCursor deprecated in 10.2? Thanks
0
votes
1answer
138 views

How to get cell value from one raster within a raster catalog using ArcPy?

I need to be able to obtain the cell value of one cell in one specific raster that is stored withing a raster catalog in a file geodatabase. The Get Cell Value tool doesn't appear to be able to do ...
0
votes
1answer
2k views

Use arcpy.da.searchcursor to select rows to dissolve

I'm quite new to ArcGIS and hope someone can help me. I have one table that lists which polygons are contiguous with each other called BLPUsCavPlaceContigBLPUs that looks like this: OBJECTID ...
0
votes
1answer
110 views

Code in python for arcgis to select multilines (path) and vertexes

I am learning to write a python code for ArcGis 10.2. Need help! I have some shp poly lines file, need to learn how to write multiple selection of those lines, even if a cursor of mouse pressed not ...
0
votes
1answer
347 views

Copying/Projecting featureclass into a database and featuredataset of the same name fails

I've written a script in Python for ArcGIS 10.1 in order to migrate from an outdated coordinate system to a newer one while at the same time updating from personal geodatabases (.mdb) to file ...
0
votes
2answers
136 views

ArcPy add point to a FeatureServer Layer

What is the best practice to add a point to a FeatureServer Layer using arcpy? using rest services, write to db, etc? Where can I find a code sample?
0
votes
2answers
323 views

Arcpy SelectLayerByAttribute_management where_clause with LIKE not returning like values

I am selecting 2 intersections from a shape file using info from a File Geodatabase Table. The values are very similar as shown in example at the bottom. I am using a LIKE in the statement but it is ...
0
votes
2answers
88 views

Is it possible to rename a field with the current date

I'm trying to figure out if it is possible to rename a field with the current date. What I am trying to accomplish is a table to table conversion, dropping a dozen fields, leaving only two fields, ...
0
votes
1answer
366 views

Why does arcpy.mapping.Layer give Runtime error: CreateObject Layer invalid data source?

I want to connect an existing .lyr file to a variable defined as lyr2. lyr2 = arcpy.mapping.Layer(r"C:/Iso100Red.lyr") Although its a .lyr file I´ll get this Errorcode: Runtime error : Object: ...
0
votes
1answer
169 views

How to save all Layers in ArcMap table of contents

Basically, I'm bringing layers into arcmap,repairing the data sourc, and then saving out the layers manually so that the new source is saved. This is very time consuming because I have several hundred ...
0
votes
1answer
231 views

Python: using CalculateField_management for duplicating attributes with a double quotation mark

I am writing a python script which duplicates a field. The field contains names of pipelines but some of these names has double quotation (ex. 8" NGL PIPELINE). I have created a new field and trying ...
0
votes
1answer
574 views

Label Features with Arcpy

I had run the contour tool in my script to generate polylines. Contour("rectExtract", "C:/fakepath/Class1.shp", 50,0) Now I want to label the polylines with the contour-value. If I execute this ...
0
votes
2answers
146 views

How to limit/page through results from ArcGIS SearchCursor?

I would like to get for example, the first 200 rows from a database by ArcGIS Python SearchCursor. How can I do that? I've got a featureclass which has about 500k features and reading it all in one ...
0
votes
1answer
364 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
1answer
93 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 ...
0
votes
1answer
102 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, ...
0
votes
1answer
195 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 ...
0
votes
1answer
48 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 ...
0
votes
1answer
866 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 - ...
0
votes
1answer
188 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. ...
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 ...
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 ...
0
votes
1answer
527 views

Can an arcpy.da.SearchCursor be used on a dataset residing in a ParcelFabric?

I'm using ESRI's LocalGovernmentMI.gdb data model and am managaing parcel data in a ParcelFabric dataset. I'm trying to use a search cursor on the ParcelFabric_Parcels dataset but I recieve this ... ...
0
votes
1answer
617 views

UnboundLocalError: local variable referenced before assignment

I have following simple function to get percent values for different cover types from a raster. It gives me following error: UnboundLocalError: local variable 'a' referenced before assignment which ...
0
votes
1answer
776 views

How to insert values from one table into another?

I am trying to write a script that iterates through each row of a table, calculates for this row something. The result of this calculation is finally stored in another table (with just one row). Now I ...
0
votes
1answer
210 views

arcpy.setValue for Condition from Dictionary

Hi: I am trying to create a function to update multiple fields based on different criteria. I want to pass the field name and condition thru' a dictionary (please see the function description in the ...
0
votes
1answer
239 views

Rendering layer in ArcMap using ArcObjects and Python?

I succesfully wrote a script to render a Uniquevaluerenderer in a layer in ArcMAP using symbols from 4 parameters (values) read from the attribute table of the layer. I used ArcObjects and VBA, but ...
0
votes
1answer
774 views

How to Export to PDF after zooming to extent of each feature that meets SQL where clause?

I realize that I've asked two similar questions recently, but following suggestions in the comment chain, I'll make this a separate question (separate as it is not the no output problem in ArcPy: ...
0
votes
1answer
235 views

ArcPy: Error in For loop panToExtent + export to Tiff

I'm trying to trouble shoot a script, which has the objective of allowing a user to input a query for selected field, use the panToExtent function to pan the data frame at the specified scale to that ...
0
votes
1answer
619 views

Where Clause problems when all parts are user input variables

I have written some generic user ipnut code for a toolbox script (ArcGIS 10.0) but because everything is a variable I don't know how to write the SQL whereclause. Please can someone help and suggest ...
0
votes
1answer
71 views

How can I hide custom model from mytoolbox in ArcGIS

I am created model in ArcGIS using model builder and python script. To build main model I have created some submodel and script in the same toolbox. I just want to show main model in the toolbox and ...
0
votes
1answer
102 views

SpatialJoin with “closest” option ok in python script but not when in arcmap toolbox

I have the following problem. I want to create a toolbox to obtain the distance between a polygon (Bldg.shp) and a point (pts.shp). I have started with a simple following python script: import arcpy ...