Home >

pyqgis

Advertisement
  • HTML Annotation using pyqgisNovember 20

    I really like the html annotation tool in QGIS. My plan is to show a photo (web based image// jpg) on each point of my point shapefile. Unfortunately labels don't work as they do not parse HTML and the tooltips won't last for long (only on hoover, ri

  • Deleting polygons with certain height and width in Python script with QGIS?September 15

    I have a polygon layer with bounding boxes (boundingLayer). This layer has attribute columns "HEIGHT" and "WIDTH". I want to delete all bounding boxes which have HEIGHT and WIDTH less than 200m. How should I proceed? boundingLayer = Qg

  • QGIS: Deleting polygons with certain height and width in a python scriptJuly 19

    I have a polygon layer with bounding boxes (boundingLayer). This layer has attribute columns "HEIGHT" and "WIDTH". I want to delete all bounding boxes which have HEIGHT and WIDTH less than 200m. How should I proceed? boundingLayer = Qg

  • Testing Oracle query produces valid results in QGIS Python ConsoleMay 8

    I have a query that searches an Oracle database using a where clause to get the geometry of an object and then zooms to the extent of that object. The value for the where clause is retrieved from a dialog that opens after a button press of a custom t

  • How to insert attribute in a selected feature from active layer (Pyqgis)May 8

    I want to update some fields from a selected feature in an edit session with some values provided by a form made in QtDesigner. The fields have indexes 0 and 2. Tried so far: from edit_Form import Ui_EditForm class editForm(QtGui.QDialog): def __init

  • QGIS standalone application for map rendering: bad extent

    QGIS standalone application for map rendering: bad extentFebruary 17

    I made a simple standalone QGIS app for rendering a set of layers and export it as a PDF file. When i use iface.mapCanvas().mapRenderer() (inside QGIS console) for rendering, my output is OK. If i want to create my own QgsMapRenderer (inside standalo

  • How do I get the feature id after featureAdded signal (Pyqgis)?February 17

    I'm trying to make an edit form in QGIS (Python code) ,and i want after feature drawing to get the id, and the feature to be selected. Do you have any ideas to do that? Tried so far: self.iface.activeLayer().featureAdded.connect(self.myfonction) def

  • Python code to import OSM dataFebruary 17

    I am trying to automize the workflow: import osm data and select by a special tag. I have to do this steps a lot of time with different parameters and updated data. A Solution could be a python script using PyQGIS or using the Graphical modeler. But

  • Problem Editing a Vector Layer QGISFebruary 12

    I have a vector layer which I need to load and edit (add several attribute columns). I am doing this without opening QGIS, so within a python script. I have the following piece of code for the layer loading: from osgeo import gdal from osgeo import o

  • Retrieve available PostGIS connections in PyQGISFebruary 11

    Can I retrieve the available connections to PostGIS databases in PyQGIS? I would like to provide a list of available db-connections, and subsequently a list of tables within the ui of my plugin. I checked the cookbook but cannot find a way to get fur

  • Id allocation of QgsFeature objectsFebruary 10

    I noticed a strange behavior when creating a new QgsFeature object and adding it to a layer, inside a QGIS plugin. Let me first briefly explain the structure of my plugin: I have a main function that iterates on the features of a layer and calls two

  • PyQgis - How to update a spatial index?February 10

    I am trying to speed up a QGIS plugin I wrote by adding a spatial index to a vector layer. The aim of my plugin is to simplify a line network by merging some of its features, based on some criteria. Short version: at each iteration, I delete two feat

  • QGIS: Create a layer, edit and save. Where are my features?February 9

    I created a layer (e.g. point) in QGIS with QgsVectorLayer from memory: mem_layer = QgsVectorLayer("point?crs=epsg:32630&field=id:string","TempFile","memory") QgsMapLayerRegistry.instance().addMapLayer(mem_layer) and save

  • How to create a shapefile having Voronoi diagrams from the shapefile of an existing region?February 9

    I have a shape file of a region and I want to generate random sub regions of that shape file using Voronoi class of scipy.spatial package of python. But I am a newbie to GIS. I found out about Voronoi from StackOverflow comments. I don't know how to

  • QgsSpatialIndex partial or complete overlapFebruary 8

    I'm working on adding some functonality to a QGIS plugin. It currently uses a QgsSpatialIndex to efficiently compute whether the features of a vector layer intersect (potentially millions) of QgsRectangles representing tile bounds. This is reasonably

  • Extracting zeros from numpy array and creating a new rasterFebruary 8

    The following code reads in several .tif files from an input folder, converts them to numpy arrays and adds them together. All input files are binary: inputFolder = "/home/usr/Desktop/BufferFolder/" outputFolder = "/home/usr/Desktop//Buffer

  • Importing Several Raster Layers, Doing Manipulations and Exporting The Newly Saved RastersFebruary 8

    I have the following code: src_ds = gdal.Open("/home/usr/Desktop/RasterFolder/Name.tif") if src_ds is None: print 'Unable to open %s' % src_filename sys.exit(1) myarray = np.array(src_ds.GetRasterBand(1).ReadAsArray()) rows = src_ds.RasterYSize

  • module object has no attribute classFactoryFebruary 5

    I asked this question several days ago on the QGIS developer list but didn't get any love. I'm hoping someone can help me resolve this error. I have a custom repo and a custom plugin that I'm developing for QGIS. I recently updated the plugin in the

  • How to toggle group visibility in QGIS using Python?February 5

    I've tried this, but it doesn't work out. root = QgsProject.instance().layerTreeRoot() group1 = root.insertGroup(0, "PGB") legend = i.legendInterface() legend.isGroupVisible(group1) legend.setGroupVisible(group1, False) --------------Solutions--

  • QGIS - PYQGIS Import gpx as vector layer

    QGIS - PYQGIS Import gpx as vector layerFebruary 4

    I'm trying to use the python console to import some gpx files as vector layers. When I do it manually I have to choose which layers to add, my options are: I've tried various versions of the code from the manual: uri = "path/to/gpx/file.gpx?type=trac

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.517 s.