Tagged Questions

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

learn more… | top users | synonyms (1)

0
votes
1answer
16 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 ...
0
votes
0answers
17 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
0answers
16 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
9 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
16 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
12 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
29 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
21 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
53 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
19 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
42 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
50 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
111 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
46 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
69 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
40 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
15 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
32 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
37 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 ...
3
votes
2answers
122 views
+50

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
29 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
36 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
28 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
38 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
43 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
20 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
29 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
58 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
23 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
31 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
56 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 ...
2
votes
2answers
55 views

Distinguishing between table and FC using arcpy, when exporting from SDE

I'm working on a project where I'm pulling some data out of SDE and putting it into a file geodatabase for a group of people to look at with a custom map. I'm writing a script using the ...
-1
votes
0answers
37 views

python script tool only works if layer is loaded in ArcMap

I'm hoping someone can help me understand this error. I have a python script that copies an ASCII raster to the scratch geodatabase. When I run the script, I get the error: However, if I load the ...
1
vote
0answers
33 views

ArcGIS script for mapping lat/long coordinates to boxes/rectangles? [duplicate]

Working on a project that requires me to take lat/long coordinates and map them as rectanglular boxes on ArcMap 10.1. To be clear, the upper left & lower right corners of each box/rectangle are ...
2
votes
1answer
61 views

Use arcpy to check whether feature class geometry has ZM

I am looking for a programmatic way using arcpy to determine whether or not a feature class (FC) has Z and/or M geometry. It's easy enough to get the geometry type using the code below, but this just ...
1
vote
1answer
53 views

Unsupervised raster classification using GDAL

Is there an equivalent in GDAL to the Arcpy ISO data unsupervised classification tool, or a series of methods using GDAL/python that can accomplish this?
-1
votes
3answers
54 views

Insert layer file to specific data frame

I have a folder that contain mxd's projects. Each mxd has 3 and more data frame. I want to insert layer file to a specific data frame with position in the TOC. I don't know how to do it. I'm trying ...
2
votes
1answer
29 views

How to make Dynamic Legend in Map Book show “No information present at the time” using ArcPy?

I'm working on making everything automated in map book. One of the problems I have encountered was working with the dynamic legend. The issue is that when I toggle one page after another, some of ...
1
vote
1answer
29 views

Problem writing list of features to text file

I am attempting to write / run a simple script that list all the points within a directory, and the subdirectories contained within. Here is the code: import arcpy, os workspace = ...