A python API created by ESRI to perform geoprocessing and layer management.
0
votes
0answers
10 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 ...
...
1
vote
1answer
63 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 ...
1
vote
1answer
291 views
Formatting label styles using arcpy
In ArcGIS 10.1, I have a shapefile/layer with labels displayed on a map. Can I modify any of the formatting of the labels using Arcpy? Either directly in code or by importing style from another layer ...
7
votes
1answer
72 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
17 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
50 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)"""
...
12
votes
1answer
228 views
How can I utilize NumPy arrays to optimize big data geoprocessing?
I'm interested in learning how to utilize NumPy arrays to optimize geoprocessing. Much of my work involves "big data", where geoprocessing often takes days to accomplish certain tasks. Needless to ...
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 ...
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 ...
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
0answers
61 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, ...
8
votes
1answer
58 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 ...
1
vote
2answers
57 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 = ...
2
votes
2answers
44 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 ...
0
votes
1answer
37 views
Arcpy CreateUniqueName usage: keep original input names
This is a continuation of the question I asked here:
At this point I'm really just trying to get everything in one place and keep the original shapefile basename. I'll tackle merging like-named ...
1
vote
1answer
38 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 ...
2
votes
1answer
69 views
How come “Zoom to Polygon” always puts me in the middle of Nebraska?
This is an issue related to this question I'd asked a few days ago. I've got that code working, to an extent. Every time, though, that I double click on one of the Polygons in the attribute table that ...
1
vote
1answer
44 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 ...
10
votes
2answers
443 views
Metadata -auto build using python
We have a large (10,000 plus) repository of spatial data (shp/gdb/tab vectors and ecw/tif rasters and also las, xyz and DEM data) where some have metadata records in xml using anzlic metadata editor. ...
0
votes
1answer
36 views
Using 3D Raster Domain to get polygon of raster - but stripping Z and M values
I'm trying to convert a number of large, floating point rasters into polygons so I can view overlaps etc. I've been using 3D Raster Domain sucessfully to do this. The only problem is that the polygons ...
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
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
34 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
3answers
61 views
Apply rotation before FeatureToRaster_conversion
I am converting polygon shapefiles to rasters. With arcpy I am using the function FeatureToRaster_conversion.
gp.FeatureToRaster_conversion(InFeatures, InField, OutRaster, InCellSize)
This function ...
0
votes
1answer
46 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 ...
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
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 = ...
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 ...
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
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
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]
...
3
votes
1answer
93 views
Error with publishing Sort tool on ArcGIS Server 10
I have a model that has one tool (Sort), works fine on desktop. When I try to publish get this error.
Geoprocessing service initialization failed.
Invalid parameter: Tool - General Sort : Parameter ...
0
votes
1answer
86 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
38 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 ...
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 ...
-3
votes
2answers
82 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
85 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
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 ...
2
votes
1answer
271 views
Can't import arcpy in IDLE, pyscripter, or even ArcGIS10.1's Python window
After using arcpy and python for months with ArcGIS 10.1 without any problems I'm encountering something I can't work around or even find help with online. Something as simple as "import arcpy" is ...
0
votes
1answer
339 views
How to use variable field name in arcpy.SearchCursor?
I have code that says
fld = fieldName
rows = arcpy.SearchCursor(fc)
for row in rows:
x = row.fld
How do I use a variable for my field name in python ArcGIS 10 on windows? Thanks.
3
votes
2answers
190 views
Merge Spatially Coincident Features in the Same Feature Class
I need a way to programatically merge grid cells (polygon 15x15m) that are directly on top of each other and add together some of their attributes.
I am working in ArcGIS 10.1 with the data stored as ...
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
76 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 ...
13
votes
5answers
494 views
How to make a GIS inventory?
My office will be seeing a big change in its GIS section. This section has been operational since the 1980's and has a huge collection of GIS data (i.e., shapefiles, raster files, data, etc) but never ...
3
votes
2answers
77 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
94 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 ...
5
votes
1answer
161 views
Changes in synchronized replica not shown in ArcMap or ArcCatalog without refreshing
I am synchronizing a one-way replica in ArcEditor using Python. I tried adding RefreshActiveView and RefreshCatalog to the code, but I still need to refresh the synchronized database to see the ...






