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

learn more… | top users | synonyms

2
votes
1answer
67 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
44 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
75 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
42 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
26 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
30 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
22 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 ...
4
votes
1answer
129 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
64 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
42 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
196 views

Error Opening OpenLayers plugin in QGIS [on hold]

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
18 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
46 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
181 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
50 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
61 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
359 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
34 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
108 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
53 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 ...
2
votes
1answer
96 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
86 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
22 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 ...
0
votes
1answer
36 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
57 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
90 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
51 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
20 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
67 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
26 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
22 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 ...
2
votes
2answers
86 views

AttributeError: 'NoneType' object has no attribute 'split' from arcmap only

I'm running a simple python script from arcmap that sends an html post and processes the response. This script runs just fine from pythonwin but for some reason I receive the following error when ...
2
votes
1answer
90 views

Remove features inside a feature in shapefile using python (UNION, CONTAINS methods)

I have created a shape file from raster. The shapefile was generated using contours detection. I am in the process of automating feature detection using python and open source libraries such as ...
0
votes
0answers
7 views

Problems with Mapnik raster colorizer discrete not properly assigning values to their stop value

I'm using Mapnik (Python) to convert a raster (float valued) to MBTiles. In general the discrete colorizer is working fine, except for zero values, where it fails to recognize their correct stop ...
3
votes
1answer
75 views

Works in Console but not in Script Editor

On QGIS, I am using a simple script to zoom the selected features. I write them in the Text Editor, but it didn't work until I used the console... and it does work. What kind of problem is this? Is ...
1
vote
0answers
33 views

PyQGIS: vector layer does not get displayed after rendering

My project goal is to write a standalone app for Unbuntu and QGIS 2.14. It should get a layer of simple points and their name from a Postgres database and show them in a layer. In addition there ...
2
votes
0answers
35 views

How to use GDAL RasterizeLayer (python binding) -where flag

I am trying to use GDAL RasterizeLayer python binding, but I can not find a way to use the -where flag. The 'pure' GDAL command I am trying to run is: gdal_rasterize -b 1 -burn 0.00001 -where ...
0
votes
0answers
37 views

How to use SpatiaLite functions in a Python script?

I'm trying to find the intersection coordinates between a line (knowing its start and end points) and a polygon (SQlite file). I've managed to make it work in QGIS by creating a shapefile for the ...
2
votes
1answer
37 views

Use ArcGIS for Server geocoding service results in QGIS (or another generic approach)

An ArcGIS for Server geocoding service can be used via http get (singleline geocoding for 'Jugendamt' [youth office]) ...
1
vote
1answer
69 views

Load multiple files from folder for further processing

I'm working on a processing model and I'm looking for a possibility to load multiple shape-files from an Input-folder for further processing (first clip them all to a certain extend, then assign them ...
1
vote
1answer
33 views

Fail to compile QGIS source on Windows

CMake fails to configure. I get following error: Could NOT find PythonInterp: Found unsuitable version "1.4", but required is at least "2.7" (found c:/cygwin/bin/python2.7.exe) which seems ...
1
vote
1answer
26 views

Operations lists arcpy

I have a list with 4 raster files and another list with 4 vector files. I want to relate each of the raster file 1 file list 1 vector list. I try to do and I related file 1 raster to vector file ...
1
vote
3answers
54 views

Querying dataset with .shp file?

I'm new to GIS tech. Please excuse me since I'm not yet familiar into using GIS. I will be using a very large dataset (yfcc100m dataset, a dataset containing metadata of Flickr's photos/video) which ...
3
votes
1answer
102 views

Using processing algorithm in QGIS plugin

I'm building a plugin in QGIS, one of its part is processing algorithm: intersection. I want to save the result as memory layer, and then work on it. Following code was working fine, nothing changed ...
4
votes
1answer
100 views

Implementing NNJoin in Python

I am curious to know on how to implement NNJoin into the python code. I have created a point shapefile using shapely. I have another shapefile which is a centerline and is used as a reference line. ...
2
votes
1answer
51 views

Suppressing rasterio verbosity

I have the following script using rasterio: if not os.path.isfile(out_dir + os.sep + name_adm1 + '.tif'): with rasterio.drivers(): with rasterio.open(constants.ras_cmask) as src: ...
1
vote
1answer
46 views

Select by attribute using fiona

with fiona.open(constants.file_combined, 'r') as source: filtered = filter(lambda f: f['properties']['NAME'] == name_dm1, source) # **source.meta is a shortcut to get the crs, ...
2
votes
2answers
58 views

QGIS explode lines from python script fails at alg.processAlgorithm

I've been trying to run QGIS procedures from python scripts via terminal on Ubuntu (ultimately I want to automate a process via cron). The first task I have tried to script is the "explode lines" ...