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

learn more… | top users | synonyms

0
votes
0answers
63 views

how to create geometry type(point,line,polygon)on esri personal geodatabase*.mdb?

Qgis can not read geometry type on ms access*.mdb's table connecting with esri personal geodatabase *.mdb? This can open as test file, but unknow geometry type. Point can create using with "point ...
0
votes
1answer
84 views

Clipping GeoTIFF file by GeoJSON?

Input GeoJSON file: { "type": "Feature", "properties": { "id": 1 }, "geometry": { "type": "Multipolygon", "coordinates": [[[ [27.397511483867362, 44.161117466010516], [...
0
votes
0answers
11 views

gdalwarp fails based on output filename? does it have to do with my using -t_srs?

I am so confused by what is going on with my gdal warp. From my terminal I can enter a command for it: $gdalwarp -t_srs '+proj=ortho +datum=WGS84' test_imagery/Maui/OBS_IMAG.nitf testout3.tif ...
1
vote
1answer
80 views

Dynamically move map canvas and main window using PyQGIS

I am trying to create plugin that will open new window with some layer, Dynamically "pan" my window, when main window is pan. So boundingbox coordinates should be the same in both windows. I need new ...
1
vote
0answers
15 views

Getting the activeLayer() in Eclipse

I've been working on a plugin in python for qgis. I'm using Eclipse-pydev with remote-debug. I believe I'm set up correctly; I've followedthe Cookbook instructions completely. When starting remote-...
3
votes
1answer
75 views

Python to create new fields in many layers / QGIS

I have a number of line layers on which I need to perform the same task: add 4 columns with the start and end points of each line. The expressions that I use to do this are: $xat(0) $xat(-1) $yat(0) ...
1
vote
0answers
34 views

How to implement a Plotting widget into already existing PyQt4 Interface

I am using Python, PyQgis for about one week and already built a plugin for GIS 2.14 which is -so far- working pretty well. As my next step I want to add a widget to plot data to my already existing ...
1
vote
1answer
53 views

QGIS: startup.py executed twice?

To test something I have a very simple startup.py file in my .qgis/python folder: import qgis qgis.utils.iface.actionShowPythonDialog().trigger() print "Welcome chump" Python console launches fine,...
2
votes
2answers
94 views

GDAL python cut geotiff image with geojson file

I wrote the function which cutting geotiff image by bounding box. First image is original. At second you can see result off my code. I don't use gdalwarp or any console utilities. But I have no idea ...
2
votes
2answers
52 views

Clip raster with shapefile and set a value outside the mask

I want to clip a raster using a shape file with the command: gdalwarp -cutline INPUT.shp INPUT.tif OUTPUT.tif from this answer. However I want to set the pixels outside the mask to a particular ...
1
vote
3answers
84 views

Writing an if then statement for if a parameter is selected (not Null) in Model Builder

I have a tool I'm trying to create in model builder. I have run into a problem as I have basically no experience with python. I'm trying to basically use the calculate value tool and an if then ...
3
votes
1answer
106 views

How to use Qt3 Support widgets in QGIS plugin?

Similar to this post: My plugins crashes with “No module named qgsprojectionselectionwidget” in Windows. Except I would like to also use Qt3 Support widgets (in particular, a Q3ButtonGroup). However, ...
0
votes
0answers
32 views

QGIS Custom Query Plugin

I am very new to QGIS plugin development. Is it possible to create a custom form (Field will be fixed and User can select only operator and enter value for field) to do custom attribute expression ...
1
vote
1answer
37 views

Fixing python error in QGIS Freehand raster georeferencer plugin?

I am using QGIS 2.8.9 stable release in the 32bit form on a Windows 7 64 bit compatible PC. I want to use the Freehand raster georeferencer plugin. It installs without difficulty but when I try to ...
1
vote
2answers
79 views

python gdal - libgdal.so.1: undefined symbol: sqlite3_column_table_name

I just reinstalled my python environment (and my whole Ubuntu). In python (or IPython), when loading geopandas: import geopandas as gpd or when I import fiona: import fiona I get this error ...
3
votes
1answer
126 views

GDAL Python cut geotiff image

I was stuck for 2 or 3 days. I have read many lectures from RS/GIS Laboratory of Utah State University. Also I read «Python Geospatial Development» book and many docs from gdal.org. So, my problem ...
3
votes
0answers
75 views

Using ogr2ogr in python?

I found this helpful post that got me started using ogr2ogr in python: Using ogr2ogr to convert GML to shapefile in Python? as well as this one: How to convert ArcGIS Server JSON to GeoJSON? I am ...
2
votes
1answer
36 views

QGIS or PostGIS auto-split long line features

I have a dataset of LineStrings in a postgis enabled database and would like to automatically split any feature longer than a certain threshold (say 1 mile). I am aware of the Split Feature tool in ...
1
vote
1answer
70 views

Force Python GDAL/OGR to flush changes to disk

I am trying to write a simple list of features and export it as a KML file, adding one extra attribute: in this case trafficability. However, ogr is failing to flush the data to disk when I run the ...
1
vote
0answers
26 views

Autofill fields of pyQgis script

I have three fields of output vector layer in Qgis script: ##output_vector_first=output vector ##output_vector_second=output vector ##output_vector_third=output vector When user fill first field I ...
3
votes
1answer
34 views

AddRaster using pyqgis

I am able to attach a raster by using python console using the command shown below. qgis.utils.iface.addRasterLayer('D:/Work/dt0017810q.tif') But, when the same image/raster path is read from a ...
3
votes
1answer
47 views

How to check if a geoserver layer is raster or vector using gsconfig

I am using gsconfig and python in order to retrieve information regarding some geoserver layers. What I am trying to do is to find out if a specific layer is raster or vector. I read online that I ...
4
votes
2answers
101 views

Python: color Canadian provinces in a shapefile based on given values

The goal here is to create a choropleth map of Canada in Python. Suppose I have a dictionary with values referring to each Canadian province/territory: values={'Alberta': 1.0, 'British Columbia': 2....
1
vote
1answer
25 views

Wrong boundary when plotting Canada's shapefile in Python

I want to plot the Canadian shapefile with province boundaries highlighted and hollow filling. I have downloaded the shapefile from here. This is the script I use to visualize the shapefile: ...
2
votes
1answer
70 views

QGIS Python Script - Python.exe Stopped Working

I purchased this book called Building Mapping Applications with QGIS and I am trying to work through one of the exercises. There is one script that I try to run that crashes python, generating the ...
2
votes
1answer
64 views

Computing distance between two points following network and doing it for 100.000 points?

My starting data : a collection of points which are buildings a collection of points which are electrical transformation plant a network of vectors which is the public electric network from an ...
1
vote
0answers
29 views

Merging DEM file generted many negative value in QGIS

With four DEM files downloaded by Python Elevation package, I merged them in QGIS 2.8.3. I use raster-> Miscellanaous -> Input direction, no more attribute was added. The four dem data has ...
1
vote
0answers
20 views

Run and install packages from local folder QGIS [duplicate]

I use QGIS in my work and sometimes need install python libraries for plugins to work but I don't have write access to C:/ where QGIS and python is installed (OSGeo4W). Is there a way I can install ...
0
votes
0answers
73 views

How to analysis the spatial distribution similarity?

There are three different data source aiming at atmospheric chemistry research: Simulated concentration of ground level air pollutant Satellite retrieved concentration for the same area. ...
0
votes
0answers
53 views

Patch processing of multiple HDF5 files using Python and Gdal (gdalwarp)

I am trying to extend this process http://geoinformaticstutorial.blogspot.com/2014/06/reading-and-map-projecting-amsr-2-data.html wherein a set of raster data with separate geolocation arrays are ...
0
votes
0answers
31 views

How to add a field to an OSM file in Python?

I am writing a program that takes in a .osm file and then calculates some new attributes for that feature. I am using the python libraries gdal and ogr to help deal with the data. So far OGR has ...
2
votes
0answers
50 views

QGIS equivalent of Calculate Adjacent Fields for Atlas

Is there a QGIS plugin available or a processing model to calculate and populate fields that can be used to label the adjacent pages in a map book? Although there are tools to create vector grids, I ...
0
votes
1answer
54 views

Python Gdal write virtual raster

Is there a python module to create Virtual Raster (.vrt) xml files? Rather than writing text strings to a file, I'd like to know if there is an automated way to do this.
1
vote
1answer
67 views

Counting nodes/vertices in large polyline GeoJSON?

I have a large .geojson file (~ 1 GB) of made up of thousands of polylines. My objective is to count the number of vertices (not end points) in the entire file. Is there a python module that is ...
2
votes
0answers
19 views

get active colourramp form qgis rasterlayer

I m building a pythonscript were i need the active singleband pseudocolour colourband of a raster. I want to give the active colourramp a new min and max value. I can only find examples like this ...
2
votes
0answers
22 views

classify colourramp with new min and max value with python

For my script i want to update the existing colourramp of a raster with new min and max value. In my current code is can fill the min and max but can't classify and update the raster. How does the ...
0
votes
1answer
46 views

Exception using PyGRASS: “No module named 'core'”

I am trying PyGRASS on Ubuntu 14.04. I have GRASS 7 installed from the UbuntuGIS PPA: $ dpkg -l | grep grass ii grass 7.0.4-1~trusty1 ...
0
votes
0answers
19 views

finding orientation of nitf to display on cesium js globe

I am trying to display my nitfs on a cesium js globe. My first hope was to build kml of tiles and zip into a kmz file. This worked great in google earth, but cesium js does not support this. Their ...
2
votes
1answer
73 views

How to get attribute values from vector features visible in the qgis canvas

I have a vector layer (grid). Currently I select some tiles with the select tool and paste some python code to get information about these features. layer = qgis.utils.iface.activeLayer() ...
2
votes
1answer
67 views

Update raster color ramp with new min/max values using python?

For a script, I want to update the exsiting min and max of a colour ramp with a new one. In the image you can see what I want to update. To do so I tried to follow this thread. I tested the ...
3
votes
1answer
67 views

inaccurate distance measurements in Python

I've tried several ways of measuring the distance between two points in my Django application and comparing the results to a reliable measurement. My numbers are way off. For example, I'm assuming the ...
2
votes
2answers
62 views

GRASS 7 environment setup for Python

I would like to use some GRASS functionality from a Python programme. With GRASS 6 this required the set up of various environment variables, as detailed in the GRASS Wiki. I am trying a similar ...
0
votes
0answers
23 views

How to convert Integerized Sinusoidal Grid to lat long?

I'm trying to convert MODIS Integerized Sinusoidal Grid (0.25km/250m) to corresponding latitude and longitude. I found this tool to convert the data. I've written the algorithm for converting ...
1
vote
2answers
197 views

plotting US cities on a map with matplotlib and basemap

I am hosting a conference and want to show a map of where the attendees have arrived from. I have an input file with the names of the cities. I'd like to put a dot on each city, and have the size of ...
1
vote
0answers
57 views

Cannot run QGIS algorithm with python script without interface

I'm trying to run the QGIS 'intersection' algorithm from a Python script: (Working with Ubuntu) #!/usr/bin/env python # -*- coding: UTF-8 -*- import sys from qgis.core import * from PyQt4.QtGui ...
1
vote
1answer
32 views

ArcGIS Server - problem publishing python script that uses urllib

I have problem publishing this simple python script as geoprocessing service with ArcGIS Server. import urllib import arcpy u = arcpy.GetParameter(0) url = "http://geoegl.msp.gouv.qc.ca/cgi-wms/...
0
votes
0answers
20 views

64Bit Applications installed with QGIS/osgeo4w

Is python 64bit and gdal 64bit automatically installed when QGIS 64bit is installed via osgeo4w 64bit? I currently have a custom 64bit python and gdal setup on my pc. However, this setup causes some ...
1
vote
1answer
70 views

Install GDAL python package in virtualenv on mac

I'm trying to instal the GDAL python package, preferably in a virtual environment, but when I try "pip install gdal", I get the following error: extensions/gdal_wrap.cpp:3085:10: fatal error: '...
2
votes
1answer
51 views

How to include QgsRasterBandStats in plugin

I'm making a plugin were i want to get the min and max value of a raster. When i tried the following code in the qgis python console it worked fine but in my plugin code i get the following error ...
0
votes
0answers
36 views

need to convert tiff and kml to geotiff

I'm looking to combine a tiff and kml file into a geotiff (this needs to be integrated into a program i'm writing, unfortunately not a one off). Due to dependency issues I can't use GDAL and it ...