Tagged Questions
7
votes
1answer
83 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
1answer
78 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 ...
0
votes
0answers
21 views
How to get Perpendicular cross section along the river using python and Arc Map 10? [duplicate]
I need to draw the perpendicular line segment along the river at a regular interval. How can i obtain like this output using Python and Arc Map 10 ? I would be very grateful if you give some idea..
3
votes
2answers
69 views
Python split table by “State” field and export to individual tables?
So I have never posted here before. I have used the site a lot for help so many thanks to all the great contributors. So, I have used ArcGIS online to perform batch geocoding (18,000) records and it ...
-1
votes
1answer
50 views
How can i draw a perpendicular line in a stream segment in a regular interval of 30m? [duplicate]
I have a stream segment which is polyline feature. Now I want to draw a line which is perpendicular to stream segment at a interval of 30m. How can i do it using python ? Do you have idea on this .
0
votes
0answers
14 views
AddLocations_na not loading routes properly from python script
I am trying to do network analysis with python from ArcGIS 10.0 but AddLocations_na is not loading the routes from the routes attribute table. It works for depots and orders quite well however.
The ...
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 ...
1
vote
0answers
31 views
Calculating the Centroid of polygon in modelbuilder (VBA to Python) [closed]
Got an easy one, that's got me stuck.
I'm moving some models that were created in 9.3.1 to work in 10.
Part of the model is calculating the X coordinate of a polygon to a specified field.
The code ...
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 ...
1
vote
2answers
60 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
55 views
Field calculator or update cursor?
I have a feature class in which one field (let's call it "Field_A"), as yet empty, is to be populated by the contents of another field ("Field_B") multiplied by a certain number (I'll call it the ...
0
votes
1answer
32 views
Make Route with Python and network analyst in ArcGIS 10
Good Day,
I'm having trouble debugging my python code to create a network analyst layer in ArcGIS 10.0. Basically when run from a script tool the code completes successfully without actually doing ...
2
votes
1answer
70 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 ...
0
votes
0answers
36 views
How specify a corridor minwidth?
I’m trying to make a corridor between two substations with ArcGIS, a macro corridor and a micro corridor.
I have two questions in this respect and would be grateful for your suggestions.
a) How can ...
1
vote
1answer
74 views
Editing attribute tables using Python
I am new to Python, so sorry for such a trivial question. There is a shapefile (let's call it Structures.shp) and the script I'm writing needs to update the value of only one record in only one field ...
0
votes
0answers
52 views
Congressional Redistricting
I have a project coming up where I need to create new congressional district looking at only total population data. I am planning on using the census tract level of data, but I am having some ...
2
votes
1answer
89 views
How to calculate volume from a raster file?
I have a raster file containing the depth of water. I need to find the volume of water using that raster file. I need to find the area of each cell and multiply with the depth. How can I do it in ...
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
0answers
55 views
Create easy Annotations from point features with python in ArcGIS 10.0
Because in ArcGIS 10.0 there is still no simple toolbox function to convert labels to Annotation, I try to go a substitude way with the callable Toolbox function [TiledLabelsToAnnotation][1] on a ...
3
votes
2answers
82 views
Delete feature selection using Python (ArcGIS 10)
I'm having some issues with a Python script for ArcGIS 10. The idea is to delete points from a single shapefile according to the values of two columns ("Tracks" and "Tracks_1").
Therefore, I want to: ...
0
votes
1answer
64 views
Join multiple shapes in a workspace based on a common field
I’m completely stucked!!! I’m working with meteorological data (wind) but I have to arrange the data for a program to be able to process it. I have text files, two per day (one with the wind direction ...
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 ...
8
votes
2answers
115 views
Arcobjects, mystery green lines in the Layout View produced during script execution
Could any of Arcobjects guru tell me, what are these green lines on my Page Layout and what to do, or not to do, so they do not appear? See image attached.
I do used Arcobjects from Python. My script ...
1
vote
2answers
48 views
ArcPy- AddJoin-function struggles using Table of PersonalGeodatabase
Hey,
I am doing some arcpy -functions and afterwards I'm trying to add the calculated results from one table to another table. I'm using the arcpy.AddJoin_management() function.
As input table I'm ...
1
vote
0answers
85 views
How to transfer the attributes of features based on their spatial relationship?
I'd like to check if a point feature class is placed on a line feature using python in ArcGIS 10.0. I have created a set of point features and placed them directly on a group of line features at ...
4
votes
2answers
90 views
Moran's I z-score in ArcPy
I have a ArcPy script to calculate Moran's I several times (50 to be precise). However, I am not interested in the Moran's I value, what I need is the z-score returned by the tool. Even though the ...
1
vote
1answer
109 views
Why does Add Field to Layer File give “ERROR 000840: The value is not a Feature Layer”?
I'm trying to add a field to a layer file, but it always gives an error. What I did was making a closest facility layer and save the result as a layer and after that I tried to add a field, but then ...
0
votes
0answers
34 views
Replace Null Values Field Calculator [duplicate]
I am using ArcGIS 10 and have a polygon shapefile in which many of the numeric fields are Null.
The polygon shapefile in question is produced by joining a polygon shapefile with a point shapefile and ...
2
votes
1answer
135 views
Am I over-complicating adding and then calculating fields? Suggestions for a better way? (Python)
I'm attempting to re-position a question I asked yesterday here. I am starting to think that the way I wrote my code just isn't the best way. Am I overcomplicating things?
I know for a fact that ...
2
votes
1answer
40 views
Arcobjects: DisplayTransformation.FromMapPoint() transforms wrong
I want to transform map coords into page coords in ArcObjects in Python. So I do, say:
>>> pApp = NewObj(esriFrame.AppROT, esriFrame.IAppROT).Item(0)
>>> pDoc = pApp.Document
...
2
votes
1answer
98 views
Incorrect field name resulted in RuntimeError: ERROR 999999 (Also, better code for adding and calculating fields)
This is the bottom half of my code (and it's been edited somewhat to share publicly). The code works perfectly fine when the fieldList has only three fields in it, but when I populate it with all 108 ...
2
votes
1answer
94 views
Spatial Join Python Command to summarize attributes
I am trying to run the Spatial Join function through the python shell in ArcGIS 10. When you do the point-and-click method of spatial join, you are given a tool window with an option that asks "How ...
0
votes
1answer
90 views
Delete first two letters from a string field
I'm looking for a field calculator python statement to delete only the first two letters of string entries.
For Ex:
!Name!.strip([0:2])
I know this syntax is incorrect.
Thanks a lot
0
votes
0answers
35 views
Dialogue/popup box in arctoolbox [duplicate]
I am using arcpy 10.0, python and arctoolbox. I was wondering if it is possible to have a dialogue box pop up within arctool box. I am familiar with
arcpy.AddMessage("Your message here")
...
17
votes
8answers
638 views
What are some resources for learning Python and arcpy?
I would like to learn arcpy, but I do not know quite where to begin. Does anyone have any good advice on where I should start to learn arcpy?
0
votes
3answers
97 views
Summarize values per row using field calculator via Model Builder
I think my problem is easy to solve, but so far I couldn't find a solution. I have a Feature Dataset created with the Union tool in Model Builder and now try to sum up all values of one specific field ...
1
vote
0answers
47 views
Script Tool Problems ArcMap 10.0
I Have a scipt tool that runs when input shape files are added from the table of contents (added from drop down menu.) However this tool will not run when they shape files are added using the add file ...
5
votes
2answers
111 views
Exit Python script in ArcGIS 10.0
I have a script with an bail-out function like so:
def die():
from sys import exit
exit()
Occasionally in the script I check a condition and exit if necessary. This works great in 10.1, ...
0
votes
1answer
77 views
How to update element text in arcpy.mapping? [closed]
I have a problem updating a map element text (named element1) in a map document using the following code:
a1 = '"' + ("element" + str(1)) + '"'
for elm in arcpy.mapping.ListLayoutElements(mxd, ...
7
votes
2answers
114 views
How to remove spikes in polygons with ArcGIS 10/Python?
In the picture below you can see a polygon layer, representing steep slopes, extracted from a TIN. The polygons have a lot of spikes in them. I would like to remove these spikes while the rest of the ...
2
votes
1answer
310 views
Using Python in the Field Calculator, how do I refer to a field in another shapefile?
I want to compare the changes in geometry between two shapefiles (of election districts in NYC. One is from 2001 and the other 2005). I am attempting to calculate a new field in the 2005 shapefile ...
1
vote
0answers
30 views
Script for populating field in ArcGIS 10 with consecutive numbers (where start numbers is decided by me) [duplicate]
Possible Duplicate:
How to add automate values to attribute field?
I need a script (for Arc GIS 10) by which I can populate a field against some selected polygons features.
For instance, i ...
0
votes
0answers
12 views
Arc 10.0 Running Python function CADToGeodatabase() crashes ArcMap/Catalog contd [duplicate]
Possible Duplicate:
ArcGIS 10.0 Running Python function CADToGeodatabase() crashes ArcMap/ArcCatalog
Sorry, no room to put all this in the coments window - tried putting this in Answer but ...
0
votes
1answer
78 views
ArcGIS 10.0 Running Python function CADToGeodatabase() crashes ArcMap/ArcCatalog
My code:
import arcpy, csv
from arcpy import env
dgnfile = str(arcpy.GetParameterAsText(0))
outFeatureClass = str(arcpy.GetParameterAsText(1)) #the fc in my fgdb template to be ...
0
votes
0answers
27 views
How to find-and-correct junction(like T, X, and more) for huge amount of data
I have made polylines by arc-scan from a tiff image. This polyline feature has 30,000+ polylines.I will make polygon feature from these polylines.Now,before making polygon i need to correct and clean ...
4
votes
1answer
145 views
How to import DGN geometry into a file geodatabase?
Specifically, I have an empty File GeoDatabase template consisting of several Group Layers, each containing several Feature Classes. In fact each FC has several subtypes exposed by including a .lyr ...
1
vote
2answers
120 views
What is the best quick way to populate a field (in ArcGIS 10)? (for rare language/font e.g. Guzrati numerals)
I have polygons generated from shapefile (esri) format
I have a tiff image of plot/parcel map(this tiff has plot id scribed in somewhat
consecutive in manner) of that polygon feature.
I would ...
2
votes
2answers
84 views
How to sort a field according to value range?
I have to check an attribute table field (MY ID NO) of polygon feature against a tiff image of parcel map where fields are written as 12-58,65,87,2565-89999,58648.
Example: Parcel map tiff(image) ...
2
votes
4answers
117 views
Error When Trying to Run Slope Analysis Script
I have written a script which is supposed to loop through all the rasters in a folder and perform a slope analysis on each raster and save the results in another folder.
I keep getting the following ...
6
votes
2answers
170 views
Python scripting- compute statistics
I'm new to Python but I've heard is a good way to automate tasks. I have thousands of point shapefiles and need to extract the maximum value of each one and put them in a new table. I'll appreciate ...


