A version of the Python programming language

learn more… | top users | synonyms

2
votes
1answer
253 views

Python Script that calls the Voronoi Polygons Function?

I've been looking to see if there was a way to call Voronoi Polygons function found in Vector/Geometry Tools, directly from the code but I have not found one. Does this currently exist? Is there a way ...
1
vote
1answer
31 views

Find minimum elevation along a polyline and return xy or point?

Using ArcGIS 10.1 and Python IDLE 2.7.2... I'm trying to find the minimum value of a polyline with a raster layer and turn that LOCATION into a point. I put everything together in model builder, but ...
0
votes
1answer
25 views

Unknown error concurring when developing QGIS 2.0.1 plugin in Windows 7

I am following the tutorial found here for developing a simple QGIS plugin within QGIS 2.0.1 installed on Windows 7. However, as I have began to try developing a link between the GUI and each the ...
1
vote
0answers
11 views

How to create a circle vector layer with 12 sectors with Python and to save average value of underlying raster in each sector?

Hi I am writing a code with Python 2.7 using Arcpy 10.1 and I guess I am doing stuck with a silly problem that lies under my eyes. I have created a grid of points (with "Create fishnet" function) over ...
6
votes
1answer
169 views

Increasing speed of Python scripts using arcpy

Update 4/11/2014 It looks like the script was getting hung up on the Delete Features tool, so I switched to Truncate Table, as suggested in the answer below. I also removed the unused variables from ...
0
votes
1answer
18 views

how to calculate the average temperature of each band of a .grd file?

I am having a GRD file in which the temperature at different longitude and latitude are given in a 32x35 array for one day(band),i am having 365 such bands and want to calculate the average of all ...
3
votes
1answer
146 views

Why does ArcGIS 10.1 Upgrade Geodatabase tool throw ERROR 999999: Error executing function?

I am trying to upgrade File Geodatabases using a Python script that runs fine until the step where it runs the Upgrade Geodatabase tool. The error is: "ERROR 999999: Error executing ...
4
votes
1answer
59 views

How to select all values by default in arcgis tool's multivalue parameter using python?

I am using ArcGIS 10.2 and have three parameters, Feature class, field and a multivalue parameter respectively in ArcGIS tool. I populate multivalue parameter with unique values of feature class on ...
3
votes
1answer
91 views

Can folder connection in ArcMap Catalog window be added using python?

I have created a set of general scripting tools for map automation etc. in one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity is there any way ...
0
votes
1answer
16 views

GRASS module g.mremove returns irrational outputs

I want to use g.mremove to remove multiple files in my mapset, import os import sys sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python')) import grass.script as g import ...
1
vote
2answers
107 views

Why my python script of r.watershed has no output?

I type those code in pyscripter, import os import sys #set up GRASS environment variables sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python')) import grass.script as g import ...
0
votes
1answer
46 views

GRASS module g.copy returns irrational outputs

I took this as reference, Moving raster to different mapset GRASS GIS, and I use pyscripter to use GRASS module g.copy from outside, import os import sys #set up GRASS environment variables ...
0
votes
0answers
27 views

GRASS module g.mapset can't create new mapsets from outside

I use pyscripter to control GRASS from outside. I want to create a new mapset named water. Here's my script to generate new mapset, import os import sys #set up GRASS environment variables ...
0
votes
0answers
9 views

saga_api python library : raise AttributeError(“No constructor defined”)

Good morning, I'm traying to execute a python script using saga_api library, unfortunately I'm stoped in the first step :(. when I tray to execute this command on python: ...
3
votes
1answer
88 views

Arcpy Update Cursor (arcpy.da.UpdateCursor()) not saving changes to 'SHAPE@LENGTH'

Looked around and found other Cursor questions, but nothing dealing with updating 'SHAPE@LENGTH'. I am running ArcGIS 10.2.1 and have a multipoint shapefile that I am grouping into polygons based on a ...
0
votes
1answer
50 views

How to save results of postgresql to csv/excel file using psycopg2?

I use driving_distance in postgresql to find distances between all nodes, and here's my python script in pyscripter, import sys #set up psycopg2 environment import psycopg2 #driving_distance module ...
0
votes
1answer
40 views

Use psycopg2 to do loop in postgresql

I use postgresql 8.4 to route a river network, and I want to use psycopg2 to loop through all data points in my river network. #set up python and postgresql connection import psycopg2 query = """ ...
1
vote
1answer
195 views

mosaic raster to file geodatabase yields missing raster sections

Since upgrading to ArcGIS 10.1 (SP 1) from 10.0, I've been encountering an issue when running the arcpy.MosaicToNewRaster_management() tool with output to a file geodatabase. I'm principally working ...
1
vote
1answer
88 views

How to execute sql lines in postgresql using python?

I use postgresql 8.4 to route a river network, the following is my code typed in pgAdmin and the result is fine, select * from driving_distance ('select gid as id, start_id::int4 as source, ...
1
vote
0answers
24 views

Error in cliping raster with multifeature polygon shape with arcgis9.3 using python

I have raster and I have a multifeatured polygonshape file. I Need to Clip my raster Image. Python code was developed for arcgis 9.3. It was working before and suddenly it stoped working. my codes is: ...
1
vote
1answer
30 views

Extract information of a raster overlayed on another raster with a lower resolution directly in python

I have two aligned rasters with the same extent, one has a resolution of 5 meters and the other of 125 meters. I would like to place the 5 meter one over the 125 meter one and assign to these smaller ...
0
votes
0answers
30 views

Python Error in recognising ENVI file

I am trying to read a .bip AVIRIS file using GDAL in Python. here is the code: from osgeo import gdal from osgeo import ogr from osgeo import osr from osgeo import gdal_array from osgeo.gdalconst ...
0
votes
1answer
221 views

Getting error in compiling make file for plugin build in qgis 1.8

I am using QGIS 1.8 for building plugin. For developing i am using following ref this link example. where in this step 6 where compile the makefile in OSGeo4W. gives error pyuic4:command not found. I ...
-2
votes
0answers
26 views

the functions In python

I work with ArcGIS 10.1 and I want to create a python script and I don't know with what I will replace these functions in ArcGIS 10.1: gp.SingleOutputMapAlgebra_sa() gp.Divide_sa() ...
0
votes
1answer
24 views

Better ways to check if GRASS r.water.outlet works out fine output

I use my python script to call GRASS module r.water.outlet from outside, and here's my script(I perform this script in pyscripter): import os import sys #set up GRASS environment variables ...
0
votes
1answer
21 views

How to map factors and their relative importance in ArcGIS 10.1 for Desktop?

I want to know how I can calculate a map from a set of factors (in the form of raster layers) and Their relative importance for example: slope 20% lithology 10% . . .
1
vote
2answers
41 views

arcpy 10.0 iterate through shapefile1 clip shapefile2 to shapefile1's polygons

I know that this question has been answered several times before, but for some reason I cant get this script to run...So I was hoping someone could point out where Im going wrong. I have 2 ...
2
votes
1answer
110 views

Field Calculator: return two or more field value

I trying to return three field values in same If Statment and conecate them, but i Get NULL value insted of the conecated fields getClass (!InDiameter! , !OutDiameter! , !TheridDiameter!, ...
1
vote
1answer
162 views

pyQgis in stand alone script, vector loading error

I am trying to use the Qgis functions in a stand alone Python script. I m running Mountain Lion OS, 2.7 Python & the Qgis 2.0.1 Dufour. My main problem is that I cannot get started - I cannot ...
0
votes
1answer
31 views

Difference between python IDLE and eclipse on accessing GRASS

I have seen these posts:GRASS and Python, Using Eclipse to develop GRASS Python programs. I used to use python IDLE to control GRASS, but I can't make python and GRASS connected, as I described in ...
0
votes
1answer
43 views

SyntaxError: invalid syntax (<string>) in Pl/Python (PostgreSQL) [closed]

I have python 2.7 and I have weather script which returns temperature infos, I would like to implement this script into PostgreSQL. I always got this error: DETAIL: SyntaxError: invalid syntax ...
3
votes
2answers
151 views

Sqlite, Python 2.7 and Spatialite

I am trying to spatially enable my sqlite database: import sqlite3 db = r'c:\temp\mydata.sqlite' conn = sqlite3.connect(db) conn.enable_load_extension(True) cur = conn.cursor() cur.execute(r"SELECT ...
0
votes
1answer
59 views

AttributeError: 'module' object has no attribute 'Open'

Hy, I am running the following code which I found on: GDAL - Perform Simple Least Cost Path Analysis which I adapted to my case, but I get the following error when running the code in the python ...
1
vote
1answer
21 views

How to Select by Location and assign attributes using Python?

I have a polygon layer with a 'lot' field, and a points layer. How can I use python to select the points by location (to find what points are contained in what polygons) and assign the value in the ...
0
votes
0answers
34 views

Suggestions on how to create an Owner Index for a Plat Book?

I've been tasked with creating a county wide plat book for publication this june. The cartography portion is fairly straightforward as I am using ESRI's Data Driven pages for ArcInfo 10 to produce the ...
0
votes
1answer
87 views

Is it possible to run qgis through python?

I need to build an app to analyze some raster layers in qgis. I thought it was possible to just write code in python (2.7.6) (IDLE) and let it automatically open QGIS, load some layers, do a distance ...
2
votes
2answers
51 views

python add fields that may have NULL values

I would like to use python to calculate a field (short integer) using other fields (short integer) present in the table. In some cases these fields may have NULL values for one or more of the fields. ...
0
votes
0answers
23 views

Reload Table Cache with Python & ArcGIS 10.1 [duplicate]

I am trying to create a button in arcmap that reloads the table cache. Exactly, like the existing button Table Options > Reload Cache. The button is inside when you open an attribute table. I would ...
3
votes
0answers
49 views

How to extract zipped shapefile and check its shape type using arcpy module without writing on disk

I have a zipped shapefile saved on my disk. I want to extract it in memory and check the shape type. I'm using arcpy module and want to stick to only default modules comes with python installation. I ...
1
vote
1answer
99 views

Export ArcGIS Model to Python - Iterate Rasters, Collect Values, Calculate Values

I want to batch process a large number of raster files, calculate some values and properties and export these to a .csv or .xls. I managed to get a good working model that does this perfectly. ...
0
votes
0answers
13 views

random point through raster

I've some issue in some task pls help if you can as I've not good python skills. I've a raster with values from 5 to 97 and I want a python script which can scan the raster and generate random points ...
1
vote
1answer
80 views

python dissolve by field error

I would like to dissolve a feature class by a field. When I run the code, I receive an error that says, "invalid topology [out of memory]" I have 16GB of RAM and terabytes available on the hard drive. ...
1
vote
2answers
18 views

Comparing projections of two datasets when SRID not available

Similar to this question: How to test if two GDAL datasets are in the same projection? However, the above does not cover cases where an SRID is not available. It can often be the case that an SRID is ...
2
votes
1answer
97 views

How to do a separate Python installation with ArcGIS?

I see a lot of threads asking how you can have a separate Python installation (e.g. the Anaconda or Python XY distribution) and get it to work with arcpy, while not 'breaking' ArcGIS at the same time. ...
0
votes
1answer
63 views

Plotting 3D Data using Python

I have a Uniform Grid of 1KMx1KM squares as a shapefile with population data in each grid in a specific column as an integer. I would like to extrude each polygon based on the population and export ...
0
votes
1answer
149 views

What might cause “python.exe has stopped working” when closing ArcPy script?

I created a script that take a .tab file and join it to a shapefile. The script works perfectly but when it finish, it gives me an unhandled exception which crashes python. I dont know what might be ...
1
vote
2answers
82 views

How to Project a point on feature in PyQgis?

In Arcgis IProximityOperator.QueryNearestPoint Method was available to get the nearest point. Similarly Is there any function available in pyQgis? Thanks in Advance.
-2
votes
1answer
52 views

How to create a link in the message body of email with Python? [closed]

I want to send an email with python that contains as a link in the body of an email as well. This link is actually a path to a file. If a receiver clicks on link It should open a folder where the file ...
4
votes
2answers
303 views

Gdal Python Bindings and File Geodatabase API

I'm trying to get python 2.7 to work with GDAL/OGR and an ESRI file geodatabase. There have been a few similar questions asked but the answers don't fully resolve my situation. I have installed the ...
1
vote
3answers
96 views

Append Attribute Table of multiple feature class with same points/ pointID

I used extract by points function to extract values from multiple rasters using a point feature class. The output is a couple hundred point feature classes with values associated with those rasters. ...