A version of the Python programming language.
9
votes
1answer
196 views
Is there a way to use ArcPy and PyGRASS tools in the same Python script?
I´m trying to write a Python script, that includes different ArcPy / ArcGIS commands and want to combine it with GRASS geoprocessing tools.
Unfortunately importing the GRASS libraries doesn´t work.
...
6
votes
1answer
181 views
Why does tool take longer to run when in Python script?
I have written a python script that does some euclidean allocation. For that I use arcpy.gp.EucAllocation_sa() method. Now, my python script takes 30-40% extra time than spatial analyst euclidean ...
5
votes
1answer
72 views
Cursor only completes one loop
I am at the end of my rope here. This cursor runs fine for one iteration and then stops. It doesn't throw an error, it just completes. There are 3,000 rows in my table, so I don't know why it would do ...
5
votes
2answers
267 views
Get X, Y coordinates in the center of a raster cell
I am trying to get the X, Y coordinates of all the cells of a raster file, using Python 2.6 and ArcGIS 10.0.
I would like to get the X, Y coordinates in the center of the cell.
Is there any way to ...
5
votes
2answers
218 views
Read an ArcGIS Feature dataset using GDAL
I am new to GDAL in Python and would like to use it to create a list of populated layers in a ArcGIS mdb Feature datasets. I have the code below that provides a list of all the populated layers but ...
5
votes
2answers
753 views
Calculating slope cell-by-cell in ArcPy
I am relatively new to the ArcGIS-Python environment and want to calculate elevation raster slope. But it says "ValueError: setting an array element with a sequence". Below code is what I have. Any ...
5
votes
2answers
1k views
(New at Python Scripting) Creating a Loop so i can replace text in page layout in multiple mxds instead of one mxd at a time
I found some code on a website that will perform a search and replace on page layout text elements. Currently you can only do it one MXD at a time. I was hoping to change the code so I can do a search ...
4
votes
3answers
1k views
Why would “import arcpy” hang Python script run from DOS/cmd prompt?
I have a very small test script (test.py) that I use to see if Python is installed and ready to use ArcPy. All it contains is:
print "Starting"
import os
print "OS imported"
import arcpy
print "ArcPy ...
4
votes
2answers
239 views
How do I make a user input array or list in python?
I don't know which one I need actually because I am relatively new to python. What my goal is to have a stand alone script to run multiple buffers based on user input. For example, I would like to ask ...
4
votes
1answer
243 views
How to create a shortcut (a button) for “Make this the only selectable layer” in Python 2.6?
I'm trying to create a script in Python 2.6 to make a button or a keyboard shortcut for "Make This The Only Selectable Layer". I came across the following VBA scripts on the net, but the problem is ...
4
votes
1answer
91 views
How to join MySQL data with GIS data using arcpy?
Here is my problem, I have a MySQL database with table in it that has 4 columns: ID, Owner, Address, Legal. And I also have an ArcGIS GDB that has a parcel layer that has in it a PID field. I am ...
4
votes
1answer
656 views
How can I write a python script for repairing broken links in ArcGIS 10 for different new paths of layers or shapefiles?
I have an .mxd with broken link layers and each layer has a different new path.
I know the python script for repairing the broken links of the layers, but I want to put all the new paths of the layers ...
4
votes
1answer
92 views
Is it possible to use RPy/RPy2 in a Geoprocessing Script that is exposed as a GP Task on ArcGIS Server?
Is it possible to publish a Script tool that uses the RPy/RPy2 module (or more generally any Python-to-R link) to ArcGIS Server 10 SP2? If so, what specifically do I need to do, i.e. Install R on the ...
3
votes
2answers
136 views
How can you auto-increment in a Python Script (not Field Calculator)?
I want to autoincrement values in a field within a Python script. I've done this using Field Calculator and the code referenced here. I tried using this code in the Python script below but it is not ...
3
votes
3answers
640 views
VB/Python script to populate a field with maximum value among other fields
I am using ArcGIS 10. I have a little experience with python but i feel that python in ArcGIS is slightly different. VB will work fine as well.
Problem:
I have n different columns called 'percent_1', ...
3
votes
1answer
207 views
FME values used in python
I need one attribute value from FME and use it in python script as a parameter. How can I do this? Do I have to have def_init_() def input(), def close() also?
3
votes
2answers
373 views
How to use Matplotlib in Python 2.6 installed by default ArcGIS 10.0 installation?
I am wondering if anyone has successfully run Matplotlib with the default installation of Python 2.6 that comes Arcgis 10.0. It does not seem to work with the python version installed by Arcgis 10.0. ...
3
votes
1answer
146 views
Variable XML dataset as reader in FME
I have one problem i am thinking how to solve. My workbench is started from python script. Workbench reads xml file, but name of xml file is each time different. So is it possible to solve this with ...
3
votes
1answer
386 views
Run FME Workbench with Python
I would like start/run FME workbench from one external python script. Is there some simple syntax/command to do this?
3
votes
1answer
121 views
pair value comparison to generate new raster using arcpy/python
I want to write a function which takes in two arguments (from two rasters) and compare those 2 values against a set of hard coded pair values inside function. Then return a value which i want to use ...
3
votes
3answers
482 views
Using Python in ArcGIS 10, create a line between the middle of the polylines which are intersected
I have got a river network as a feature class in a gdb.
I need to calculate the topologic attributes via the connectivity graph of the river network. A graph-theoretic representation of river ...
3
votes
1answer
1k views
How do I programmatically create non-feature-linked, simple line callout annotation and set the anchor point?
Vitals: ArcGIS-ArcView 10.0, Python 2.6.5, PythonWin, comtypes
I'll start with my main questions: How, using ArcObjects, do I go about creating non-feature-linked geodatabase annotation features ...
3
votes
0answers
93 views
Exporting records from an attribute table and placing them in a txt file
I am trying desperately to grab records in a shapefile's attribute table and copy them, with additional formatting to a txt file. Below is the code I have developed thus far:
I have used the ...
2
votes
2answers
206 views
How to truncate file geodatabase tables with python?
Everything is in the title. I need to truncate file geodatabase tables (1 or all) with python. What is the code for that? Thank you in advance!
2
votes
1answer
54 views
create folder with random number for each session using arcpy
I am processing data and it is required to have same name of outputs [standard names] for different geographical regions. Therefore it is necessary to save outputs in different folders each time. Is ...
2
votes
3answers
297 views
pop up message box before a tool execution with arcpy/python
I want to add a box message to pop up before execution of a button tool. When I click a button which will do geoprocessing, i want a box to appear on view before processing with message that i am ...
2
votes
3answers
408 views
How to change DXF unit by Python 2.6
I have a bunch of DXF files to import into ArcGIS 10 but they are all in mm. However I need to change the unit to Meter and to do this I have to open AutoCAD to do it each time.
Can anyone help to ...
2
votes
1answer
186 views
Silence user warnings for GRASS-PYTHON program
I've created a program that runs externally from GRASS v6.4.1, using python 2.6. It imports an ESRI shapefile, and exports a seperate KML for every polygon in this vector file.
Polygons with ...
2
votes
1answer
282 views
ArcObjects ITextSymbol.GetTextSize in Python revisited: usage with StartDrawing and FinishDrawing methods
I am using ArcGIS 10.0/ArcObjects and Python 2.6. I am trying to get the usage of the ITextSymbol.GetTextSize method correct. The syntax, as established in an earlier question, is:
dblx, dbly = ...
2
votes
2answers
199 views
How to get easting & northing of cell in raster using ArcPy?
It might be very simple task. But I would appreciate if someone can comment on How I can get easting and northing of a single cell raster using arcpy as this value is used for in further steps. ...
2
votes
1answer
177 views
how to make a line from a set of gps points?
As a part of my research I need to create the trajectory of respondents according to the their collected GPS data (including X and Y). I am familiar with python programming, but I am a beginner in ...
2
votes
1answer
207 views
to extract 3d points from a shp file
I'm trying to work with the shapefile on python,
the file " donnees.shp" contains 3d points
I need to extract attributes from this file
but my code returns an error:
>>> import shapefile
...
2
votes
0answers
276 views
Stop an arcgis model until all values are collected and then continue
This is similar to Modelbuilder - If precondition is false, continue iterating next input but I want the iterate tool to run to collect all the values and only then continue to the merge. Any ideas? ...
1
vote
1answer
192 views
GRASS Geoprocessing in Python Script
I´m trying to get some GRASS geoprocessig tools running in a python script outside GRASS.
I´m able to import grass.script, but I´m not able to get the tools running yet. Does anybody know what I´m ...
1
vote
1answer
392 views
help writing a python script
Hi I need help with writing a script:
The task
I have a point feature class of graffiti incidents and a polygon feature class of patrol zones with some empty attributes already created for you. I ...
1
vote
1answer
86 views
ResultObject: Error in getting output
I am getting "ResultObject: Error in getting output" message when I run the following code. I know it has something to do with "os.path.join" but can't figure out what.
Thanks.
Sam
import arcpy
...
1
vote
1answer
84 views
Rectangle for Clip_management using arcpy
I want to draw an interactive rectangle on screen which should be used as the extent for clipping geometry for raster datasets. Any suggestion?
1
vote
1answer
96 views
Import works in Pyscripter2.6 and Python26 Console, but not in ArcMap
I'm trying to "import clr" and get an error saying "dynamic module not initialized properly". It works fine in Pyscripter and the regular console (which is actually updated from the PythonNet build), ...
1
vote
1answer
810 views
add definition query to layers in a group
I'm trying to develop a python code that will apply the same definition query to all layers in a specified group. I currently have a working code that will apply a definition query to all layers in ...
1
vote
0answers
95 views
Convert .mxd to .qgs, MXD2QGS fix?
I've had a look at the following thread about using MXD2QGS and so far I've figured out that this only works with version 10.0 and Python 2.6. I installed MXD2QGS on a machine with Arc10.0 and Python ...
1
vote
0answers
125 views
Why does AddGeometryColumn error using the libspatialite-2 DLL with pysqlite2?
What I'm trying to achieve is to create a geometry column of a point based on the latitude and longitude of that particular row in the already created table.
Given the following code:
...
1
vote
0answers
211 views
Relate first point and last point of polyline to point feature(s)
I am working on a small script using ArcMap10/arcpy to generate a upstream-downstream uniqueid for a polyline feature class using point id's that fall on the starting point and ending point of a line.
...
1
vote
0answers
369 views
ArcObjects: How to get the size of the formatted text part only of a TextElement whose text contains formatting tags?
I'm working in ArcGIS 10.0 and Python 2.6.5. I have a string, say 'mMx', that I want to enter into a TextElement (in the data view). The lowercase letters are to be substituted with a graphical ...
0
votes
5answers
512 views
How to copy a fgdb using Python?
I am trying to copy fgdb from one path to another using Python.
copy(base.gdb,dest)
And got the message:
Error Info:
[Errno 13] Permission denied:
How to fix it?
0
votes
1answer
655 views
It is possible to edit selected features with Python?
I'm trying to edit some fields of the selected features in ArcMap. It's possible to do this with Python (ArcPy)?
0
votes
1answer
105 views
geodatabase and relationship
I have two tables in a personal geodatabase and one of them has 13 records and 6 fields, the other has 118 records and 125 fields.
There is a relationship class between the two tables where the first ...
0
votes
1answer
451 views
create a fishnet using lat/lon table text file
I have a text file with lat/lon table values and want to use this information to generate a fishnet using python. Any heads up would be deeply appreciative. Also please point to if this has been ...
0
votes
1answer
713 views
Create HTML report using Python
i want to create Analysis report after createing model for generating cut/fill. Once it will done , basedon this cutfill/table, would be display statics in html formate using python. is it possible. ...
0
votes
1answer
410 views
Why do i get an input error no module named arcpy when i try and import it into pythonwin?
Here is the error i get when i use the import arcpy command in pythonwin:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named arcpy
Can any one tell me how to fix ...
0
votes
1answer
453 views
Create TIN from Elevation Points in Python
I want create a TIN from point features with elevation using a python script.
This is my script:
import arcpy
from arcpy import env
import json as simplejson
import urllib
import sys,os
...

