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

learn more… | top users | synonyms

0
votes
1answer
28 views

Install pygeoprocessing on ubuntu 14.04 and python3

I'm trying to install the pygeoprocessing package for Python 3.4 on an Ubuntu 14.04 VM. I have all the necessary versions of the required dependencies (GDAL, numpy, scipy, shapely, Cython). ...
2
votes
2answers
111 views

Using zoo-project WPS service in QGIS WPS-Client

I've created a python wps service in the zoo-project framework, which is used to calculate a Line of Sight based in on a start point, an end point and a start point height. The service works fine if i ...
0
votes
1answer
35 views

Hide/Show leaflet markers based on specific values

I have a Python list of dictionaries with a number of IPs and "Scores" for each IP. I'm adding them to my front end map / leaflet using jinja2 like so: var map = L.map('map') ...
2
votes
1answer
112 views

How to find the intersection areas of overlapping buffer zones in single shapefile?

Find the intersections of the buffer zones I found an example where they tried finding the intersection of two different shapefiles -Intersect Shapefiles using Shapely. I've tried to adapt my code to ...
1
vote
1answer
38 views

How to install 3rd party python libraries for QGIS without OSGeo4W on Windows?

I want to install pip package in QGIS. I have tried the standard windows installation from Windows command line as explanined in pip site, but still can not import pip from QGIS Python console. I have ...
3
votes
1answer
82 views

Show QGIS feature count via console on existing layers

I want to make a script that toggles feature count on for all vector layers. I followed the following article: Show feature count of layer via Python console / PyQGIS. Instead of adding new layers ...
0
votes
2answers
67 views

AttributeError: 'NoneType' object has no attribute 'length'

I try to open the attribute table of a layer witch has a PythonInit fonction with a Ui form and returns "AttributeError: 'NoneType' object has no attribute 'length'". Made so far: from PyQt4.QtCore ...
7
votes
3answers
1k views

Is there a way to “invert” Polygons?

I have a Shapefile with Polygon features representing the world's land areas (continents, islands). Is it possible to invert these, and get a geometry that represents the world's oceans and seas? So ...
1
vote
0answers
23 views

pyqgis change or update attribute data with real-time data or Timer update,Memory has been growing

I update my shapefile attribute data by QTimer ,and labling it, keep the lable visiable,change attribute by 1 minute, but the Memory has been growing 1 layers ...
2
votes
2answers
38 views

Dynamically adding in-memory QgsVectorLayer triggers a popup in the UI - how to eliminate

I use this function to create layers that display results to my queries. However a dialog always pops up asking me to confirm the crs. Is it possible to suppress this ? def addResultLayer(name, ...
2
votes
1answer
82 views

Delete all fields with the string “RAWI” using QGIS Python

I would like to delete all fields with the string "RAWI". For instance the field "RAWI_WA" and the field "RAWI_BO" should be deleted but not the field "NSG_RAW"
2
votes
1answer
21 views

Store geometry Qgis feature creation

I make a form that has a textEdit wich stores the length of a line. How it is possible to store the length of the new created line and put it in the textEdit, when form appears?
0
votes
1answer
31 views

How to extract a shapefile with a SQL expression from a database of shapefiles using PyQGIS or OGR [duplicate]

I have a shapefile Water_Districts.shp that consists of several water district polygons. I am trying to use the script below to 'extract' a specific polygon with the name Cache La Poudre River listed ...
1
vote
1answer
119 views

ImportError installing GDAL on Ubuntu 14.04 with Anaconda Python 3.5

I installed the GDAL library on Ubuntu 14.04 through the Anaconda (Python 3.5) distribution. After installation, which seems to work fine, I try importing it and I get this error: >>>from ...
4
votes
2answers
93 views

Model Builder/Python: batch raster calculation

I wish to carry out a raster calculation on a batch of rasters. I want to add rasters by month, as identified by their file name. i.e. all rasters within the month of January should add together and ...
0
votes
0answers
32 views

Is there an automated way of downloading the natural color .TIF images for Landsat 8?

I know that .jpg natural color images can be downloaded from AWS. But, .jpg doesn't contain the world metadata along with it.
5
votes
2answers
108 views

QGIS python processing.runalg Clip returns None

I'm writing a script in pyQGIS, which would emulate measurement of a line by "walking" along it with a compass with constant length. I have a problem with the Clip algorythm from processing module, ...
2
votes
1answer
71 views

How to use QGIS advancedpythonfieldcalculator from the console?

I'm trying to use the field calculator in a script like so: processing.runalg('qgis:advancedpythonfieldcalculator', output_layer, 'Latitude',1,12,5,'','$y',output_layer2) Not sure exactly how to ...
1
vote
1answer
14 views

Error using gdalwarp in EPSG:4326

I tried to change the projection of AMSR-2 in Python using: 'gdalwarp -geoloc -t_srs EPSG:4326 C:\GW1AM2_201301311114_050A_L1SGBTBR_1110110.vrt C:\test100.tif' It said there are something wrong ...
2
votes
1answer
56 views

Creating custom forms in Arcmap 10.3

I am hoping to make a custom form within ArcMap 10.3 where the end user can select a recently digitized shape file (or feature), and enter values of specific attributes through a custom form. This ...
1
vote
2answers
81 views

problem combining geometries from all features in a layer as one geometry

I am trying to combine all features of a Polygon layer in QGIS in a python plugin, and am running into this error when I try to run the combine method: "AttributeError: 'NoneType' object has no ...
1
vote
1answer
48 views

PyInstaller myscript.py - issues: empty dist folder

This question is subsequent to another question: here. The question was solved but I ran into another issue and tried to ask it there but it is worth being its own question I think. Python version in ...
1
vote
1answer
34 views

gdalwarp causing shift in pixels

Can somebody help me with gdalwarp issue? I am having an input raster and would like to clip it with polygons. After running the below code, while overlaying output raster on input raster, i see there ...
1
vote
1answer
32 views

How to get the pixels from a geotiff file in gdal python for a given polygon?

I use python and GDAL under apache to make a webservice. I have a GeoTIFF file and i want only a subset of the data, everything inside one polygon defined by a buffer of a line (coord is the input ...
0
votes
1answer
29 views

SQLAlchemy Error on insert

I am trying to add a point with GeoAlchemy 2. However I am getting getting error on insert action saying ---sqlalchemy.exc.InternalError: (psycopg2.InternalError) parse error - invalid geometry ...
5
votes
1answer
161 views

Python script for calculating NDVI in QGIS

I am looking for developing python codes mainly for working with raster data, in particular satellite imagery from Landsat. I am familiar with GIS and RS and I usually work with QGIS, but I am new in ...
0
votes
0answers
77 views

Error de Python

yo descargué el Qgis 2.8.7 y cuando lo quiero ejecutar me aparecen varios errores. 1) Aparece un cartel que dice Error de Python No se pudo cargar el complemento LecoS debido a un error al llamar a ...
1
vote
1answer
56 views

Quantile in QGIS python Plugin

QGIS is very powerful when it comes to styling Vector Data. When it comes to Raster data, ArcGIS still has some advantages including Styling based on Quantiles. See my earlier post: For this I want ...
1
vote
1answer
249 views

Error Opening OpenLayers plugin in QGIS [closed]

I have installed version 2.12 of QGIS and I have installed the OpenLayers plugin. However, when I try to add a basemap through Web > OpenLayers plugin I get the following error message "An error has ...
2
votes
0answers
21 views

Open QGIS project files in exclusive mode / alert if project file already in use

I have QGIS-Project-Files saved to a network drive and was wondering if it is possible to warn users that a project file is already opened by an other user to prevent concurrent editing of the same ...
0
votes
1answer
59 views

Writing attributes and associated feature class name from file geodatabase to CSV?

I need to write a csv file that lists every record from an ID field across all feature classes in a gdb. The code I have written below does that fine, but I also need to write in the second column of ...
3
votes
2answers
183 views

Remove duplicates from a field

I need to remove duplicates from a field named "Intersecti" Here is my code. I used list..set. It's not removing any duplicates. import arcpy duplicates = "G:\\xStreetNew\\Duplicates.shp" ...
2
votes
2answers
56 views

Creating a list using an attribute query with arcpy.da.SearchCursor

I have a shapefile of a river network containing the following fields: toJunction, fromJunction, Int_DAM (which indicates free-flowing status) and Strahler. I'm trying to create a list of the rows ...
4
votes
1answer
65 views

How to split a circle in equal parts in QGIS?

I'm looking to split a circle polygon generated by a buffer around a point in equal parts. The goal is to be able to calculate statistics about the raster that will be under the circle for each part ...
4
votes
3answers
363 views

Why [0] is needed in row[0] when using ArcPy (Data Access) cursors?

when running the following 2 sample codes, "[0]" is needed to be added after "row" in order to make code run well. I was confused. can anyone help explain? I know that it might be too easy for most of ...
2
votes
1answer
40 views

Why is the first element of my WFS layer None instead of a feature?

I have made a WFS connection and got a layer from it. I want to use the first feature from that layer. driver = ogr.GetDriverByName("WFS") wfs_url = "WFS:http://example.com/wfs" wfs = ...
3
votes
2answers
115 views

How to update raster pixel values based on another raster with conditions in QGIS?

I have 2 land cover rasters. I want to update parts of the first raster with values from the second using QGIS. The workflow should be like this: 1. Select values equal to 30 and 34 in the first ...
1
vote
2answers
54 views

How to ireate over text of legends on QGIS and change that with fields from a Shape

I'm using 2.8.3 version of QGIS, I need change the text of legend, this is because I want to concatenate two or more fields from a Shapefile to compose this text. Can I iterate over text of legends ...
4
votes
1answer
139 views

How can I include HTML in a Folium Marker popup?

I'd like to include an anchor tag in a Folium Marker popup so that I can click through to another page. Here's my code def poptext(row): return "<a href=\"" + row['Feed'] + "\">" ...
3
votes
1answer
98 views

Creating executables from Python using OSGeo4W shell

I've been trying to create an executable from my Python script and using the OSGeo4W.bat shell. I tried py2exe but it returns an access denied error. Previously I've written executables using py2exe ...
0
votes
0answers
24 views

Ansible/TeamCity/arcpy import issues

we are trying to implement remote instantiation of a python application that uses arcpy. The scripts work perfectly fine when running on the virtual machine when logged in as a user. However when ...
1
vote
2answers
50 views

Using Python to execute merge of rasters Linux

I need help with a python script to iterate merge (gdal_merge.py) of rasters: For each folder located in /home/geodata/sentinel2/ look in subfolder IMG_DATA and merge the three rasters with ...
0
votes
0answers
75 views

Using external IDE eclipse to develop python plugin for QGIS?

I am new to QGIS and coding for QGIS, but I have experience with C++ and Qt. I am reading the book "Python Programming CookBook" to learn how to develop a plugin to QGIS, however I am facing some ...
1
vote
0answers
103 views

QGIS 2.14 Couldn't load PyQGIS. No module named Qsci

When I open QGIS Version 2.14 Essen, I get the following error message: Couldn't load PyQGIS. Python support will be disabled. Traceback (most recent call last): File "", line 1, in File ...
-1
votes
2answers
56 views

TIFFs with Worldfiles to GeoTIFFs

I'm looking for a way to convert several TIFFs with Worldfiles to GeoTIFFs. Is there an option using ArcGIS or Python (Arcpy)? What is the best option you could recommend?
1
vote
0answers
21 views

CityEngine: Extruding Buildings

I have written some code extrude buildings, taken from another forum which had previously worked for others. However, it is not working for me. I have attatched two screen grabs, if anyone could ...
3
votes
1answer
72 views

Understanding intersection of GDAL and QGIS?

Background I'm starting a project that will be done entirely through Python, except perhaps at the end for visualisation. So far I've been doing it with ArcGIS and arcpy, but we'd like to move it to ...
1
vote
0answers
30 views

Looping through CSV files to write Lists [closed]

I am very new to Python and am attempting to use it for some relative humidity data. I am looking at 60 months of data. The files include a Lat and Long file (CSV in a Matrix) and Relative Humidity ...
0
votes
0answers
24 views

offline geocoding with Python and MapPoint

I need to geocode 500K European Addresses offline. I have MapPoint Europe 2013 and Python on my laptop. Googling around I found this code that connects MapPoint and Python. import string import ...
2
votes
1answer
35 views

Optimise Search within the QGIS API

I would like to ask you about the following code, it works, but I don't think is very helpful to have elif, elif,elif... always. Then, I have to optimise it. The problem is that I can't access to ...