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

learn more… | top users | synonyms

0
votes
0answers
16 views

Clipping GeoTIFF file by GeoJSON?

What is the best way to clip geotiff file by geojson? 1) Make a OGR file (e.g. shapefile) .shp from .geofile like this: { "type": "Feature", "properties": { "id": 1 }, "geometry": { "...
0
votes
0answers
7 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 ...
0
votes
1answer
12 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
11 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-...
2
votes
1answer
30 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
12 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
0answers
21 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,...
1
vote
1answer
28 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 ...
1
vote
1answer
33 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
55 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 ...
0
votes
0answers
23 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 Q3GroupBox). 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
27 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 ...
0
votes
1answer
38 views

Python new packages installation with ArcGIS interpreter?

I would like to introduce some functions derived from scipyin my code. Since I also need arcpy, I use the Interpreter installed inside ArcGIS, whose directory is: (C:\Python27\ArcGIS10.3\python.exe). ...
1
vote
2answers
32 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
91 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
67 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
30 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
64 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
29 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
29 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
82 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
votes
0answers
37 views

How to get the nearest building to a point in Openstreetmap Python [on hold]

my goal is to get the distance to the nearest building from a point using Python and OpenStreetMap database. I already know the use of overpass API for obtaining the buildings around a certain point, ...
1
vote
1answer
22 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: ...
0
votes
0answers
15 views

Georefrencing a geotiff image using gdal and python [on hold]

I want to write codes for georefrencing a tiff image using gdal and python by either using GCPs or another georeferenced image.
2
votes
0answers
38 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
56 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
27 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
54 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
43 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
26 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
47 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
0answers
26 views

Grid based clustering for GIS data in Python to identify dense clusters [closed]

This is my first time dealing with GIS datasets. I have a 2GB GPS dataset that contains Polylines and timestamps for taxi rides. It looks similar to this https://archive.ics.uci.edu/ml/datasets/Taxi+...
0
votes
1answer
42 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.
-8
votes
0answers
37 views

Python elif not taking answers [closed]

In this code below, when it is executed, I can go through 2 of the raw inputs and then it shuts down and prevents me from inputting further, preventing my school project, which is a tour of the school,...
1
vote
1answer
58 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
20 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
34 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
12 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
65 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
62 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
58 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 ...