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

learn more… | top users | synonyms

3
votes
1answer
55 views

How to get the feature id of features added to dataProviders?

My question is somehow related to the problem of finding the id of the last added feature: I am looking for a way to supply the feature id and another attribute of each added feature through a signal. ...
2
votes
1answer
24 views

Count Lat Lon Data Points Lying Between 2 Azimuths

I need to count the number of points (LAT, LON) from a cvs file that exist inside an arc defined by 2 azimuths. Ultimately it will need to be iterative where the arc defined by the 2 azimuths rotates ...
3
votes
1answer
69 views

Writing a custom function in QGIS to rank features

I have written the following custom function in python for QGIS, cobbled together from various sources. The aim is to use it in the expression editor to return the rank of each feature based on the ...
1
vote
1answer
63 views

How to create a new database in spatialite and insert the data using python in Qgis

I want to create a new database in spatialite and want to connect to the database and execute the sql queries. conn = db.connect('myDB.sqlite') # creating a Cursor cur = conn.cursor() sql = 'select * ...
2
votes
0answers
25 views

QGIS Override MapTool Python

My goal is to reuse the default edits tool of QGIS in a custom App. But I would like to modify some behavior with those tools. For instance, the MapTool beside the Edit Node Action. ...
2
votes
2answers
82 views

How to convert the CSV to point shape file using python

import csv,sys import osgeo.ogr, osgeo.osr #we will need some packages from osgeo import ogr from osgeo import * import osgeo.osr as osr def test(): boolValue = True canvas = ...
2
votes
1answer
33 views

How can I retrieve private tag GDAL_NODATA from a TIFF using libtiff?

In an earlier post I reported about my attempts to read TIFF with data stored in tiles using python and libtiff. First I tried to use libtiff's function TIFFReadEncodedTile but finally I tried ...
4
votes
2answers
61 views

How to select all features with maximum classification value using a processing algorithm?

I am building a Processing Model working with large vector Datasets with classification values. My vector file contains a lot of features (40.000) with one column containing classification values ...
3
votes
2answers
43 views

Cannot load vectorlayer PyQgis

I am having a hard time loading a vectorlayer from the console. Not from the Pythonconsole within QGIS, but from the console on my computer. I later want to write a standalone script! That is what I ...
0
votes
1answer
50 views

Pygrass ERROR: Mapset is not set

I am using Pygrass in a a Python Grass GIS stand alone application. I am using GRASS GIS 7.0.3 on a Windows machine and Python 2.7.4. I am initializing a new Grass environment. I can work in this ...
0
votes
0answers
42 views

Time series linear interpolation method for cloud not processing properly in my MODIS dataset

I am trying to perform an interpolation to my 3D array (sub-block of MODIS time series dataset with a shape of (46,960,960)) using numpy linear interpolation method to replace cloud pixels with ...
1
vote
1answer
43 views

How to create dynamic text in ArcPy that recursively reflects the exported layer name from a list of layers

I have a script shown below with the help from @Midavalo that exports irrig_0, citylyr, boundlyr as a GIF. Once this is done the script then exports irrig_1, citylyr, boundlyr as another GIF and so ...
0
votes
0answers
31 views

Redrawing multisegmented lines as arcs using measurements stored in attributes

I'm beginning the process of moving our local government cadastre data in to a topologically clean parcel fabric layer using ArcGIS. I'm at the stage where I'm looking to clean the data and get it ...
1
vote
2answers
41 views

How do I select shapefiles to be converted to GeoJSON in folder with multiple shapefiles?

How do I only select .shp's to read and then convert to .geojson. The homefolder has 3 different shapefiles and this code currently converts every single file in the folder to a .json. Just trying to ...
1
vote
0answers
24 views

Using model precessing save from qgis into qgis python plugin

I would like to know if there is anyway to load from a QGIS python script a .model file and run it through the processing.runalg method as it seems that we lost the capability to save our model as a ...
2
votes
1answer
114 views

Adding QGIS-specific Python interpreter to Eclipse?

I was following the steps from QGIS Python Programming CookBook to add qgis interpreter to eclipse, however I went into the following error in step 8: "See error log for details. No output was in the ...
2
votes
3answers
74 views

Can not Run function when item selected in comboBox. Pyqgis. QGIS

I'm writing a plugin, I want to change the content of a comboBox (fields) depending of the content of another comboBox (layers). My plugin is a dockwidget. I can populate the fields comboBox just ...
2
votes
1answer
60 views

pyQGIS segfault

I am trying to get started with pyQGIS but failing pretty hard. Trying to follow http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/intro.html A lot of it seems incomplete for Windows ...
6
votes
4answers
127 views

PostGIS query for selecting features not connected to rest of road network?

I have a dataset of roads in a city stored in a PostGIS enabled database. I would like to identify and remove any feature which is not connected to the rest of the road network. This behavior is ...
3
votes
0answers
115 views

QGIS 2.14 Processing plugin crashes - TypeError: must be string, not None

I've recently installed 2.14, and it worked fine for the first couple of days (Appart from Grass tools), including several program and computer reboots. Today I had this error show up Couldn't load ...
6
votes
0answers
91 views

Can a memory layer be used as an input and/or output with runalg?

Can a memory layer be used as an input and/or output with runalg? With runandload I get this to work: processing.runandload("qgis:mergevectorlayers","memory:bufferOne", "memory:bufferTwo", ...
0
votes
0answers
21 views

Fetching the table data from SQlite db in QGIS throws an error

I have exam.sqlite db and it contains 4 tables as t1,t2,t3,t4. from pyspatialite import dbapi2 as db sqlite_file = r'D:\Folder\exam.sqlite' conn = db.connect(sqlite_file) ...
3
votes
2answers
52 views

QGIS pyqgis: Trouble loading non-spatial data via .csv using python for standalone script

I cannot for the life of me figure this out. I am trying to load a .shp file, and a non-spatial data table .csv file. Then join the table to the shape file. Both files have a primary key. Here is ...
3
votes
1answer
38 views

While populating table of memory layer one record is missing

I have script that calculates length of lines and adds values to attribute table. It works for vector layer, but for memory layer it skip always one value, as you can see on the pic. I calculated ...
2
votes
1answer
18 views

Trying to get PRECISE vector coordinates using geom.asPolgon

I've got a bit of a problem. A script I've written is trying to get the coordinates of every vector in a layer, which is MAINLY working: output_file = open('c:/myfile.txt', 'w') layer = ...
1
vote
1answer
45 views

Point otbApplication for python to the relevant OTB DLL's

I installed the latest OTB and Monteverdi on a Win 7 machine. Via osgeo4w I downloaded otbApplication for python, without any dependencies. Python, gdal, numpy scipy and so forth was custom build ...
0
votes
1answer
19 views

How to remove XML tags within a field of attribute table?

I have this dataset I got it from Wikimapia ,containing bunch of fields . One of fields named "PopupInfo" contains xml tags : and looks like this when in editing mode : I want to remove these ...
0
votes
0answers
50 views

tooltip does not show date in the correct format in Bokeh (flask)

he tool tip does not show the date in the correct format in the line chart.( the image below). However the data was displayed in the correct format in the table below. def ...
2
votes
1answer
66 views

QGIS corrupted processing tool

I've been dealing with various problems after re-installing QGIS and other GIS-related software (see QGIS corrupted plugins upon reinstallation). The solution worked for a bout a day and now I lost ...
1
vote
0answers
28 views

How can I connect qt ui with qgis, which browse the data file? [closed]

I have created a form in qt designer which is basically a dialog box with line edit and a browse button to browse .csv files. I am trying to connect this with QGIS so that as soon as a layer is ...
1
vote
0answers
28 views

Received a python error when I clicked on new catalog in QGIS Geoserver

What shall I do if I Python error message is there when I clicked on new catalog in QGIS Geoserver. I have the same message: Python error: An error has occurred while executing Python code: See ...
1
vote
0answers
36 views

How analyze reliability of position of new point based on point data

I am working on filter for biogeographical data. It is based on citizen science principle. People put new point data to database and I want add information about "reliability" or probability (maybe ...
2
votes
1answer
19 views

Return several layers from listwidget

I am new to python and I am writing my first plugin that add selected layers from a listwidget to QGIS. So good so far, but it does not allow me to select several layers at once. Am I missing ...
2
votes
1answer
40 views

How to set CRS for a DXF file and prevent any warning on QGIS using pyQGIS?

I am trying to import dxf file with no warnings or popup from Spatial Reference Selector. However, even after modifying QGIS Spatial Reference Selector setting, I still get a qgisMessagebar warning. ...
1
vote
0answers
18 views

Local Maxima (or Pour Point) Pixel Value extract in Raster

I am doing watershed & pourpoint using python GDAL. I have calculated Fill, Flow-Direction & Flow-Accumulation using Python & GDAL. The next is to get Pour Point in certain window ...
2
votes
0answers
29 views

How to run QGIS plugin from python script

I would like to access external QGIS plugins through a python script. I have been able to access the built in QGIS processing and vector toolbox, but have been unsuccessful with external plugins such ...
0
votes
1answer
52 views

How to access members of GeometryCollection - Python

I am using 'intersection' function from Shapely to find junctions of a road network. As i found, intersection returns GeometryCollection. In my case it could be Point, LineString or perhaps ...
0
votes
1answer
51 views

How to remove first character from featureclass in Python?

I have a bunch of feature classes in a geodatabase that start with an underscore and want to remove it, but ONLY the first instance. See below: e.g. _COGCC_W_S --> want it to be COGCC_W_S I have a ...
1
vote
0answers
104 views

Convert PLSS (Section, Township, Range, Meridian) to Latitude and Longitude using R package or Python

I have data in the form of Section, Township, Range and meridian. I have 300,000 data points from all over the USA. Is there any way i can write R or python scripts to batch convert all the points to ...
0
votes
0answers
16 views

mosaic/reprojection/conversion order of operations

I'm writing a python/gdal program that ingests HDF4 files and: 1) Converts subdatasets from HDF4 to GTiff using gdal_translate 2) Mosaic's the new Gtiffs using gdal_merge 3) Defines the ...
0
votes
1answer
39 views

Applying Attribute Filter and Spatial Filter simultaneously (GDAL - Python)

quick question on something that has to be simple, but I'm getting stuck on. I want to use an Attribute Filter and a Spatial Filter simultaneously. I have two vector files (an overlaying grid and a ...
0
votes
1answer
34 views

Looping through multiple rasters, and adding them together

I have 5 folders, each with 80 .tif files. These 80 files represent one landsat image taken on a different date. Each folder represents a vegetative indice (NDVI, NDII etc.) Each file in each folder ...
0
votes
0answers
58 views

GeoDjango: Insert geography coordinates and filter the nearest points, step by step

I would like to: Save pairs of srid 4326 (latitude, longitude) points in a PostGIS Geodjango 1.8 Database. (Maximum distance between the edge points: 2.000km) Given a srid 4326 (latitude, longitude) ...
1
vote
1answer
104 views

How to geocode location using twittersearch for leaflet map of tweets

I'm using twittersearch to iterate over user input topics and location of interest that will then be visualized in a leaflet map. So using 'place' I can get a map, no problem. I'm trying to increase ...
1
vote
0answers
36 views

Python MapServer MapScript & Mongo - Use GeoJSON String Vs File

I have been using Python MapScript bindings for MapServer - and they work great. A new datasource for the application I am working on is MongoDB. I have seen mentions of a MongoDB Driver for ...
0
votes
0answers
14 views

Installing fiona on windows 7 [duplicate]

I'm trying to install/use fiona with python 2.7 under windows 7. On import I get the error shown in the following screenshot. Has anyone seen this before? Apologies if this is the wrong forum for ...
2
votes
1answer
62 views

Bulk loading into pyrtree index

I'm using pyrtree to create an index for a point in polygon operation. I am currently trying to insert 1.8 million rows into the index and it takes more than an hour to do so. I am unable to use rtree ...
3
votes
1answer
58 views

Subsetting a shapefile and saving it using PyQgis

I am very new to PyQgis. I have a shapefile containing a lot of information for each place, it looks like this id stat_1 stat_2 ... stat_n i1 0 0 2 i2 1 1 ...
0
votes
1answer
66 views

Enabling or disabling WMS capabilities with python

I am trying to enable Feature Access for all of my services on an ArcGISServer with python. Below is my code. The variablejson is the Feature Access dictionary. How do I make the post targeting ...
2
votes
1answer
50 views

How to multiply a user-defined input parameter with a field value within the graphical modeler?

I have the same Question as asked in this post (How to connect input parameter to the field calculator algorithm within the graphical modeler?) and the answer from Joseph already helped a lot: ...