Skip to main content

Questions tagged [ppygis]

PPyGIS is an extension for Psycopg which adds support for PostGIS geometry objects

Filter by
Sorted by
Tagged with
0 votes
2 answers
52 views

Extracting polygon features touched by a line feature

I have polygon features (like streets or fields) and a line feature over them. I want to have all the polygon features touched by the line in a separate layer. If I run clip or intersect it only ...
QGuy's user avatar
  • 3
0 votes
1 answer
63 views

Style a Polygon (speed restriction area) with just an SVG Road Sign at either end of the polygon in QGIS 3

I have a series of "zones" which are polygons along a road which have a speed attribute, I'd like to rather than just shade the polygons based on speed, actually show the 20mph or 30mph sign ...
sar_copp's user avatar
1 vote
2 answers
406 views

Loading specific layer by its name from GeoPackage

How can I load a specific layer by its name from a GeoPackage into the project. I tried the graphical model designer, but it always loads a layer from the geopackage and labels it with my layer name (...
miraculix's user avatar
  • 179
1 vote
1 answer
314 views

PyQGIS: Querying PostGIS Table

I am trying to run a query on a PostGIS table via PyQGIS (QGIS3.16-Hannover installed on an Ubuntu 20.04LTS Desktop). Everything works fine if I SELECT ALL FIELDS using the wildcard pattern (*) ...
HelpOverFlow's user avatar
1 vote
2 answers
450 views

How to create when possible a rectangle in polygons with holes [duplicate]

I did not find a similar question on this site. Is there a way to automatically create a rectangular polygon of 500 square meters inside another polygon with rings using QGIS? (I have 28,000 polygons ...
fcka's user avatar
  • 985
2 votes
0 answers
117 views

Making QGIS GUI responsive while adding multiple layers in Plugin

I have a tool button that add many layers from python code (WFS, PostgreSQL, ...), about 50 layers (30s to load) in QGIS. During the process the application seem to be crashed "not responding&...
TrsBar's user avatar
  • 523
-2 votes
2 answers
339 views

PyGis: How to enable and disable raster layers with Python? [closed]

How to enable and disable raster layers with Python? It should be a solution without selecting the layers before turn them off or on. I could find some code snippets for vector layers, but not for ...
user122841's user avatar
2 votes
1 answer
3k views

Exporting layers as CSV-files using PyQGIS

I am trying to export several layers as CSV-files since I need to analyze them in another software. However, I cannot get my code to work. I am new to Python. Currently working in QGis 3.10.9. I would ...
timpan's user avatar
  • 179
2 votes
0 answers
413 views

Networkx Graph from two separate shapefiles

I have two shapefiles that represent a railway network. The first shapefile (tracks.shp) contains LineStrings representing tracks The second shapefile (crossings.shp) contains Points representing ...
stack exchanger's user avatar
2 votes
1 answer
3k views

Using OpenCV function in PyQGIS - Module not found

I would like to write a code using the OpenCV function cv2.bitwise_and, and run it in the Python console on QGIS. To do so, I start my code with import cv2. QGIS is returning the following error : ...
Caroline_GR's user avatar
3 votes
0 answers
2k views

Getting pixel size without opening raster using Python

I want to get the pixel size (resolution) of a raster without opening up the raster in gdal. I currently have my script opening the raster in GDAL using gdal.Open() and getting the resolution that way....
Heather's user avatar
  • 39
1 vote
0 answers
49 views

Creating datasets from .tiff and vectors [closed]

We are group of three masters students at University of Oslo, we're writing a research article this semester. We are proposing a global UAV (drone) localization system by Monte-Carlo Localization and ...
Håkon Tønnessen's user avatar
1 vote
1 answer
46 views

Aggregating the attributes from nearby grids and assigning it to the parent grid in a fishnet

I have 700,000 grids generated to cover an administrative area. I want to calculate the sum of an attribute in its neighboring grids till 2nd order and assign it to each grid. To do so I have ...
Siddharth Soni's user avatar
1 vote
0 answers
39 views

Batch Saving Raster DTm and choosing type in QGIS 2.18

Follow on question from the following Previous question batch saving 10m DTM layers using python console I would now like to set the output of my Raster .tif files to Float32 as by default the .asc ...
David Laverty's user avatar
1 vote
1 answer
250 views

QGIS 2.18: Filter line-layer by QgsExpression

I have a line layer on which I want to run a filter within a python script. I am trying to achieve this via QgsExpression and QgsFeatureRequest. Below you see the same filter that I want to apply in ...
applebrown's user avatar
1 vote
1 answer
399 views

pygis zoom to selected layer

I selected the layer I want to zoom in and I can actually zoom in using the python console that Qgis provides using iface.zoomToActiveLayer() but if I do the same in my code, is like that line is ...
Thriskel's user avatar
  • 355
1 vote
1 answer
247 views

QGIS python script crashed with minidump written to C

I have written a python script which has two input vector layers (one point-layer and one line-layer). The outpout is another line-layer. But when I try too set the geometry for the new edge, the ...
applebrown's user avatar
2 votes
1 answer
814 views

Joining attributes after selecting one polygon which intersects another using geopandas?

To select the polygons which overlap other layer's polygons, I came up with this code based on what I found on this site: import geopandas as gpd import fiona import os import sys # Get the current ...
francois's user avatar
  • 315
2 votes
0 answers
151 views

Insert point layer as input for GRASS viewshed in QGIS 3.2 modeler

I’m building a QGIS (3.2 Bonn) tool for my colleagues using graphical modeler. The tool should get 3 inputs: DEM raster layer, vector layer of points, vector layer of a point of interest (POI). The ...
user88484's user avatar
  • 1,839
2 votes
2 answers
1k views

Creating a portable map package file folder

I am searching for an expression or some assistance in changing filepaths and links to photos within attributes to relative paths. I have used QConsolidate to create a folder with all the files and ...
David Cini's user avatar
2 votes
0 answers
29 views

pyqgis composer legend error(no print)

i want to use composer in pyqgis standalone script to create some easy mas using one raster. my output image is correct i have the image but that code cant print show the legend in the map, any ...
Mar's user avatar
  • 1,119
0 votes
1 answer
143 views

Analysing and mapping intersection of layers with one layer with overlapping Polygons

I have one layer (a_layer) with approx 400 overlapping polygons and no more data as the fid. I want to analyse how many countys (b_layer) are coverd by each polygon of tha a_layer. I was thinking to ...
Torsten's user avatar
  • 406
1 vote
1 answer
66 views

Fill or inserting new field based on comparison of two other field

I have a layer Network with two different columns Route and section I need a query or function that compare Route rows , and section rows, and create or rather fill the new_field with this ...
AED EDA's user avatar
  • 187
2 votes
1 answer
3k views

How to batch export rasters as GeoTIFF with new CRS?

I need some help concerning the exporting of a large batch of raster-files (mostly SID-types) as GeoTIFFs in a reference system (WGS 84) that is different from the one in which the original files were ...
Djro33's user avatar
  • 59
0 votes
1 answer
142 views

standalone script using grass7:v.clean gives erro

I am writing a standalone script using QGIS processing plugins. everything works but after adding a new command it gives me some errors. The command is as folloing: processing.runalg("grass7:v.clean",...
Mohamad Reza Salehi Sadaghiani's user avatar
2 votes
1 answer
256 views

QGIS treatment modeler to python script

I'm trying to make a little tool who do a concave hull, and calculate its surface in a new field. I'm not a python pro, so I began with treatment modeler like this : It works very well ! But I have ...
Tim C.'s user avatar
  • 1,536
1 vote
0 answers
238 views

Keep dialog displayed while processing

I'm working on a plug-in for QGIS and I'm a bit stuck on a problem with my dialog (realized on Qt Designer). Indeed, I added a progression bar wich seems to work, but I can't really check this ...
Thomas's user avatar
  • 11
1 vote
0 answers
32 views

Append object from another layer to the new layer through form (drop-down list)

I'm trying to get to know is it possible to append object from another layer to the new layer through form (drop-down list)? Do I need to create an application? If yes please tell me what language ...
Jakub O's user avatar
  • 83
2 votes
1 answer
2k views

Get a point value with psycopg2 and PPyGIS

I'm trying to setup a basic working postgis setup with python ppygis package. >>> import psycopg2 >>> import ppygis >>> connection = psycopg2.connect(database='spre', user='...
Vineet Menon's user avatar