Linked Questions

8 votes
1 answer

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 (...
rpet's user avatar
  • 159
5 votes
0 answers

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 How can ...
MortenSickel's user avatar
  • 3,834
4 votes
0 answers

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-...
Abigail's user avatar
  • 81
3 votes
2 answers

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 ...
Srinath Radhakrishnan's user avatar
3 votes
1 answer

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: to dive into it a bit. When creating features in a new target layer from an existing source ...
Bernd V.'s user avatar
  • 3,199
3 votes
1 answer

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 ...
GreyHippo's user avatar
  • 2,190
3 votes
2 answers

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, ...
eafwnrg's user avatar
  • 51
2 votes
0 answers

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", "...
cyfrostan's user avatar
2 votes
1 answer

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
nempau's user avatar
  • 43
1 vote
1 answer

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 ...
Gin's user avatar
  • 470