Questions tagged [python-2.6]

A version of the Python programming language.

Filter by
Sorted by
Tagged with
13 votes
3 answers
12k views

Gdal Dataset.ReadAsArray() crashes Python

I am using Python 2.6.5 (32bit) with Numpy 1.3 and Gdal 1.9.1 installed on Windows 7 64bit. I am trying to read an 800 MB Imagine (.img) raster dataset into a Numpy array to do some raster algebra, ...
Brian's user avatar
  • 4,209
10 votes
1 answer
681 views

Using ArcPy and PyGRASS tools in 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. ...
Martin's user avatar
  • 1,273
9 votes
4 answers
10k views

Copy file geodatabase 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?
Z77's user avatar
  • 1,177
8 votes
6 answers
6k views

Estimating river Channel Width using Python/ArcGIS/MATLAB/R?

I am trying to estimate the river channel width from digitized polygon or poly-lines shapefiles. To do so, I converted poly-line shape files to points.shp at regular intervals (at 1 cm). Later, I ...
Amit's user avatar
  • 111
7 votes
2 answers
6k 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 ...
irini's user avatar
  • 71
6 votes
2 answers
2k 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 ...
user avatar
6 votes
1 answer
1k 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 ...
Emi's user avatar
  • 2,405
5 votes
3 answers
3k 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 ...
PolyGeo's user avatar
  • 65.1k
5 votes
2 answers
3k 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. ...
Ibe's user avatar
  • 1,231
5 votes
2 answers
3k views

Creating Loop to 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 ...
user1830's user avatar
5 votes
1 answer
748 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 ...
AlmaThom's user avatar
  • 844
5 votes
1 answer
2k 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?
Z77's user avatar
  • 1,177
4 votes
2 answers
2k 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 ...
George Diamond's user avatar
4 votes
2 answers
2k 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. ...
bny's user avatar
  • 303
4 votes
1 answer
456 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 ...
Z77's user avatar
  • 1,177
4 votes
1 answer
2k 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?
Z77's user avatar
  • 1,177
4 votes
1 answer
2k views

Creating shortcut (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 it'...
Mehdi's user avatar
  • 783
4 votes
1 answer
6k 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 ...
Czed's user avatar
  • 702
4 votes
1 answer
546 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 ...
archerne's user avatar
4 votes
1 answer
1k 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: #!/usr/local/...
js1983's user avatar
  • 321
4 votes
1 answer
125 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 ...
Baskinomics's user avatar
3 votes
3 answers
6k views

How to truncate file geodatabase tables with Python?

I need to truncate file geodatabase tables (1 or all) with Python. What is the code for that?
Z77's user avatar
  • 1,177
3 votes
1 answer
4k 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 ...
Martin's user avatar
  • 1,273
3 votes
3 answers
6k views

Adding popup message box before tool execution with ArcPy and ArcMap

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 ...
Ibe's user avatar
  • 1,231
3 votes
1 answer
416 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 ...
Ibe's user avatar
  • 1,231
3 votes
1 answer
1k views

Does SearchCursor reset work in ArcGIS 10.0?

In a script I have designed a function that is used multiple times on different search cursors to search through a whole table. Function variables: p - a list of points: actually a list of two-...
Mireslav's user avatar
  • 193
3 votes
1 answer
262 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 ...
Joseph Gutenson's user avatar
3 votes
0 answers
113 views

ArcGIS 10.0 Python script won't recognize null [duplicate]

Has anybody ran into in issue where Python field calculations and/or scripts won't properly query Null (None) values? The calculation I'm working on is a little more complex, but even the simple ...
Hoss's user avatar
  • 165
2 votes
3 answers
3k views

Using Python script to control GRASS GIS from outside?

I am working with GRASS 6.4.3 and python 2.7.6 under WIN 8.1. I am a novice with computer science and coding, and I have seen many posts including those: Is it possible to use GRASS GIS in Python ...
Heinz's user avatar
  • 1,545
2 votes
2 answers
5k views

Import Error: No module named shapely.wkb

OpenERP GeoEngine I have installed OpenERP 6.1 version, works fine. When I'm trying to add CamptoCamp GeoEngine Modules with OpenERP getting below find error: Installation Prerequisites: OpenERP 6.1,...
Silviaa's user avatar
  • 121
2 votes
1 answer
248 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 ...
Ibe's user avatar
  • 1,231
2 votes
2 answers
493 views

Use Cursor to Calculate Field with Input Parameters

I have the following script that is used with a script tool to truncate each word in an input string and output the result to another field. There is an input parameter for the length of the ...
Hoss's user avatar
  • 165
2 votes
1 answer
707 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 ...
Czed's user avatar
  • 702
2 votes
1 answer
452 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 = ...
celticflute's user avatar
  • 1,632
2 votes
2 answers
3k views

Making line from set of GPS points using ArcGIS for Desktop?

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 ArcGIS. I want to write ...
Hamid's user avatar
  • 21
2 votes
3 answers
2k 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 ...
Mehdi's user avatar
  • 783
2 votes
1 answer
719 views

Convert Field Expression to ArcGIS Python Script Tool

I've created the following field calculation that I'd like to convert to a python script tool: def blocklow(a, b, c, d): mylist = [a, b, c, d] # create list from input range variables if mylist =...
Hoss's user avatar
  • 165
2 votes
2 answers
3k 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 ...
Mike's user avatar
  • 2,281
2 votes
1 answer
1k 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 &...
A.H's user avatar
  • 21
1 vote
2 answers
630 views

Upgrade Python from 2.6 to higher version

I am using ArcGIS 10 desktop version. With this, the installed Python is 2.6. For some raster functionality (GDAL) I have to install the wheel file, to install wheel file I have to pip before to this. ...
Preethi R's user avatar
1 vote
1 answer
2k views

Getting ImportError no module named arcpy when importing 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 ...
Jason's user avatar
  • 89
1 vote
2 answers
3k views

Import Arcpy using PythonWin

I tried to install pythonwin26-212 from ArcGIS10.0 Desktop CD. pythonwin26-212 stops working as soon as I press "Enter" in the interactive window. (ps. I downloaded pythonwin26-212 from sourceforge ...
Apple's user avatar
  • 121
1 vote
1 answer
565 views

Create a new File Geodatabase(10.0) using data from existing Filegeodatabase(9.3)

I want top create a new file geo-database using python, which I am able to do using arcpy.CreateFileGDB_management(Fpath,"TestGDB","10.0") But I want to transfer all data from an existing File ...
GBh's user avatar
  • 381
1 vote
1 answer
621 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. import arcpy import os ...
Sam's user avatar
  • 313
1 vote
1 answer
205 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 ...
mohamed nour eldien's user avatar
1 vote
1 answer
2k views

Passing two variables into codeblock of Calculate Field tool of ArcGIS Desktop?

I have a script tool that truncates each word in field to 3 characters and outputs the result in a new field: "THIS IS AN EXAMPLE STRING" becomes "THI IS AN EXA STR" import arcpy arcpy.env....
Hoss's user avatar
  • 165
1 vote
1 answer
650 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 ...
Ibe's user avatar
  • 1,231
1 vote
1 answer
653 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?
Ibe's user avatar
  • 1,231
1 vote
1 answer
371 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), ...
cndnflyr's user avatar
  • 3,392
1 vote
1 answer
479 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. ...
JosephJ's user avatar
  • 11