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

learn more… | top users | synonyms

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
2answers
189 views

Error Installing GDAL python package on a MAC

I'm trying to install the [GDAL python package][1] on a Mac (OSX Yosemite) with python 2.7.9 and GDAL 1.11.3. When I try $ sudo easy_install GDAL I get a number of errors ending with: error: Setup ...
3
votes
1answer
345 views

Import error when utilizing QGIS's Python Init function

Based on the answer to Referencing Qt UIs external to plugin with python. I'm trying to utilize the "Layer Properties / Fields / Python Init function" to execute a file (test_file.py) that is located ...
3
votes
2answers
67 views

Geopandas Polygon to matplotlib patches Polygon conversion

Unfortunately geopandas plotting is extremely slow and takes a lot of resources, hence I would like to use instead matplotlib for plotting. When I use pure Fiona to open and read the shapefile I ...
1
vote
1answer
29 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 ...
9
votes
2answers
877 views

Histogram Matching using Python to improve mosaicking process of multiple overlapping rasters?

I am trying to do histogram matching using Python to improve the mosaicking process of multiple overlapping rasters. I am basing my code on that found at: http://www.idlcoyote.com/ip_tips/histomatch....
0
votes
1answer
45 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). ...
2
votes
1answer
33 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 ...
3
votes
0answers
71 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 ...
3
votes
1answer
31 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 ...
9
votes
4answers
8k views

Using ogr2ogr to convert GML to shapefile in Python?

I am trying to convert a GML to an ESRI shapefile using ogr2ogr utility in a python script. I have successfully installed the GDAL/OGR package via osgeo but I am now struggling to find/understand ...
1
vote
1answer
67 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
1answer
123 views

mosaic rasters with gdal_merge.py

I want to mosaic 2 rasters "rasa" and "rasb" using gdal_merge.py . While running the code, it produces an error " No input files selected". Can somebody help me to find the error in the code? ...
-1
votes
0answers
39 views

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

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, ...
3
votes
1answer
30 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 ...
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 ...
0
votes
1answer
45 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.
4
votes
2answers
84 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....
2
votes
0answers
48 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 ...
1
vote
1answer
65 views

Why does joining all layers in a group not work?

I am attempting to re-join all layers within a group to another layer ("Main.shp") outside of this group. The idea is for users to change values in one of the group's layers. As these layers are ...
20
votes
3answers
4k views

Is it possible to look at the contents of Shapefile using Python without an ArcMap license?

I wondered if it is possible to look at the contents of a shapefile using Python without having and ArcMap license. The situation is that you can create shapefiles from many different applications, ...
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
16 views

Georefrencing a geotiff image using gdal and python [closed]

I want to write codes for georefrencing a tiff image using gdal and python by either using GCPs or another georeferenced image.
1
vote
1answer
226 views

midpoint of segments in QGIS determination

Gene thanks for your note on the problem yesterday ... This is a follow up to a question I posed before (How to find the middle point of a line in QGIS - Where to place input file name). Errors coming ...
2
votes
0answers
42 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
59 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 ...
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 ...
0
votes
0answers
45 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 ...
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 ...
1
vote
1answer
115 views

Regrouping points together qgis based on a sum

I work with QGIS and Python. I have a vector layer containing points. Each point has an attribute called 'number of houses' I want to dissolve this vector layer in many areas, each area must contain ...
6
votes
2answers
211 views

Distribute QGis plugin which depends on certain Python packages

I developed a plugin for Qgis which depends on some Python packages. On Linux and Mac, this is not really a problem because I can easily install them with the system pip command. Windows is another ...
1
vote
2answers
46 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
1answer
38 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 ...
2
votes
2answers
360 views

Refreshing display for newly added labels with ArcObjects from Python?

I've added a shapefile to an MXD and Edited the symbolization of it with ArcObjects. Now I'm trying to edit the labeling with ArcObjects. I've successfully been able to edit the default class in the ...
0
votes
0answers
63 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. ...
3
votes
2answers
87 views

Installing third party python libraries in ArcGIS location

I'm running ArcMap 10.2.2 for desktop and have Python 2.7 installed as part of the software package. I'm trying to get the pyexcel and xlutils libraries installed. I ran a script to find the path of ...
3
votes
2answers
216 views

Automatic selection of pixels, from a raster series, greater than minimum image of the series

Given a series of rasters, and the raster image of the minimum values of the series, I am looking for a python script capable of selecting, for each raster, the pixels whose values are greater than ...
1
vote
1answer
183 views

Adding Origin to Geotiff using Python GDAL?

Alright, so I'm getting closer to figuring this out but I'm stuck at one (that I know of) thing... how do I use GDAL to apply a known origin of a GeoTiff to another that has been processed in ...
1
vote
1answer
178 views

Opening HDF5 satellite images in GDAL with Python? [closed]

I want to read and open HDF5 satellite images by python for batch processing. How can I read and open both image bands and meta data? For batch processing I need to geo-reference and read IR bands. ...
4
votes
1answer
1k views

How to use QGIS field calculator in python?

I would like to use QGIS Field Calculator in Python to update the existing column based on certain conditions? How can I do 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
208 views

How to connect mouseclick to map canvas in QGIS?

How to connect mouse click to map canvas in QGIS using python script? I have two lines of code to connect mouse click to map canvas: button.clicked.connect(self.onClicked) self.areapushbutton.clicked....
1
vote
1answer
60 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 ...
1
vote
0answers
12 views

Duplicate an existing geoserver style using gsconfig

I am playing around with gsconfig and trying to assign a new style on a layer I have created. What I want to do is to actually create a new style, which is the same with an existing one. I searched ...
2
votes
1answer
168 views

Is it possible to call FME transformers (or workbenches) from my python script?

I have a script mostly using arcpy, and in the middle of this script I convert a load of polylines to polygons: arcpy.ET_GPPolylineToPolygon("Contours_L_1m.shp", "Contours_G_1m.shp", "FALSE") This ...
2
votes
1answer
36 views

How to use create a plugin that contains a set of processing scripts using Qgis Script feature?

I have some script that I would like to share easily. I have read here that its possible to create a plugin using a set of scripts using "Scripts/Tools group in the Processing toolbox, double-click ...
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 ...
3
votes
4answers
8k views

Trying to write a python script to crawl a directory and list all datasources

I'm editing a scrip from ESRI to try and create a list of all datasources within MXD's. I've got the script to crawl the file tree and find all the info, but I would like it to output the data for ...
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 ...