A python API created by ESRI to perform geoprocessing and layer management.
2
votes
1answer
23 views
Reporting Engines used with ArcGIS Server
I'm curious what others are using to build the more elaborate reports out of ArcGIS Web API apps? By elaborate I mean ones that include lots of dynamic charts and tables, multiple maps/data frames ...
0
votes
1answer
23 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 ...
...
7
votes
1answer
79 views
Difference between python window and toolbox
Are there differences in performance or other potentially critical area between running a python script in the python window versus running it from the toolbox in ArcGIS 10.0?
I am asking in cases ...
1
vote
2answers
19 views
Select individual lines from feature class, convert to unique rasters: “raise e” error?
I have a feature class with 5 lines in it, and need select each one and turn them into its own raster -- for example, line 1 is raster 1, line 2 is raster 2, etc. This is the python script:
import ...
2
votes
2answers
51 views
Run Python child script using Python Add-In button class?
I have a Python script which I want to execute using Python Add-In button class. Right now, I am using following:
class child(object):
"""Implementation for Toolbar_addin.button2 (Button)"""
...
9
votes
1answer
73 views
Watermarking photos using their geotag and create a shapefile
I have geotagged photographs and I would like to place a watermark of the photos location on the front for easy reference as well as creating a shapefile from the coordinates. Does anyone know of any ...
0
votes
1answer
24 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
0answers
62 views
python script to calculate and return values based on several conditions
I need to calculate and return the value "continuous" to those records in a polygon feature class with species records aggregated to a UTM grid
considering the attributes are species name, grid code, ...
1
vote
1answer
64 views
How to use CURRENT map document in Python tool?
I am attempting to use this code in a tool that I am working on:
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]
XMIN = df.extent.XMin
YMIN = df.extent.YMin
XMAX ...
2
votes
2answers
46 views
Create line from two points, two different feature class
I'm attempting to automate this in ModelBuilder in ArcMap. I have one feature class with one point (Start) and one feature class with multiple points (Destinations). I want to iterate through the ...
3
votes
0answers
43 views
Accessing arcpy functions from IronPython
I made a few python scripts to automatically optimize and publish my data..
Now i'm thinking about writing a .NET program to manage and run these scripts: the obvious way is invoking them in a ...
0
votes
1answer
38 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 ...
1
vote
0answers
35 views
How to make multivalue input script run from a toolbox?
I have a working python script:
import arcpy
sdeconnection = arcpy.GetParameterAsText(0)
layerfiles = arcpy.GetParameterAsText(1).split(";")
for layerfile in layerfiles:
print layerfile
lyr ...
1
vote
1answer
40 views
Read XY, get raster value and then update field
I've written a script to run through a point layer, using the SearchCursor in the data access module and then read the XY values. Within the with statement, I then use GetCellValue to get the ...
1
vote
1answer
45 views
Problem with calculating the total cell values
aa= arcpy.RasterToNumPyArray("water_depth")
sum = numpy.sum(aa)
print sum
-2933737
Why I am getting negative values ? In my raster there is no any negative ...
0
votes
1answer
29 views
Arcpy Network Analyst solver error
Hello GIS Stack Exchange,
I am finding it difficult to load locations to sublayers using python in ArcGIS 10.0 network analyst Vehicle routing problem.
I'm also having some trouble debugging my ...
0
votes
0answers
22 views
using python and arcpy , how can I compute the direction and angle of a line segment? [duplicate]
if start_point_x < end_point_x and start_point_y > end_point_y:
slope = ((end_point_y - start_point_y)/(end_point_x - start_point_x))
radian = math.atan(slope)
degrees = ...
1
vote
0answers
27 views
Different results from Spatial Analyst GP Tool and Python
I am writing a script that has to subtract one raster from another.
The rasters I have represent
1) Parking Lots (1 = Parking Lot, 0 = not Parking Lot) and
2) a buffer around the Parking Lot (1 = ...
0
votes
1answer
47 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
22 views
Add a time dimension in ESRI mosaic raster dataset
I am in the process of creating a script to pull daily .asc files from a ftp server, convert them to a raster format, and push them into a mosaic raster dataset. Ultimately, the raster dataset will be ...
1
vote
2answers
59 views
Set Extents of MXD to new layer data source?
Alright here I go again this forum has been good to me. I add a layer and replace its data with a shapefile I created using the following bit of python:
layer = ...
1
vote
1answer
27 views
arcpy.setValue for Title casing
I am trying to figure out how to use fieldName.title() method while updating rows using updateCursor for multiple fields. I was trying to improve the code of this post to fit my purpose:
...
2
votes
1answer
69 views
Python script to update attributes crashing during loop
I have a script to update a field in one feature class from a selected record in another feature class. This is done through looping through records in one feature class selecting appropriate the ...
1
vote
0answers
24 views
Arcpad checkout to an area
I would like to check out data from an SDE database but for performance sake, i prefer to delete all features outside of my survey area.
i've tried to copy features in area from sde to a file GDB ...
1
vote
1answer
56 views
Setting More Than One Workspace
I have a number of tables that contain known values in a field. For example, I have a soil type table with one field in it. That field contains a list of known soil types. I have another table that ...
1
vote
2answers
86 views
Arcpy to copy a layer in the ArcMap TOC, rename the copy, and paste back to TOC?
I want to make a copy of a layer in the ArcMap TOC (passed to my script as a Feature Layer), assign the copy a new name, set a definition query on it, and then add the copied Feature Layer back into ...
1
vote
1answer
47 views
Need python code example - setting a combo listbox to Null
I want to be able to set the value of a field to Null using python, but I get an error.
I am using arcpy.CalculateField_management
Any help would be appreciated.
Rob Smith
1
vote
2answers
80 views
arcpy.sys versus sys
I just noticed that in the arcpy module (Esri) there's a sys sub-module. Does anyone know what the difference is in using one or the other? I've been looking around and can't find anyone who uses ...
3
votes
2answers
78 views
arcpy Problem with updateRow() when trying to update fields with UpdateCursor
I have a list of values which I am trying to add to an existing shapefile. The field where the values need to be inserted has been added via arcpy.AddField_management and thus the values of the rows ...
0
votes
0answers
13 views
MapInfo8.0 is not letting me edit layers imported from the server? [duplicate]
I have imported 4 layerts from my server for use in MapInfo, when i went to edit these layers the edit tool for each of these layers is grey and non accessible.
Any suggestions would be greatly ...
6
votes
2answers
95 views
Refresh open attribute table in ArcMap (arcpy)
I am running the Calculate Field GP tool from the arcpy in ArcMap. When a row value is updated, it does not show up untill I use the Reload Cache tool (Table Options > Reload Cache). How do I refresh ...
1
vote
1answer
79 views
Search cursor stops selecting after two iterations
I have a script which selects an extent from a grid and exports the data frame.
import os, arcpy
mxd = arcpy.mapping.MapDocument('CURRENT')
df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0]
...
2
votes
2answers
57 views
How to create network dataset for network assistant using ArcPy?
Is it possible to create a network dataset with arcpy to be used with the network assistant?
In the documentation I found the Build Network and Dissolve Network functions, but it looks like both ...
4
votes
1answer
42 views
Using matplotlib to create and export graphs automatically from ArcMap
I am going to start a project soon where, after the data has been processed in various ways, an output jpg showing a graph of the data should be produced. The workflow is as follows:
1. A feature ...
1
vote
0answers
25 views
Problems running zonal statistics - not all zones represented
I have been working on a Python script to automate the steps illustrated by whuber here:Create points around the edge of viewshed results
I am trying to create a horizon graph illustrating the ...
0
votes
1answer
19 views
How to add layer in Arcscene using script tool
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
addLayer = arcpy.mapping.Layer(r"F:\project\Final\Ground floor\steps.lyr")
...
2
votes
1answer
63 views
How to write point geometries with arcpy instead of gp syntax?
Can someone help me fix some code that simply writes points into a featureclass? It used to work in the older gp. syntax, but I'm having difficulties rewriting it in arcpy for ArcGIS 10.0. In this ...
1
vote
2answers
63 views
How to Add Shapefile with Symbology from Layer File to ArcMap MXD using ArcPy/Python?
Say I have a Shapefile:
C:\DATA\points.shp
A layer file:
C:\SYMBOLOGY\symbology.lyr
And a map document:
C:\MAPS\map.mxd
How can I add points.shp to map.mxd with the properties of symbology.lyr ...
3
votes
1answer
54 views
Why is my simple arcpy script failing? (sets raster cell value to null if below threshold value, ArcGIS 10.1)
As mentioned in the title, simple script to set null cell values below three standard deviations beyond the mean:
import arcpy, sys, os
#Accept input and output raster
inRas = sys.argv[1]
outRas = ...
2
votes
2answers
87 views
Help with Python and adding a grouplayer to arc, renaming it from a folder name, then adding layers to it from that folder
I am trying to use os.walk to go through a directory tree, pull out all the .shp files in it, create a grouplayer in the mxd, rename the grouplayer the folder name, then add the layers from that ...
1
vote
1answer
59 views
A simple Python Script to save the currently opened mxd and changes
Here is what I have so far...
import arcpy
import arcpy.mapping as map
mxd = map.MapDocument()
mxd.save()
And yes I know that map.MapDocument requires an argument, but I want it to automatically ...
1
vote
0answers
70 views
How to embed a PDF into an Excel spreadsheet? [closed]
This is what I want to do:
Create report using a polygon feature class to output areas of polygons using some logic and the ExportReport() function (This I have accomplished)
Create a PDF of the ...
2
votes
1answer
45 views
How can I set the settings of an Address Locator within a Model or arcpy?
I am creating a model that processes a large road dataset, then creates an address locator from the roads. The Create Address Locator tool does not allow me to set options like Spelling Sensitivity or ...
1
vote
1answer
54 views
How to get an attribute of the selected feature and pass it into a URL?
As a total Novice with Python, I thought 2 weeks would be enough time to learn how to build some tools for our GIS... I was wrong and I'm running up on a deadline.
I am attempting to get a value ...
1
vote
0answers
30 views
arcpy & TraceGeometricNetwork return ERROR 000584
I am developing a script to automate the creation of a road network following varying criteria.
I have created a geometric network and I would like to get the connection between several points with ...
0
votes
0answers
32 views
Create annotation layer with follow feature option set as default
I would like to create an annotation layer that has the "follow feature" option as the default. I've looked all over and can't seem to figure out how to do this from the initial annotation layer ...
0
votes
1answer
32 views
How to Average neighboring county data and store in original?
I have data for several rain stations, i have averaged the data and given each county a value. Some counties have null values and I would like to pull the data from the all the bordering counties and ...
-3
votes
2answers
83 views
What does Runtime error : 'NoneType' object has no attribute '<field_name>' mean?
Here is my code
#arcpy
import arcpy,sys
from arcpy import env
env=r"C:\Users\Jaya\Desktop\python_practice"
totalRec=arcpy.GetCount_management("river")
rows=arcpy.SearchCursor("river")
...
1
vote
2answers
102 views
How to list Feature Classes of Multiple geodatabase in Multiple Folder?
I'm new in python scripting and try to list polyline feature classes of multiple Geodatabases. The Geodatabases are in many nested folders.For example in folder "A" I have 20 folders and in each ...
1
vote
1answer
40 views
Append to rather than overwrite to a single table in arcpy
The code thus far works to create multiple output files, but I'd like to set it up so that the data is all exported onto a single table across multiple rows. The issue is I believe with the part in ...




