Home >

pyqgis

Advertisement
  • Adding all Binary Rasters in a Directory Using Raster Calculator in a Standalone Python ScriptApril 6

    I have a directory with binary raster files (1 band only) which I need to add in a standalone python script. The problem is the rasters have different number of rows and columns and different resolution (reading them in as numpy arrays and adding the

  • QGIS: Adding all Binary Rasters in a Directory Using Raster Calculator in a Standalone Python ScriptFebruary 7

    I have a directory with binary raster files (1 band only) which I need to add in a standalone python script. The problem is the rasters have different number of rows and columns and different resolution (reading them in as numpy arrays and adding the

  • Set CRS for Raster in QgsRasterLayer (pyqgis)February 7

    in a QGIS python plugin I get some code that writes a asc file, this is the header of the final file: NCOLS 20 NROWS 15 XLLCORNER 664400.000000 YLLCORNER 4749500.000000 CELLSIZE 100.000000 NODATA_VALUE -9999.0 NODATA_VALUE -9999.0 as you can see I ge

  • 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

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