Virtual layer functionality does not seem to support memory layersSpatial join for closest features and using a sum merge rule in QGISMemory Vector Layer Corrupted?Is it possible to use memory layers in QGIS processing algorithms?QGIS python originalName() does not return actual original layer nameVirtual fields are lost when duplicate layersQGIS virtual layer path never saved as relativeClipping virtual raster generates out of memory errorLoad non-spatial table in QGIS by querying an Oracle databaseAdd layer to existing geopackage not working in QGIS?Virtual layer from query with special characters in field name using PyQGISSpatial Query for a Virtual Layer
Minor Revision with suggestion of an alternative proof by reviewer
Does a large simulator bay have standard public address announcements?
Why do games have consumables?
What is the most expensive material in the world that could be used to create Pun-Pun's lute?
How much cash can I safely carry into the USA and avoid civil forfeiture?
Function pointer with named arguments?
What happened to Captain America in Endgame?
How to fry ground beef so it is well-browned
Like totally amazing interchangeable sister outfits II: The Revenge
Who was the lone kid in the line of people at the lake at the end of Avengers: Endgame?
"You've called the wrong number" or "You called the wrong number"
Why does Mind Blank stop the Feeblemind spell?
Why did C use the -> operator instead of reusing the . operator?
a sore throat vs a strep throat vs strep throat
Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?
Converting a sprinkler system's 24V AC outputs to 3.3V DC logic inputs
How can I practically buy stocks?
Why does nature favour the Laplacian?
Rivers without rain
Implications of cigar-shaped bodies having rings?
Alignment of various blocks in tikz
What does the integral of a function times a function of a random variable represent, conceptually?
Does tea made with boiling water cool faster than tea made with boiled (but still hot) water?
Is Diceware more secure than a long passphrase?
Virtual layer functionality does not seem to support memory layers
Spatial join for closest features and using a sum merge rule in QGISMemory Vector Layer Corrupted?Is it possible to use memory layers in QGIS processing algorithms?QGIS python originalName() does not return actual original layer nameVirtual fields are lost when duplicate layersQGIS virtual layer path never saved as relativeClipping virtual raster generates out of memory errorLoad non-spatial table in QGIS by querying an Oracle databaseAdd layer to existing geopackage not working in QGIS?Virtual layer from query with special characters in field name using PyQGISSpatial Query for a Virtual Layer
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a memory layer loaded in the QGIS virtual layer in the data source manager. I am trying to run a very simple query:
select * from layer
Here is a snapshot:
While this works for the physical layer, it does not work for the memory layer. They output virtual layer is blank, and I know that my memory layer has attribute data.
Is this simply a bug? I want to keep this a memory layer to reduce the number of steps I need to do to arrive at my final result. Should I resort to another tool or is there a workaround?
EDIT
Also found this quote in this link:
Creating a virtual layer with the layer_ref key allows to directly access already loaded QGIS layers (including memory layers).
qgis virtual-layer
|
show 2 more comments
I have a memory layer loaded in the QGIS virtual layer in the data source manager. I am trying to run a very simple query:
select * from layer
Here is a snapshot:
While this works for the physical layer, it does not work for the memory layer. They output virtual layer is blank, and I know that my memory layer has attribute data.
Is this simply a bug? I want to keep this a memory layer to reduce the number of steps I need to do to arrive at my final result. Should I resort to another tool or is there a workaround?
EDIT
Also found this quote in this link:
Creating a virtual layer with the layer_ref key allows to directly access already loaded QGIS layers (including memory layers).
qgis virtual-layer
1
Just tested right now : i had no problem of this kind (Q3.44) ... Are you sure of your data structure ?
– snaileater
Apr 19 at 9:28
1
what do you mean by data structure? I am just calling all columns in the table I loaded.... Using QGIS3.2.2 by the way
– user32882
Apr 19 at 9:29
1
When u open its attribute table in the layer manager you see all the features (those u would like to get when querying it) ? Do u just get an empty answer or any error message ? Did u try a selectcount(*) from memory_layer
?
– snaileater
Apr 19 at 9:33
1
The resulting virtual layer is empty (no attributes, no fields). The original memory layer has plenty of attributes... I'm updating QGIS now to see if it has been fixed
– user32882
Apr 19 at 9:36
1
Nope... doesn't work with QGIS 3.4.6... Are you sure you tested a memory layer?
– user32882
Apr 19 at 9:43
|
show 2 more comments
I have a memory layer loaded in the QGIS virtual layer in the data source manager. I am trying to run a very simple query:
select * from layer
Here is a snapshot:
While this works for the physical layer, it does not work for the memory layer. They output virtual layer is blank, and I know that my memory layer has attribute data.
Is this simply a bug? I want to keep this a memory layer to reduce the number of steps I need to do to arrive at my final result. Should I resort to another tool or is there a workaround?
EDIT
Also found this quote in this link:
Creating a virtual layer with the layer_ref key allows to directly access already loaded QGIS layers (including memory layers).
qgis virtual-layer
I have a memory layer loaded in the QGIS virtual layer in the data source manager. I am trying to run a very simple query:
select * from layer
Here is a snapshot:
While this works for the physical layer, it does not work for the memory layer. They output virtual layer is blank, and I know that my memory layer has attribute data.
Is this simply a bug? I want to keep this a memory layer to reduce the number of steps I need to do to arrive at my final result. Should I resort to another tool or is there a workaround?
EDIT
Also found this quote in this link:
Creating a virtual layer with the layer_ref key allows to directly access already loaded QGIS layers (including memory layers).
qgis virtual-layer
qgis virtual-layer
edited Apr 20 at 12:52
underdark♦
69.4k13179351
69.4k13179351
asked Apr 19 at 9:12
user32882user32882
1,17611127
1,17611127
1
Just tested right now : i had no problem of this kind (Q3.44) ... Are you sure of your data structure ?
– snaileater
Apr 19 at 9:28
1
what do you mean by data structure? I am just calling all columns in the table I loaded.... Using QGIS3.2.2 by the way
– user32882
Apr 19 at 9:29
1
When u open its attribute table in the layer manager you see all the features (those u would like to get when querying it) ? Do u just get an empty answer or any error message ? Did u try a selectcount(*) from memory_layer
?
– snaileater
Apr 19 at 9:33
1
The resulting virtual layer is empty (no attributes, no fields). The original memory layer has plenty of attributes... I'm updating QGIS now to see if it has been fixed
– user32882
Apr 19 at 9:36
1
Nope... doesn't work with QGIS 3.4.6... Are you sure you tested a memory layer?
– user32882
Apr 19 at 9:43
|
show 2 more comments
1
Just tested right now : i had no problem of this kind (Q3.44) ... Are you sure of your data structure ?
– snaileater
Apr 19 at 9:28
1
what do you mean by data structure? I am just calling all columns in the table I loaded.... Using QGIS3.2.2 by the way
– user32882
Apr 19 at 9:29
1
When u open its attribute table in the layer manager you see all the features (those u would like to get when querying it) ? Do u just get an empty answer or any error message ? Did u try a selectcount(*) from memory_layer
?
– snaileater
Apr 19 at 9:33
1
The resulting virtual layer is empty (no attributes, no fields). The original memory layer has plenty of attributes... I'm updating QGIS now to see if it has been fixed
– user32882
Apr 19 at 9:36
1
Nope... doesn't work with QGIS 3.4.6... Are you sure you tested a memory layer?
– user32882
Apr 19 at 9:43
1
1
Just tested right now : i had no problem of this kind (Q3.44) ... Are you sure of your data structure ?
– snaileater
Apr 19 at 9:28
Just tested right now : i had no problem of this kind (Q3.44) ... Are you sure of your data structure ?
– snaileater
Apr 19 at 9:28
1
1
what do you mean by data structure? I am just calling all columns in the table I loaded.... Using QGIS3.2.2 by the way
– user32882
Apr 19 at 9:29
what do you mean by data structure? I am just calling all columns in the table I loaded.... Using QGIS3.2.2 by the way
– user32882
Apr 19 at 9:29
1
1
When u open its attribute table in the layer manager you see all the features (those u would like to get when querying it) ? Do u just get an empty answer or any error message ? Did u try a select
count(*) from memory_layer
?– snaileater
Apr 19 at 9:33
When u open its attribute table in the layer manager you see all the features (those u would like to get when querying it) ? Do u just get an empty answer or any error message ? Did u try a select
count(*) from memory_layer
?– snaileater
Apr 19 at 9:33
1
1
The resulting virtual layer is empty (no attributes, no fields). The original memory layer has plenty of attributes... I'm updating QGIS now to see if it has been fixed
– user32882
Apr 19 at 9:36
The resulting virtual layer is empty (no attributes, no fields). The original memory layer has plenty of attributes... I'm updating QGIS now to see if it has been fixed
– user32882
Apr 19 at 9:36
1
1
Nope... doesn't work with QGIS 3.4.6... Are you sure you tested a memory layer?
– user32882
Apr 19 at 9:43
Nope... doesn't work with QGIS 3.4.6... Are you sure you tested a memory layer?
– user32882
Apr 19 at 9:43
|
show 2 more comments
2 Answers
2
active
oldest
votes
You can find all your layers in the DB-manager. There (in my opinion) it is easier to access and query them. And you can load results as a new layer.
Go to DB-manager > Virtual Layers > QGIS layers
Select one of the layers and make your query. Note that the geometry is written as
geometry
and notgeom
.
The DB Manager is much better and could be a good segway into PostGIS, spatialite or other db-type gis systems. Do you know if the geometry column can be manipulated in here to do spatial queries as well? Perhaps I don't need that NNJoin plugin after all.... that would be nice
– user32882
Apr 19 at 13:10
I never used the NNjoin before. So I do not know which functionality it has. But probably it would perform the same with spatialite or postgis
– PieterB
Apr 23 at 7:31
To answer your question @user32882 you can easily perform spatial joins and nearest neighbour queries in DB Manager using SQL. It may not be that fast if you are using shapefiles in DB manager, but it is dynamic and much more flexible (pick which columns to join, distance threshold for nearest neighbour, etc). If you use spatialite you can access the VirtualKNN feature directly within DB Manager. SQL is well worth exploring
– she_weeds
14 hours ago
add a comment |
The upper section, embeded layers
, allows listing (and using) layers that are not loaded in QGIS table of content.
Using an in-memory layer that is not loaded in QGIS is to be tested. I believe the layer is cleared from memory as soon as it is removed from the table of content.
If you do have the in-memory layer loaded in the table of content, you can simply remove it from the embeded layers
section, and the query will work. I just reproduced your use case and workaround in 3.4.5
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f319324%2fvirtual-layer-functionality-does-not-seem-to-support-memory-layers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can find all your layers in the DB-manager. There (in my opinion) it is easier to access and query them. And you can load results as a new layer.
Go to DB-manager > Virtual Layers > QGIS layers
Select one of the layers and make your query. Note that the geometry is written as
geometry
and notgeom
.
The DB Manager is much better and could be a good segway into PostGIS, spatialite or other db-type gis systems. Do you know if the geometry column can be manipulated in here to do spatial queries as well? Perhaps I don't need that NNJoin plugin after all.... that would be nice
– user32882
Apr 19 at 13:10
I never used the NNjoin before. So I do not know which functionality it has. But probably it would perform the same with spatialite or postgis
– PieterB
Apr 23 at 7:31
To answer your question @user32882 you can easily perform spatial joins and nearest neighbour queries in DB Manager using SQL. It may not be that fast if you are using shapefiles in DB manager, but it is dynamic and much more flexible (pick which columns to join, distance threshold for nearest neighbour, etc). If you use spatialite you can access the VirtualKNN feature directly within DB Manager. SQL is well worth exploring
– she_weeds
14 hours ago
add a comment |
You can find all your layers in the DB-manager. There (in my opinion) it is easier to access and query them. And you can load results as a new layer.
Go to DB-manager > Virtual Layers > QGIS layers
Select one of the layers and make your query. Note that the geometry is written as
geometry
and notgeom
.
The DB Manager is much better and could be a good segway into PostGIS, spatialite or other db-type gis systems. Do you know if the geometry column can be manipulated in here to do spatial queries as well? Perhaps I don't need that NNJoin plugin after all.... that would be nice
– user32882
Apr 19 at 13:10
I never used the NNjoin before. So I do not know which functionality it has. But probably it would perform the same with spatialite or postgis
– PieterB
Apr 23 at 7:31
To answer your question @user32882 you can easily perform spatial joins and nearest neighbour queries in DB Manager using SQL. It may not be that fast if you are using shapefiles in DB manager, but it is dynamic and much more flexible (pick which columns to join, distance threshold for nearest neighbour, etc). If you use spatialite you can access the VirtualKNN feature directly within DB Manager. SQL is well worth exploring
– she_weeds
14 hours ago
add a comment |
You can find all your layers in the DB-manager. There (in my opinion) it is easier to access and query them. And you can load results as a new layer.
Go to DB-manager > Virtual Layers > QGIS layers
Select one of the layers and make your query. Note that the geometry is written as
geometry
and notgeom
.
You can find all your layers in the DB-manager. There (in my opinion) it is easier to access and query them. And you can load results as a new layer.
Go to DB-manager > Virtual Layers > QGIS layers
Select one of the layers and make your query. Note that the geometry is written as
geometry
and notgeom
.
edited Apr 19 at 11:33
answered Apr 19 at 11:01
PieterBPieterB
3,2001129
3,2001129
The DB Manager is much better and could be a good segway into PostGIS, spatialite or other db-type gis systems. Do you know if the geometry column can be manipulated in here to do spatial queries as well? Perhaps I don't need that NNJoin plugin after all.... that would be nice
– user32882
Apr 19 at 13:10
I never used the NNjoin before. So I do not know which functionality it has. But probably it would perform the same with spatialite or postgis
– PieterB
Apr 23 at 7:31
To answer your question @user32882 you can easily perform spatial joins and nearest neighbour queries in DB Manager using SQL. It may not be that fast if you are using shapefiles in DB manager, but it is dynamic and much more flexible (pick which columns to join, distance threshold for nearest neighbour, etc). If you use spatialite you can access the VirtualKNN feature directly within DB Manager. SQL is well worth exploring
– she_weeds
14 hours ago
add a comment |
The DB Manager is much better and could be a good segway into PostGIS, spatialite or other db-type gis systems. Do you know if the geometry column can be manipulated in here to do spatial queries as well? Perhaps I don't need that NNJoin plugin after all.... that would be nice
– user32882
Apr 19 at 13:10
I never used the NNjoin before. So I do not know which functionality it has. But probably it would perform the same with spatialite or postgis
– PieterB
Apr 23 at 7:31
To answer your question @user32882 you can easily perform spatial joins and nearest neighbour queries in DB Manager using SQL. It may not be that fast if you are using shapefiles in DB manager, but it is dynamic and much more flexible (pick which columns to join, distance threshold for nearest neighbour, etc). If you use spatialite you can access the VirtualKNN feature directly within DB Manager. SQL is well worth exploring
– she_weeds
14 hours ago
The DB Manager is much better and could be a good segway into PostGIS, spatialite or other db-type gis systems. Do you know if the geometry column can be manipulated in here to do spatial queries as well? Perhaps I don't need that NNJoin plugin after all.... that would be nice
– user32882
Apr 19 at 13:10
The DB Manager is much better and could be a good segway into PostGIS, spatialite or other db-type gis systems. Do you know if the geometry column can be manipulated in here to do spatial queries as well? Perhaps I don't need that NNJoin plugin after all.... that would be nice
– user32882
Apr 19 at 13:10
I never used the NNjoin before. So I do not know which functionality it has. But probably it would perform the same with spatialite or postgis
– PieterB
Apr 23 at 7:31
I never used the NNjoin before. So I do not know which functionality it has. But probably it would perform the same with spatialite or postgis
– PieterB
Apr 23 at 7:31
To answer your question @user32882 you can easily perform spatial joins and nearest neighbour queries in DB Manager using SQL. It may not be that fast if you are using shapefiles in DB manager, but it is dynamic and much more flexible (pick which columns to join, distance threshold for nearest neighbour, etc). If you use spatialite you can access the VirtualKNN feature directly within DB Manager. SQL is well worth exploring
– she_weeds
14 hours ago
To answer your question @user32882 you can easily perform spatial joins and nearest neighbour queries in DB Manager using SQL. It may not be that fast if you are using shapefiles in DB manager, but it is dynamic and much more flexible (pick which columns to join, distance threshold for nearest neighbour, etc). If you use spatialite you can access the VirtualKNN feature directly within DB Manager. SQL is well worth exploring
– she_weeds
14 hours ago
add a comment |
The upper section, embeded layers
, allows listing (and using) layers that are not loaded in QGIS table of content.
Using an in-memory layer that is not loaded in QGIS is to be tested. I believe the layer is cleared from memory as soon as it is removed from the table of content.
If you do have the in-memory layer loaded in the table of content, you can simply remove it from the embeded layers
section, and the query will work. I just reproduced your use case and workaround in 3.4.5
add a comment |
The upper section, embeded layers
, allows listing (and using) layers that are not loaded in QGIS table of content.
Using an in-memory layer that is not loaded in QGIS is to be tested. I believe the layer is cleared from memory as soon as it is removed from the table of content.
If you do have the in-memory layer loaded in the table of content, you can simply remove it from the embeded layers
section, and the query will work. I just reproduced your use case and workaround in 3.4.5
add a comment |
The upper section, embeded layers
, allows listing (and using) layers that are not loaded in QGIS table of content.
Using an in-memory layer that is not loaded in QGIS is to be tested. I believe the layer is cleared from memory as soon as it is removed from the table of content.
If you do have the in-memory layer loaded in the table of content, you can simply remove it from the embeded layers
section, and the query will work. I just reproduced your use case and workaround in 3.4.5
The upper section, embeded layers
, allows listing (and using) layers that are not loaded in QGIS table of content.
Using an in-memory layer that is not loaded in QGIS is to be tested. I believe the layer is cleared from memory as soon as it is removed from the table of content.
If you do have the in-memory layer loaded in the table of content, you can simply remove it from the embeded layers
section, and the query will work. I just reproduced your use case and workaround in 3.4.5
answered Apr 19 at 11:23
JGHJGH
13.9k21339
13.9k21339
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f319324%2fvirtual-layer-functionality-does-not-seem-to-support-memory-layers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Just tested right now : i had no problem of this kind (Q3.44) ... Are you sure of your data structure ?
– snaileater
Apr 19 at 9:28
1
what do you mean by data structure? I am just calling all columns in the table I loaded.... Using QGIS3.2.2 by the way
– user32882
Apr 19 at 9:29
1
When u open its attribute table in the layer manager you see all the features (those u would like to get when querying it) ? Do u just get an empty answer or any error message ? Did u try a select
count(*) from memory_layer
?– snaileater
Apr 19 at 9:33
1
The resulting virtual layer is empty (no attributes, no fields). The original memory layer has plenty of attributes... I'm updating QGIS now to see if it has been fixed
– user32882
Apr 19 at 9:36
1
Nope... doesn't work with QGIS 3.4.6... Are you sure you tested a memory layer?
– user32882
Apr 19 at 9:43