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

learn more… | top users | synonyms

0
votes
1answer
42 views

Python: Running a function on all points in a list [closed]

I'm trying to get a list of cartesian points along contour lines and convert them to polar coordinates. I'm trying to run a function to convert them to polar, one for the length and one for the angle. ...
2
votes
1answer
33 views

Raster brightness, contrast, saturation in PyQGIS

I'm trying to find a way to change these properties (especially contrast and brightnes) and I've found a QgsBrightnessContrastFilter class, but I can't fugure out how to apply it to my raster layer. ...
1
vote
0answers
43 views

How do I calculate the percentage of progress using raster data using Python?

How do I calculate the progress amount of two or more raster data being processed? I have seen examples of vector data but it becomes difficult to calculate the progress when no vector data are ...
0
votes
0answers
47 views

cartopy: plotting shapefiles

I am new to gis and am trying to plot a shapefile containing land polygons. (From OSM.) Unfortunately my output image is always empty (i.e. white). Can somebody tell me what I am doing wrong? import ...
0
votes
1answer
34 views

Shebang line for ArcGIS Desktop [closed]

I'm writing a script to be run on ArcGIS for Desktop, which only runs on Windows machines. Is there any use for a shebang line at its beginning, and if there is then what should it be (e.g. ...
0
votes
0answers
54 views

Getting closest point on road to point in OpenStreetMap using Python?

I need to find the closest point on a road to a external point in OSM, but I need to do it without downloading the OSM data nor using PostgreSQL, i.e., I can't use the solution pointed in How do I get ...
2
votes
1answer
70 views

How can I get a map image from an ArcGIS mapserver centered on a single feature?

I have a Python program that is not using arcpy. I need to get an image from a mapservice centered on a single feature using the REST api. I can call the export method to get a map image: ...
3
votes
1answer
58 views

Error when using r.series in a python script

I’m writing a tool script in python and at a certain point I want to use the GRASS tool r.series. I want the algorithem to read all raster files from a folder and calculate the maximum with r.series. ...
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
112 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
115 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
40 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
68 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
33 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
121 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
94 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
33 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
110 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
82 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
50 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
36 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
33 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
169 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
79 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
57 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
256 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
66 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
116 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
145 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
25 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 ...