Linked Questions
10 questions linked to/from Creating new empty vector layer with PyQGIS
3
votes
2
answers
15k
views
Converting raster tif to point shapefile using Python?
I've been working on a data that is in .tif raster format. I need to convert that into a points shapefile (.shp) to proceed. I went through GDAL in Python but there's only gdal.Polygonize(). So how do ...
8
votes
1
answer
3k
views
Adding calculated fields with PyQGIS
In the Memory provider described in PyQGIS Cookbook and in the question Creating new empty vector layer with PyQGIS I can see how to create a Vector Layer programmatically using standard fields (...
3
votes
1
answer
3k
views
Creating new empty memory layer with fields scheme from other layer in QGIS?
Being new with python so far, I got inspired by this answer: https://gis.stackexchange.com/a/155988/8202
to dive into it a bit.
When creating features in a new target layer from an existing source ...
3
votes
1
answer
2k
views
Why are the features in my memory layer not displayed?
I am trying to create a memory layer, I followed the directions from the page below but no points appeared on my map. First I tried typing each line into the python console and I also create a plugin ...
2
votes
1
answer
2k
views
How to add new columns with attributes in existing Qgis layer?
How to add new columns with attributes in existing Qgis layer?
Doing the "same thing" here described
1
vote
1
answer
1k
views
How to depict line symbols with length from attribute
I want to depict angled drill holes as a horizontal traces (plan view).
I have a CSV file with X,Y,Azimuth and Horizontal length.
Using the simple marker I can get a line pointing in the right ...
3
votes
2
answers
276
views
Joining vector layer with CSV-file that contain duplicates in QGIS
I'm currently working on a project, and I received a CSV file which has additional information about each feature. I intend to join the CSV file with an existing layer. Picture it like this:
However, ...
4
votes
0
answers
361
views
PyQgis - Adding attributes to a POSTGIS layer
After reading @underdark's answer to this question on creating a new vector layer and @Matthias Kuhn's to this one on field calculation, I wrote a script that allows me to calcultate the mean arrival-...
5
votes
0
answers
299
views
PyQGIS 3: Create a layer with a primary key
I have written a plugin for QGIS that is importing some data. In this plugin, I can create a memory layer for the data like I have described here https://gis.stackexchange.com/a/349354/10123.
How can ...
2
votes
0
answers
246
views
Creating new empty vector layer that has same set of atributes as another layer and then copying subset of features into it
I am new to both Python and QGIS.
Here's a sample of my code:
unique = layer.uniqueValues(index)
attributes = layer..dataProvider().fields().toList()
assistant_layer = QgsVectorLayer("Point", "...