Tagged Questions

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

learn more… | top users | synonyms (1)

1
vote
1answer
7 views

Where to break the loop to make several polyline instead of one?

I am trying to solve a problem, I am pasting part of the code: from arcpy import env arcpy.env.overwriteOutput = True spatialRef = arcpy.SpatialReference("WGS 1984") polylineFC = ...
-1
votes
0answers
27 views

Error creating polygons with ArcPy [on hold]

Based on the example from this page, running the code below results in an error message. Can someone take a look and tell me what I am doing wrong? import arcpy # A list of features and coordinate ...
0
votes
0answers
25 views

Legal description polygon mapping/creation with Arcpy

What I have: an excel file with the names of properties within an area that is part of the PLSS in which Township/Range, Section and Lot numbers are used. The file contains a legal description for ...
0
votes
1answer
37 views

Python Script to Identify and Flip Lines Digitized in the Wrong Direction

I have a river dataset that was digitized both in the direction of flow and opposite the direction of flow. I need to find an automated method to determine which lines were digitized from downstream ...
1
vote
1answer
18 views

Arcpy reclassify all values to same number

Using ArcGIS 10.1 and arcpy, is there a way to reclassify all values of a raster file to the same value (leaving NoData Values as "NoData")? Lets assume that I have no way of knowing what the actual ...
0
votes
0answers
13 views

Calling An ArcGIS Webmap's Scales

I am composing an Arcpy tool to help users cache their current mxd's webmaps (our own services). I want to know a way to call the ArcGIS Web Map's scales with ArcPy. Once I have the web maps scales, I ...
1
vote
1answer
12 views

Using ModelBuilder to replicate series of tasks without deleting output features first?

I am calling a number of files that I want to clip etc in ModelBuilder which clips data and sends it to a specific feature class. I want to re-run that same process for which I have converted the ...
1
vote
1answer
26 views

How to loop a Select by Attribute to use in a Select by Location?

I am new to python scripting and I need help. I am trying to select one row at a time on a shapefile that contains buffer rings around sites we are working on (some rings overlap), and for each site ...
0
votes
1answer
21 views

select a line with specific numeric field value using an inline variable for UpdateCursor

I'm currently away in a remote field station using Arc 10.0 and having a hard time using an inline variable substitution for a numeric field value. I am trying to use UpdateCursor to select only a ...
1
vote
1answer
54 views

region growing feature selection using arcpy

I have a polygon featureclass consisting of parcels touching boundary with each other and for which areas are computed in the attribute table (Figure a). I want to select polygons in an iterative way ...
0
votes
2answers
47 views

Select value from list in Python toolbox

within a Python toolbox in ArcGIS 10.2 I fill a parameter with a list. parameters[0].filter.list = myList It is essentialy a list of strings and will give the user a range of predefined years. Later I ...
0
votes
2answers
13 views

How to set values from list to row using arcpy

I have list with values and I want to put them in rows for specific column. Here is my code: den = kol() # list with values with arcpy.da.UpdateCursor('Wojewodztwa', 'gest_zal') as cursor: for ...
1
vote
0answers
20 views

How do I generate a drainage area-slope scatter plot from ASTER GDEM data

I have ASTER GDEM catchment data. I've installed the TauDEM tool. How do I generate a Drainage Area-Slope scatter plot?
0
votes
0answers
14 views

Issues Adding MapServerCache Raster Layers to Mxd

I have created a data consolidation tool. It consolidates a users mxd's vector and raster data into a project structure. It also allows the user to optionally cache our companies ArcGIS Server Web ...
-1
votes
1answer
30 views

Cannot see added layer in Table of contents arcgis

I am using a Python script to add a layer to my mxd. Following is the script: mxd = arcpy.mapping.MapDocument(r"C:\Amruta\clustereddata.mxd") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] print ...
0
votes
1answer
11 views

Assertion Error, Trying to add .tif to group layer

So I am trying to add a layer to a group, but running into problems most likely because of the file is a .tif. I have tried quite a few different iterations of this and looked at a few solutions but ...
1
vote
1answer
30 views

Python-Scripting in ArcGIS: Point as Input?

Is there any possibility to add a Point-Feature as an input parameter in a ArcPy-/ArcGIS-Python-script? If I choose "Point" as datatype in the parameter list, I get 2 input-fields for a X- and a ...
1
vote
2answers
22 views

How to best fit in certain scale 500,1000,2500,5000,10000 in Data Driven ArcGis

I have more than 2000 parcels. I added this layer in Data Driven. Need: One of the option that data driven has about scale of the Map is "Best fit". What it does its fits parcels inside data frame ...
0
votes
4answers
62 views

Apply Symbology to Rasters using Arcpy Script

I have an ArcPy script to apply the symbology of one raster layer to all of the raster layers in the table of contents. I have used this script before with feature layers instead of raster layers, and ...
0
votes
0answers
20 views

Python script to get count of features that meet a certain criteria [duplicate]

I am in search of a Python script for use in the ArcGIS Field Calculator to return the number of features that meet a certain criteria. Here's where I am getting stuck: def ...
0
votes
3answers
40 views

Empty shapefile after project tool in a for loop

I am running a for loop to process a years worth of data. The entire script runs fine for the first run through, but when it runs again (when date is 1/2/2013), I get the following error: 'NoneType ...
0
votes
1answer
46 views

Attribute Table Subtract Value From Previous Value

I have a river shapefile and need to ensure every vertice has a lower elevation that the previous uphill vertice. I have converted the polylineZ to points using ET GeoWizards. This gives me a Z ...
1
vote
1answer
54 views

How to determine nearest parcel neighbors, and adding direction info (N,S,E,W) in ArcPy?

I am working with a cadastral project, and I need a solution for a certain process, neighboring. Based on ArcGIS. Scenario: Have some parcels, every parcel has some neighbors. I would like to add ...
4
votes
3answers
117 views

Prevent newly created feature class being automatically added by ArcPy (Python AddIn) to Map Document?

I have a python addin, which as part of its function checks to see if a template point feature class exists on the user's machine. If it doesn't, it creates this file. This template file is used ...
1
vote
1answer
48 views

How to perform a calculation using attributes of groups of features in ArcGIS?

I have a table with information about 2000 aquifers (thickness, area, depth, volume etc.; there are 20 fields approximately). One of these fields is an internal code, i.e. DK_12_456_XXX; the last 3 ...
2
votes
2answers
74 views

Why is Clip_analysis giving ERROR 999999 using SHAPE@ geometry token as clip_features in arcpy.da.SearchCursor?

In my file geodatabase (C:\polygeo\test.gdb) I have two feature classes: PointsFC which has 400 points arranged in a 20x20 grid FishnetFC which has four polygons arranged in a 2x2 grid - this has a ...
0
votes
2answers
29 views

Randomly assign a value to a specificed number of rows in a feature class in ArcGIS

I have several feature classes, each with a million or so rows. In each of these feature classes I have an attribute ("STATE"), the value of which I want to randomly assign to one or another state (so ...
-1
votes
1answer
42 views

Cause of KeyError in Python Toolbox of ArcPy?

This question arises from Performing Point Distance analysis using Basic level license of ArcGIS for Desktop?. I basically copied and pasted PolyGeo's answer and formatted it into a python toolbox ...
0
votes
0answers
16 views

RasterToPolygon tool is looking inside the output location and not reading the fields

I am trying to convert IMG classified rasters to polygons. I created a code using the Raster to Polygon tool and it worked for 8 of the 50 files; for the rest, I get errors 010157 (Unable to open ...
2
votes
1answer
33 views

How do you override the required Create Fishnet parameters in ArcMap 10.1? [duplicate]

I'm writing a python script that creates a fishnet in a specified area (parcel shapefile) that accepts user input to create a polygon shapefile that represents a building, and polyline shapefile that ...
3
votes
1answer
41 views

arcpy release lock files

I have created a script that splits a shape file into multiple new shapefiles and adds them to an ArcMap document. When running the program a second time to overwrite those shape files lock-files are ...
5
votes
2answers
164 views

Arcpy: Names and distances of nearest intersecting roads in layer 1 to end points of a road segment from layer 2

As shown in the image below, I'd like to return a new field in layer 2 that for each segment stores a string:"Road C, 1 km from Road A to 0.5km From Road B". Calculation of the distances could be ...
0
votes
1answer
31 views

arcpy insert cursor problem - adding multiple polygons

I am reading rows from a database with a field "Coords" that contains polygon coordinates in the format 40.090170,-83.007704|40.089878,-83.007724..... and inserting each row as a polygon. The first ...
1
vote
1answer
24 views

findAndReplaceWorkspacePaths does not work for sde files so as to change datasouce (geodatabase)

I manage to change my datasouce by right clicking on an mxd file and choosing a different sde database connection file as shown in the following image. However When I try to do this using arcpy ...
2
votes
2answers
39 views

Is there a Python script to identify which database features are in Map/Feature Services?

I would like to identify feature classes that are present in my map services. Is there a way to automate this with python?
1
vote
0answers
31 views

How to edit a service definition file (SD) so as to change the Data source (User in oracle)

I am using Oracle 11g ArcGIS 10.2 Considering I have an enterprise geodatabase and I am connected as user1/mypass@myIP/xe I create a map from my table "mylocations" I choose share as ...
2
votes
0answers
39 views

What can I use to calculate drive times /with/ traffic considered?

I am looking to obtain drive times for a large list of addresses and want the results to take traffic conditions into consideration. For example, drive times from a distribution centre to a store at ...
0
votes
1answer
45 views

How to set feature coordinates to values in attribute table?

I have some shapefiles that were produced programatically, and everything came out okay EXCEPT that the geometry information was not written correctly. The coordinates for each feature are null. ...
0
votes
1answer
21 views

Trapping error messages with arcpy.getmessage issue

I am trying to capture an error with arcpy.getmessage(2) within a try/except statement but when it fails it tells me the issue is with the getmessage, it is not returning the error that occurred in ...
-1
votes
0answers
28 views

Issue with da.updateCursor on shape

I recently posted answer Determining Y coordinate for Create Fishnet from desired Angle of Rotation in Python/ArcPy? . While working on it I found something weird with da.updateCursor on shape field. ...
1
vote
2answers
25 views

arcpy.Raster.save(*.jpg) - format unknown

The following Python script returns the error on the final line, "RuntimeError: ERROR 010093: Output raster format UNKNOWN is unsupported.": import arcpy inRaster = ...
0
votes
0answers
30 views

GetParameterAsText() with Cursor

I'm trying to use the GetParameterAsText() for user input. When I use a value instead, it works fine but not with GetParameterAsText() Any help will be greatly appreciated AreaFilter = ...
0
votes
0answers
22 views

Table To Table on Oracle table to File Geodatabase fails?

I recently upgraded to 10.2.2 and have found that some python scripts I used with table to table command no longer work. I am copying tables from an Oracle database to a file based geodatabase. ...
2
votes
0answers
61 views

Get Unique Field Values Within Python Script Tool

Using ArcGIS 10.2.2 and Python. I have a script that currently counts the number of points (representing crimes) in each zip code area, and writes that value to a new column in the FC that contains ...
1
vote
1answer
24 views

How to split polyline using points WITHOUT splitting at intersections?

I am trying to use points to split a shapefile of lines that have been dissolved.The "SplitLinesAtPoint" tool splits at intersections in addition to the points, WHICH I DO NOT WANT. I only want to ...
1
vote
2answers
36 views

Generate dynamic input with python script

I'm using 10.2.2 ArcGIS, I want to create a python script and have the following script: I'm new to this topic as I can use sys.argv [] or GetParameterAsText? for can I make dynamic input coordinates ...
0
votes
0answers
24 views

using arcgis server connection file(.ags) inside python is not running in linux

When i am trying to execute the following script from my desktop it's executing successfully, but same is not executing/not throwing error in linux ...
1
vote
2answers
32 views

Highlighting features selected by Python script in ArcMap and ArcGIS Viewer for Flex?

I have a database of orders, with geo data attached. I want the subset of features related to a specific order to be highlighted on screen (for starters in ArcMap, but later in Flex) in a python ...
0
votes
1answer
18 views

Data frame index

Can anyone know how to make index ,in arcpy, for a several data frame in one mxd? That question related to this question : Insert layer file to specific data frame
1
vote
3answers
58 views

Determining Y coordinate for Create Fishnet from desired Angle of Rotation in Python/ArcPy?

On the ESRI website it says: How_Create_Fishnet_works Calculating a value for the y-axis coordinate If you know the angle of rotation, you can compute a value for the Y-Axis Coordinate parameter as ...