Questions tagged [memory-layer]

A temporary layer created in the computer's memory only, and not written to the hard drive. Normally created as an intermediate step in a larger geoprocessing task.

Filter by
Sorted by
Tagged with
1 vote
0 answers
87 views

How to obtain output in a scratch memory layer when using processing.run() in qgis plugins

I am writing a python plugin for QGIS and I need to use an inbuilt tool "Distance to nearest hub (line to hub)" in the QGIS processing toolbox. The following line is supposed to give me the ...
user avatar
  • 51
0 votes
0 answers
110 views

Open a server response from memory (not saving to hard drive) with PyQGIS?

I am getting server response in XML format. To work with it in QGIS as a layer, I have to save it to my hard drive and then open it. Can I turn the server's XML response into a vector layer without ...
user avatar
4 votes
1 answer
239 views

Write output of QGIS Batch Processing to temporary layers

Is it possible to write the outputs of QGIS Batch Processing to temporary/memory layers?
user avatar
  • 178
1 vote
1 answer
52 views

PyQGIS-Code in Plugin doesn't store features completely in memory layer

Within a QGIS plugin I download data which is then converted into a list of QgsFeatures. My way of storing for a long time was to use addFeatures on the provider object, but now in QGIS 3.16 LTR, not ...
user avatar
3 votes
1 answer
88 views

pyqgis 3 Union multiple layers using temporary layers

I would like to use the tool "Union" to union 3 different layers. This tool unfortunately can union only 2 layers so I have to run it twice. First I run it to union the layers "Layer1&...
user avatar
  • 359
1 vote
1 answer
140 views

Using PyQGIS to set a mem_layer values to 2 decimal points

I am creating 12 mem_layers through a for loop and then using the zonal statistics tool for each one, to calculate a sum value. This sum value has many decimal places and I would like to reduce the ...
user avatar
  • 173
2 votes
1 answer
237 views

Rotating features in memory layer using PyQGIS

I can rotate polygon features in a shapefile using: vlayer = iface.activeLayer() vlayer.startEditing() for ft in vlayer.getFeatures(): geom = ft.geometry() pt = ft.geometry().centroid()....
user avatar
  • 493
1 vote
0 answers
132 views

PyQGIS 3.4 Processing Memory Issue

I am using GDAL to clip my DEM by the selected polygon in the active layer with QGIS 3.4. I am facing a problem with the memory layer. I read the questions asked before related to this topic PyQGIS ...
user avatar
  • 1,373
3 votes
2 answers
414 views

Using temporary output in a Raster Calculator algorithm

I'm doing some DTM processing, the first couple of stages are a slope calculation and then a Raster calculator process using QGIS's native raster calculator. I want to use the output layer from my ...
user avatar
  • 99
4 votes
1 answer
223 views

Using memory layer as input with processing runalg in PyQGIS

My first processing runalg creates a memory layer as output. I need to use this layer as the input for the second runalg. #first processing.run("qgis:fieldcalculator", {'INPUT':'...
user avatar
2 votes
1 answer
285 views

Moving a memory layer in the TOC using PyQGIS

I've got a layer (difflayer) that has been created in memory. Basically, all the layers I've got in this project are in memory and the layer creation/manipulation is all being handled via a plugin. ...
user avatar
  • 814
1 vote
2 answers
106 views

Geometry of layer disappears when creating scratch/memory layer with script

I'm trying to write a Python script (QGis 3.4.9) to create a group of scratch-layers (polygon, line and point). When it is inside the function the layer is created as it should, but when the function ...
user avatar
  • 435
3 votes
1 answer
330 views

Create Memory layer in pyQGIS with projected coordinates

I am trying to make a memory layer in QGIS using python and then generate a grid base on calculations in meters. When I run the script, a banner comes and says the CRS is not defined. Then when I look ...
user avatar
2 votes
3 answers
938 views

How can I save a vector layer to memory (or is there a reason QGIS doesn't allow this)?

It's impressive how many different vector file formats QGIS (using ver 3.6.0) allows me to save a layer as: But as far as I can tell, QGIS doesn't allow me to save a vector layer to memory. In my ...
user avatar
  • 130
1 vote
0 answers
50 views

Qgis Python Plugin leaves orphaned variables in RAM, even after plugin reload [closed]

My python plugin for QGIS 2.18 opens files with millions of features. To convert them in Qgis readable format, I run through several external python libs, one of them is a R-Tree tool, consuming 10G ...
user avatar
  • 149
9 votes
1 answer
2k views

Using memory layer for processing algorithms in QGIS 3

I would like to run a processing algorithms in QGIS3 with a memory vector layer as result. When I define the memory layer as shown in the following, I get the error Incorrect parameter value for ...
user avatar
6 votes
2 answers
13k views

Where are the temporary output layers from QGIS processing algorithms stored?

Context I have always worked with memory outputs from several QGIS geoalgorithms within the Processing Toolbox. If it wasn't specified a location when saving the result, the output was stored as a ...
user avatar
  • 15.5k
4 votes
1 answer
365 views

Save the result of raster calculator as an memory layer in pyqgis

I am using QGIS raster calc as below. Now I am saving it as a tiff. But is there a way that I can save it as a memory layer? I want to refer to that resulting memory layer and polygonize it, and ...
user avatar
  • 1,346
6 votes
1 answer
509 views

Memory Leak when deleting a layer

I am working on a project based on QGIS API c++ 2.8.2 and qt4.8. I have two methods in a class, the first create a layer and add a point Here is the code for the creating: LibCartoError CMyQgsS57::...
user avatar
  • 833
3 votes
2 answers
761 views

geometry less memory layer in QGIS

I'm writing a QGIS plugin and I need to create a table with some attributes that, in a second moment, I'll load in a SpatiaLite database. The table is created as a memory layer, but as I said, it is ...
user avatar
  • 2,644
3 votes
2 answers
2k views

QGIS 2.10 Unable to add features to a memory layer

I'm trying to add features to a memory layer. This is the layer creation : memlayer=QgsVectorLayer("{zr_typegeom}?crs=epsg:4326".format(zr_typegeom = typegeom), "memlayer", "memory") ...
user avatar
  • 369
1 vote
2 answers
762 views

How to change attributes values in a memory layer?

i want to change attributes values in a memory layer. I already asked a similar question but i'm re-stuck on the problem and don't find any solution to this basic need. Here is what i'm doing so far ...
user avatar
  • 5,473
1 vote
1 answer
402 views

Updating an Open Attribute Table

A work-in-progress plugin's dialog window contains a rolodex which allows the user to cycle through a timeseries of data; updating the relative memory layers geometries with each new time selection. ...
user avatar
  • 821
6 votes
3 answers
5k views

-9999 (no data value) becomes 0 when writing array to GDAL memory file

I am trying to reproject and resample (1000m ->> 30m) a raster image (shape 238X406) using gdal.ReprojectImage() function in Python. The input file has -9999 cells as no data value. The result is an ...
user avatar
  • 121
2 votes
0 answers
197 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", "...
user avatar
3 votes
1 answer
2k 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 ...
user avatar
  • 3,064
7 votes
1 answer
3k views

Layer is not valid error in my standalone PyQGIS script/app

I have written a python class which reads properties of map layers from an XML file and creates appropriate memory layers. I have developed and tested this code with QGIS 2.8.2 on a Windows 7 machine (...
user avatar
  • 4,400
1 vote
2 answers
1k views

Use raster memory layer from QGIS processing result

I want to apply subsequent QGIS raster processing algorithms in a python script. I want to use memory layers for intermediate calculation results since I am only interested in the end result. As ...
user avatar
  • 163
4 votes
1 answer
1k views

Error writing memory layer to shapefile in QGIS

I have created a memory polygon layer in my QGIS plugin. Then I added a buffer based on a point. I can see the ploygon memory layer in the map canvas and I can save it to a shapefile from the main GUI....
user avatar
  • 176
3 votes
1 answer
3k views

What is a memory vector layer in QGIS?

What is a memory vector layer and how does it relate to the vector layer? Background info: I have a volunteer working with my organization, because of financial reasons we have him using QGIS. He ...
user avatar
1 vote
0 answers
423 views

QGIS-Processing runalg and Memory Layer issue [duplicate]

I'm trying to make a script for converting polygons to lines. But I'm having some issues while generating temporary layers. In this script, I iterate through all the features of the input layer to ...
user avatar
  • 51