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

learn more… | top users | synonyms

1
vote
0answers
15 views

python - Composer plugin menu catch-22

a plugin for the Print Composer checks if the current project has at least one Composer when loading to avoid the error when creating the menu on a Composer that doesn't exist. However, once the ...
1
vote
0answers
31 views

Implementing Python script in QGIS with input variables?

I would like to implement this script in QGIS: How to draw perpendicular lines in QGIS? and be able to choose input data from the layers in my map, and iterate over them. The script from the link ...
1
vote
0answers
40 views

Installing Rtree on Windows 7 Python 35

I tried installing Rtree on Python35 on my windows 7 machine using the pip install command but ran into this error: OSError: could not find or load spatialindex_c.dll I also tried this and it gave me ...
1
vote
0answers
14 views

QgsCategorizedSymbolRenderer default ramp colors

I have a plugin and I want to symbology a vector file with some default ramp colors but I see that in graduated symbology is not so easy as in graduated symbology. Is it possible to assign a default ...
1
vote
0answers
40 views

How to call a package in QGIS python console?

I'm learning python and I'm also learning GIS (QGIS to be exact). What I'm trying to do is use the python console in QGIS to practice and get comfortable with python. Tutorials that I have found ...
1
vote
0answers
32 views

create own plugin

With the QGIS plugin 'plugin builder' I create a new plugin. Then I followed the steps described on this website : http://www.qgistutorials.com/en/docs/building_a_python_plugin.html It works perfect ...
1
vote
0answers
41 views

GRASS GIS i.landsat.toar hangs & holds CPU at 100%

I use python scripting to automate processing of several Landsat 8 scenes. I use a VPS (4 core, 8GB memory, SSD) running Ubuntu 14.04 with GRASS 7.0.1 Line in script for i.landsat.toar: ...
1
vote
0answers
40 views

Creating spatial layer from MS SQL Server table?

I have a table in MSSQL that I am trying to use to create a spatial layer from using the QgsVectorLayer function to load the table as a layer, and then using Fiona to create a shapefile but I am ...
1
vote
0answers
121 views

Boundless OpenGeo Explorer fails with Python errors

I am running this stack on a Windows 2012 R2 Datacenter. PostgreSQL 9.3.10 PostGIS 2.2.0 PGAdmin III 1.18.1 Geoserver 2.7.3 QGIS 2.12.0 Boundless OpenGeo Explorer 0.6.2 Everything runs ...
1
vote
0answers
16 views

qgis python map canvas saveimageas save wrong image

I've been trying to write a small python script to output 2 tif's based on given box extents. The script all works, box coordinates convert to project coordinates, zooms to right place (would like ...
1
vote
0answers
42 views

Activate tracking for ArcGIS Online with python

It is possible to update data in ArcGIS Online by python-script: http://blogs.esri.com/esri/arcgis/2014/01/24/updating-your-hosted-feature-service-for-10-2/ Configuration is done by changing the ...
1
vote
0answers
20 views

Render single band gray raster define gradient and cumulative cut

I want to save an image with these characteristics: gradient: white to black std deviation = 5 Until now I get to apply the gradient but the minimum and maximum values are used instead of ...
1
vote
0answers
30 views

Why doesn't the Undo/Redo History Widget run my custom undo/redo methods?

We're writing a Python plugin for QGIS 2.8.3. I've derived a class from QUndoCommand to contain "undo-able" work. When I push it onto the undo stack, its redo method gets called as expected, but QGIS ...
1
vote
0answers
24 views

Pass information in external command line software from a python plugin file

it would be quite difficult to explain, I'll do my best.. I'm writing a plugin for QGIS (with the plugin builder, so the folder structure is straightforward). This plugin calls other software (that ...
1
vote
0answers
26 views

QGis cannot retrieve a text value from QLineEdit

I am a developing a small plugin with python for QGis. I have a QLineEdit widget and I need to take the input from there. The input is a 8 character number string. However when I try to retrieve the ...
1
vote
0answers
46 views

How to create 10 day averages of a multiyear daily raster time series?

I have a set of daily modis LST rasters (.tif) over a roughly 13 year period (2002-2015). I would like to group them by 10 day periods, i.e. bin 1 = julian day(jd) 0-9, bin 2 = jd 10-19, etc so that ...
1
vote
0answers
17 views

Error when zooming to layer in PyQGIS application. On-the-fly transformation the issue?

I am trying to set the extent of my window to a layer on my canvas. This has worked smoothly until I started using Web Mercator maps instead of WGS84 maps. My features are getting their geolocation ...
1
vote
0answers
28 views

Automatically applying a local ortho projection using the center of the raster layer extent

I would like to take a raster image read the layer extents, extract the center point and then apply a custom local ortho projection with the origin set to the extracted center point. Can anyone ...
1
vote
0answers
172 views

Using Python to compute the distance, speed, and time between coordinates (lat/long) using haversine formula and print results within .csv

I have a .csv file with 10 columns. The first column is titled Distance_Between_Points, the second column is titled Time_Between_Points, and the third column is titled Speed_Between_Points and all ...
1
vote
0answers
64 views

QGIS Openlayers tool not showing tiles, but showing question mark

We have a proxy server which I've added to QGIS, but when I load openlayers, I get a grid with lots of questions marks, yet the watermark is supplied; any ideas? Fiddler doesn't show anything out of ...
1
vote
0answers
120 views

Use Anaconda's Python distribution within OSGeo4W

I want to use a Python script that executes Grass commands via os.system(). This of course, has to be executed from a running Grass session. However, when I use the OSGeo4W Grass, it does not find all ...
1
vote
0answers
62 views

Mapnik zoom_to_box for shape

I have used the code from Mapnik python tutorial. Now I want to use zoom_to_box to zoom to certain extent. I want to zoom to Box2d(-180.0, 0.0, 0.0, 90.0), however, after appied zoom_to_box, I saw the ...
1
vote
0answers
26 views

Changes in MOD09A1 quality mask as processed with GDAL

I'm analyzing MOD09A1 spectral data using GDAL/Python. The quality mask is a uint32 dataset and want to pull out the value of the first bit to mask the spectral data (1 == poor data; 0 == good data). ...
1
vote
0answers
205 views

Reading, modifying and writing a geotiff with GDAL in python

I'm trying the learn the ropes of Remote Sensing image processing using Python GDAL bindings and numpy. As a first attempt, I'm reading a Landsat8 geotiff file, do a simple manipulation and write the ...
1
vote
0answers
18 views

Matplotlib Basemap Coastal Coordinates

Is there a way to query basemap to extract all coastal coordinates? Say user provides lat/lng and the function returns true/false if the coordinates are within 1km from the coast? Links are more than ...
1
vote
0answers
26 views

Run entire model or validate with open model

I am creating Network Analyst tools for people who are very light users and need things to basically be buttons. Because of the way we use GIS this can't be done in a web application or any light form ...
1
vote
0answers
27 views

listing existing joins in table of contents feature

I am looking for a way to use python in ArcGIS desktop to check and print out the joins that exist between tables and feature classes in my map rather than right-clicking, going to joins and relates ...
1
vote
0answers
68 views

How to view the features of a point with a click in QGIS

I am developing a plug-in for QGIS. I am creating a form of personalized editing using QtCreator. The form is in the following image I read a csv file and when i click in a button OK I get a layer ...
1
vote
0answers
25 views

Calculate invariant moments for a each polygon in shapefile

I am working in python and have polygon shapefile created from polygonized binary raster. I populate the attribute fields for each polygon in a loop. I need to calculate the invariant moments fr each ...
1
vote
0answers
42 views

qgis python: select on screen and change (pre-set) properties accordingly

I have a map with different zones where I have drawn isochrones -where I will arrive within 15 min, within 30 min and so on. The picture attached shows the 15-120 min isochrones. This is set as a ...
1
vote
0answers
50 views

show polygon from database in browser in geodjango

I tried to retrieve the polygon which I saved into postgis database. (all polygons) Here is my code: models.py from django.contrib.gis.db import models class MyMap(models.Model): name = ...
1
vote
0answers
33 views

Creating Origin Destination Matrix from Station Locations

I am attempting to create an origin destination matrix in python for all of the London Underground Stations. I have the station name and the lat, lng of its location. It is in the following csv format ...
1
vote
0answers
30 views

Rendering problem in qgis

I have fetch data from database and draw it on qgis 2.8 as vector layer it works fine with limited data but for large data it will not work and goes into not responding stage, I am unable to ...
1
vote
0answers
104 views

Python-gdal create geotiff from array with colormapping

I am creating grayscale, single channel geotiff files from numpy arrays with the below module, but I would like to apply a fairly standard colormap to the data. I've tried three channels of R,B and G ...
1
vote
0answers
47 views

Run a exe file from QGIS

I am trying to run an exe file from the python console in QGIS. my_aplication.exe is a script made in Python3.4 and 'compiled' to windows exe file import os ...
1
vote
0answers
30 views

Python crashes when I try to import GDAL after re-installing it

A while back I went through the installation process for GDAL by installing the core components and then the Python/GDAL bindings. Everything was fine when I would type in from osgeo import gdal. ...
1
vote
0answers
23 views

QgsPalLayerSettings is not defined

So I'm writing some script for QGIS 1.8 and I'm unable to resolve this error. from qgis.core import * pallyr = QgsPalLayerSettings() The second line gives me error that QgsPalLayerSettings is not ...
1
vote
0answers
47 views

Make “qgis:delaunaytriangulation” and “qgis:dissolve” save their outputs on a specific predefined layer

I'm new to python and QGIS. I'm working on modifying a plugin which runs algorithms "qgis:delaunaytriangulation" and "qgis:dissolve" like so delone_triangles = ...
1
vote
0answers
46 views

how to make rectangle selection by mouse on my map(world shape file) in qgis in python

I want to make a rectangle selection using the mouse on my map (world shape file) in qgis in python and extract the lat long of the selection area but I don't understand how to do it. and don't ...
1
vote
0answers
65 views

How to accelerate my python looping process for A-star path finding on DEM surface?

I try to make an A-star Path Finding program base on tile-graph (image raster data as graph) where each pixel values represent as cost and elevation.. In my case, DEM raster data was called by using ...
1
vote
0answers
47 views

Can't get the web OpenLayers plugins to work because of 'python error' on my mac

I'm trying to get a relatively small section of Google satellite/ Google earth as a layer on Qgis on my mac. When I go to 'web' and the 'open layers' plugin it just comes up with python error. I've ...
1
vote
0answers
44 views

QGIS - Custom Icon to Show my Tool is Running?

I am running QGIS 2.6.1 (Brighton) I've some developers that have made some custom plug-ins, but our testers are complaining that they cannot tell when, if or what tool / plug-in is running. Is there ...
1
vote
0answers
123 views

Using arcgisimage along with python basemap

I am utilizing maps provided through the ArcGIS rest service when i plot information in Python, but have some problems understanding the different options I have when I request I map. The ...
1
vote
0answers
50 views

Using ModelBuilder or Python parser of Field Calculator to check values between two datasets?

I have a *.dbf that I need to check values against for a shapefile. I need to report whether the values match the dbf in the shapefile and, if not, what the value should have been (in two new ...
1
vote
0answers
104 views

How to wait for mapCanvas render before taking a screenshot?

i am trying to iterate over a large list of features and making a screenshot of the selected feature. My problem is that it seems to be a delay between the refreshing of the canvas and the taking of ...
1
vote
0answers
37 views

How to react to network events

I am in the process of writing a Plugin which should react to some data (XML-Format) sent via a socket connection. Since I have never worked with IPC in terms of python before and my knowledge of IPC ...
1
vote
0answers
30 views

Couldn't load plugin sextantelwgeomprovider, QGIS 2.0.1 on Ubuntu 14.04.2

I'm getting this error message when I start QGIS Couldn't load plugin sextantelwgeomprovider due an error when calling its classFactory() method Traceback (most recent call last): File ...
1
vote
0answers
101 views

Generating shapefile of polylines using pyshp from a csv file and opening file in qgis

I tried the solution posted in: Creating Polyline from GML using PyShp?, Using PyShp to convert polygons in *.csv to *.shp files? and Using PyShp to create polygon shapefiles? to generate ...
1
vote
0answers
48 views

How can i add sub menu under custom top menu in QGIS using python

I have added "My Tools" Menu on top. Now i am clicking on "Plugin" then selecting QGIS Plugin bulider. Here in the menu field a drop down list is coming. How can i add "My tools" in this drop down ...
1
vote
0answers
81 views

How can i add custom menu in QGIS Using python

I am tried to add a custom main menu in QGIS Desktop Application. Here I am already added custom sub menu in QGIS but I want to add a custom main menu in QGIS using Python. See the blow image.