A version of the Python programming language

learn more… | top users | synonyms

4
votes
1answer
344 views

Efficient computation of nearest distance for each point to closest polygon

I'm looking for a more efficient way to compute the nearest distance between features from 2 layers, in this example for each point the nearest distance to the closest polygon. Is there a more ...
2
votes
1answer
280 views

OGR Python bindings

When I try to access one of the GRASS vector files through Python OGR bindings, it gives error: Here is the script code in Python 2.7.3 IDLE (GUI) in Windows 7. from osgeo import ogr ds = ...
6
votes
2answers
546 views

Calling GRASS functions from external Python

I have GRASS 6.4.3svn installed in my machine running Windows 7. Also in my machine i installed Python 2.7.3 for Windows.Now i need to call GRASS libraries from Python and not within the Python shell ...
0
votes
2answers
149 views

How to parse fields values using ArcView 10.0 scripting

I am using 10.0 ArcView and am trying to get the "R" in R12345678910 to drop. I lost all my scripts I've saved and appreciate some assistance. The numbers are in a column in the attribute table and ...
3
votes
2answers
557 views

How to draw rectangle to clip layers using python addin in ArcGIS 10.1?

I want to clip rasters in data view using interactive rectangle (to define Area of Interest) and add them to current dataframe. Following is a piece of code which is not returning anything. Any ...
3
votes
1answer
285 views

Pasing multivalue parameter using arcpy

I am trying to get my head around how multivalues derived from the arcpy command GetParameterAsText gets looped through a script. Could some please provide a sample script that does the follow basic ...
2
votes
2answers
131 views

Invalid Username When Developing a QGIS Plugin on Mac

On a fresh Mac OSX 10.8 install, I've installed Quantum GIS from Kingchaos binaries and it's running fine. I'm trying to develop a plugin for QGIS using Plugin Builder. The skel that Plugin Builder ...
0
votes
1answer
382 views

zonal histogram fails to create output table when looping

Using python I'm having problems when trying to attempt a FOR LOOP with the ZonalHistogram function of ArcGIS 10.1. It works fine if I use it only for one image but it gives me this error while for ...
2
votes
1answer
144 views

Why does ogr's CreateLayer() return None?

Why does ogr's driver method CreateLayer return None? I'm using python 2.7 with gdal 1.9.1. path = r'D:\_tempAuto' out_shp = '%s\test_OGR.shp' % (path,) driver = ogr.GetDriverByName('ESRI ...
0
votes
0answers
883 views

Use Python to change datasource from a feature class to a view built on the feature class

I'm trying to replace the datasource for all of the layers in my map document using Python but I keep running into an error. Right now, all of the layers point to a feature class called ...
1
vote
2answers
271 views

Start-up error message in QGIS: Unable to load the extension GoogleLayers causes an error when calling its method initGui () [duplicate]

Possible Duplicate: Problems with Google layers plugins Impossible de charger l'extension GoogleLayers provoque une erreur lors de l'appel de sa m├ęthode initGui() Traceback (most recent ...
3
votes
1answer
589 views

How to style a layer from console?

I am new to the QGIS python console. I am trying to load a raster layer from the console, set the crs and a specific style from a qml file. layerPath = os.path.join(raster_dir,raster_name) fileInfo = ...
1
vote
0answers
192 views

Mapnik: mapnik.has_pycairo() returns False. How to fix this on Windows for Python27?

I'm trying to modify rundemo.py (comes canned with Mapnik Windows binaries) to render output files at a higher resolution, but it seems I still have issues with my Mapnik-to-Cairo setup. I've got ...