Python is an open source interpreted programming language used in many GIS programs.

learn more… | top users | synonyms

0
votes
0answers
20 views

Using python libary simplejson and urllib in PostGIS

I installed PostGreSQL9.3 and want to create a Pl/Python function using simplejson library and urllib. First I use OSGeo4W Shell to test the similar python script, it works. Then in PostgreSQL, it ...
0
votes
0answers
30 views

how to create a shapefile containing attributes from a list?

I have a list of features and each feature is a dict in that list. following you can see the structure: [ {"FID": 0, "Shape": polyline, "Nodes": [0,1]}, {"FID": 1, "Shape": polyline, "Nodes": ...
0
votes
0answers
15 views

Exporting ArcSDE feature class to shapefile using OGR?

I'd like to export data from ArcSDE for SQL Server to SHP. I've tried first to run this python script in QGIS: http://trac.osgeo.org/gdal/browser/trunk/autotest/ogr/ogr_sde.py But finally I've got ...
0
votes
0answers
21 views

ArcPy select and merge dropping records from table?

I'm working on a python script for ArcGIS using the arcpy module. I have ArcGIS 10.1 and Python 2.7 on Windows 7 machine and using Notepad ++ and IDLE to run it. The script selects specific records ...
0
votes
0answers
14 views

CreateObject cannot open map document error when cycling through list of MXDs

I have a stand alone Python script that aims to make a list of data sources from a series of folders/sub-folders full of MXDs. However I am continually getting the: CreateObject cannot open map ...
0
votes
0answers
18 views

Gdal_Calc.py random pixel error

I'm using the gdal_calc.py in python in order to do the same thing as the Con tool in ArcGIS. I'm calling the .py using os.system: os.system('gdal_calc.py -A%s -B%s --outfile=%s ...
0
votes
0answers
12 views

QGIS 2.4: adding feature with setLineEdit() data not saving to database

A while ago, I struggled to get a combo box working correctly for QGIS 2.0. This involved transforming a combo box into a line edit if the item named "other" was chosen, enabling the user to add a ...
0
votes
0answers
21 views

Unable to load shapefiles fully using shapefile.py

I am trying to load my shapefiles directly via Python rather than loading them from Arc Catalog to ArcMAP. I load these modules first: import sys import os import arcpy import numpy Then I add a ...
0
votes
0answers
36 views

developer problem with PyQGIS

I am a QGIS developer. We have been modifying the source code of QGIS for several months and have done good work in QGIS version 2.1. After that we tried to do the same modifications for QGIS version ...
0
votes
0answers
62 views

QGIS 2.4: plugin changes map tool canvas click behavior from 2.0

I had created a plugin for QGIS 2.0 to add new features more easily. It involves changing extents and updating snapping options along with triggering the default actionAddFeature(). However, I've ...
0
votes
0answers
24 views

Running a bat file for rebuilding and republishing a geocoder using two Python scripts, but would it work better as one script?

We all love ESRI and Python.... I'm looking for some insights and here is the situation. I've got a bat file calling two separate .py scripts. The first .py is a geocoder rebuild and the second is a ...
0
votes
0answers
31 views

how to remove a point or polygon in shapely python

I want to place minimum number of sensors(circles) to cover a maximum area(polygon). I am using "Shapely",python module. I want to know if a sensor i.e a point buffer inside the range of the other ...
0
votes
0answers
14 views

QGIS + python, Attribute index 0 out of bounds [0;0] when adding a feature to a PostGIS layer (view)

I have a plugin which adds features to a particular PostGIS vector layer using the code below feat = QgsFeature() feat.setGeometry(qgsgeometry) layer.dataProvider().addFeatures([feat]) For one user ...
0
votes
0answers
27 views

Does somebody has a Python script for a Multiple Flow Algorithm?

I´m looking for for a python script for a multiple flow algorithm assigning flow to all lower cells from one central cell. This algorithm is part of the r.terraflow and would need it to start at a ...
0
votes
0answers
54 views

I cannot use Gdal Python but Gdal binary, how to fix?

**UPDATE: I can use GDAL with Python now by copy file from Gdal 1.11 compiled folder to Python package folder. But the problem with GDAL binary and GDAL library that they cannot read the HDF5 file. ...
0
votes
0answers
27 views

QGIS Init script: How to get active layer and GID of edited object?

I would like to ask, how to get the GID (from Postgresql+Postgis) and active layer of edited object in QGIS Init script (Python)? Code Layer=qgis.utils.iface.activeLayer() works in QGIS console, but ...
0
votes
0answers
19 views

Error when providing “Python init function” from Python script in QGis

Problem I am using QGis and Python scripting to programmatically set a layer's edit form and "Python init function". It appears that the Python init function is called correctly in one situation ...
0
votes
0answers
17 views

GRASS r.out.mat memory issues

we have built a model with pythn/GRASS that calls the r.out.mat module. The area is quite large 25,000x25,000 cells. The machine we are running it on is Windows 7 machine with 16GB of RAM. After a ...
0
votes
0answers
25 views

pyQGIS (Spatial Join): Sum features of attribute from point layer and join with vector layer

I am new to Python and QGIS. I have avoided asking questions up to now. But by now I have developed a reasonable idea of where i want to go so and where I am stuck. So, I have decided to ask but sorry ...
0
votes
0answers
10 views

maptool doesn't receive key pressed events after QMenu.popup() function

I am developing a qgis python plugin which uses a maptool receiving key pressed events by keyPressEvent(self, event) function, mouse movements events by canvasMoveEvent(self, event) function and mouse ...
0
votes
0answers
21 views

QgsMapRenderer to export current extent using PyQGIS

I am trying to accomplish PyQGIS simple map rendering via the QGIS 2.0 Python console, but end up with only a blank image. I've followed instructions of this link. My objective is to export a simple ...
0
votes
0answers
27 views

Suggested Workflow for Generating NITF (w/headers) using Nitro in Python

It seems that there is no real suggested workflow for generating an NITF file from a georeferenced, validated tiff image. Here are my inputs: Pyramid Tiff Image - georeferenced MBR (minimum ...
0
votes
0answers
22 views

QGIS - Calling interpolation extension from python console

I would like to call the QGIS interpolation extension function (TIN method) (Raster->Interpolate) from python console. I can't find the corresponding function within QGIS API or within the ...
0
votes
0answers
54 views

What is GDAL equivalent to ArcGIS Lookup (Spatial Analyst) tool?

I use the Lookup (Spatial Analyst) tool to create several raster layers from a combined raster layer. I know ArcPy can do the same thing. However, I would like to know whether GDAL (or another ...
0
votes
0answers
57 views

How to keep all the unique columns of the shapefiles after merge?

Writing a script where the user is asked to select a directory which contains Folder_1 and Folder_2, both containing shapefiles and run various algorithms. The basic logical process of the script is: ...
0
votes
0answers
24 views

Save map canvas as image with drawings

Is there any way to save the map canvas as an image, with the drawings on map? I draw a line on map, and saved it as image, but only the map saved(without line). I used the following code.. ...
0
votes
0answers
16 views

Zoom option error on gdal_tiler.py

I'm using the tiler-tools library from: https://code.google.com/p/tilers-tools/wiki/QuickStart And specifically this command: ./gdal_tiler.py --zoom=9-15 my_map.vrt To generate tiles. When I use ...
0
votes
0answers
29 views

How to display image on the Graphics View widget in QGIS

The idea is to create a plugin in QGIS in which on mouse clicking of the layer show up a popup with Graphics View widget on it. I found this pure code: self.scene = QtGui.QGraphicsScene() ...
0
votes
0answers
17 views

Correctly drawing wrapping circles using Basemap

I've been using the functions from here to draw circles on maps using Matplotlib Basemap. This works well, but breaks badly at the map edges: I'm wondering whether there's a general approach for ...
0
votes
0answers
11 views

QGIS custom action and button toggle

I've added a custom toolbar with some buttons to my QGIS 2 plugin. I'm wondering how to get the button toggled (pushed in-looking effect) using Python. I've gotten this to work for existing buttons ...
0
votes
0answers
27 views

How can I define coordinate system of feature class when overlaying with coordinate zone shapes in python?

I have generated bounding boxes for CAD drawings that do not have defined coordinate system files. I know that each drawing could be in one of 6 different systems that do not overlap. My idea was to ...
0
votes
0answers
22 views

How do I install PyProj module for Python 2.7 on Windows 7?

I am having trouble installing the pyproj module for Python 2.7 on Windows 7. I have tried both the 32 and 64 bit installers from this list but the install crashes each time I run it. I have the ...
0
votes
0answers
47 views

How to write a signal for 'QgsMapCanvas::xyCoordinates (const QgsPoint & p)'

I am very new to QGIS and python. I am writing some python codes and I want to capture the x,y coordinates when the cursor moves on the map layer. (same as the coordinates show in the QGIS status bar) ...
0
votes
0answers
18 views

Plugin Ui interation with user and Qgis

A downsized hydrogeology plugin ( GraphicGroundwater = GGW ), instilled the need of a reduced combination of Carson's 'fTools doVectorGrid' and Pryet's 'Qgridder' plugin(s). The GGW Ui is displayed ...
0
votes
0answers
18 views

ArcObjects open report wizard

ArcMap provides a function to create report and after the creation can save as different formats. Now I want to allow user to skip the intermediate steps. I want do the report function using ...
0
votes
0answers
21 views

SST process using just GDAL and python

I am trying to process AVHRR 4km SST using a module that uses only GDAL and Python. OSGEO4W, GDAL, Python 3.4.1. I borrowed the download code from http://grasswiki.osgeo.org/wiki/AVHRR. The rest I ...
0
votes
0answers
22 views

Use python to execute GRASS module v.distance

I have successfully use python script to import a line shapefile and a point shapefile into GRASS, and the following are their attribute table in QGIS, line shapefile point shapefile Now I want ...
0
votes
0answers
38 views

pyspatialite, cannot update geometry

I'm trying to update geometry column with pyspatialite but it returns error: spatialite.dbapi2.IntegrityError: mypoints.the_geom violates Geometry constraint [geom-type or SRID not allowed] My ...
0
votes
0answers
39 views

How to delineate Watershed from DEM in python?

My question is that without help of arcpy how can I delineate watersheds from DEM? If anyone help me upto catchment delineation it will be very helpful to me
0
votes
0answers
31 views

Assigning a changing value to a variable in ArcMap using Python

I have two lists/strings/sets (the exact format can easily be changed) of values (u and v). I would like to do a cost distance analysis between each point in u and all points in v. For this, I need to ...
0
votes
0answers
32 views

QGIS r.cost / r.drain and errors

I'm trying to find the optimal route of several archaeological sites with Qgis 2.2. I've a DEM and r.walk or r.viewshed executed successfully, but r.cost always fails creating the output, however ...
0
votes
0answers
39 views

Error: Algorithm not found

I wrote the following code to start using QGIS APIs. in a very short script seen below, the "Error: Algorithm not found" is thrown and "print processing.alglist()" is showing none. Any idea why this ...
0
votes
0answers
55 views

PyQgis: How can I “append” features to a Vector Layer instead of “stacking” them?

As I read data from a text file and add points to a QgsVectorLayer (as well as related attributes), each new record gets 'stacked' on top of the previous one in the Attribute Table (and within the ...
0
votes
0answers
35 views

QGIS Python API: SAGA difference algorithm does not split parts

I am using the QGIS Python API in an external script (platform: ubuntu). Everything works as expected. But when I am using the SAGA difference algorithm within the script, there is an issue. The ...
0
votes
0answers
20 views

'QgsGraph' object does not support indexing

Traceback (most recent call last): File "/home/kasun/.qgis2/python/plugins/floogin/floogin.py", line 246, in findRoutes path=self.astar.astarSearch(graph, start, end) File ...
0
votes
0answers
43 views

Draw polygon shape via Qbutton

Ideally; a Ui Qbutton is needed that will activate map canvas editing to add a polygon via the classic mouse click rubber band method. Upon a concluding right click with the active tool, editing ...
0
votes
0answers
48 views

gdal commands cannot import gdal — possibly ArcGis conflict with separate Python?

I installed ArcGIS 10.1 yesterday (Windows 7 64-bit), but have a separate Python 2.7 installation. Now my gdal does not work correctly anymore. It looks like all commands without the ending "*.py" ...
0
votes
0answers
30 views

Running algorithm from Processing takes much much longer time than doing it from Qgis GUI

I have a road layer with 32000 features, and I want to find all the intersections. when I use processing->SAGA -> convert polygon/line vertices to points, it is all done in less than 5 seconds. ...
0
votes
0answers
23 views

QgsFeatureRequest and QgsVectorLayer are missing in the QGIS

I am trying to use part of my friend's code in eclipse written in Python using QGIS APIs. I have installed the QGIS 2.2.0. now before running the code, it seems that something is missing here. All ...
0
votes
0answers
25 views

Using GDAL and Python to replace the Spatial Analyst TabulateArea method

Has anyone tried to phase out the use of ESRI's Spatial Analyst extension by replacing it with GDAL in Python? I have a script that only uses the TabulateArea and Statistics analysis but not much else ...