How can I save a vector layer to memory (or is there a reason QGIS doesn't allow this)? Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How can I save a column from the attribute table of a vector layer to a variable?How to avoid the CRS Dialog when creating a vector layer memory?How to save data from QGIS 1.8 to PostGIS without shapefile intermediate?Memory Vector Layer Corrupted?Use raster memory layer from QGIS processing resultQGIS - some edit feature options disabled in vector layerCreating new empty memory layer with fields scheme from other layer in QGIS?QGIS Spatialite tabular updates are very slowQgis feature count increases at save layer editsHow to preserve geometry when saving vector files to a SpatiaLite db (QGIS)
What does "lightly crushed" mean for cardamon pods?
How do I find out the mythology and history of my Fortress?
How does the math work when buying airline miles?
Delete nth line from bottom
8 Prisoners wearing hats
2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?
First console to have temporary backward compatibility
Do I really need recursive chmod to restrict access to a folder?
How would a mousetrap for use in space work?
How to find all the available tools in mac terminal?
What causes the direction of lightning flashes?
What font is "z" in "z-score"?
Closed form of recurrent arithmetic series summation
What's the meaning of "fortified infraction restraint"?
Is it common practice to audition new musicians one-on-one before rehearsing with the entire band?
Is the Standard Deduction better than Itemized when both are the same amount?
What do you call a floor made of glass so you can see through the floor?
How to Make a Beautiful Stacked 3D Plot
How could we fake a moon landing now?
If a VARCHAR(MAX) column is included in an index, is the entire value always stored in the index page(s)?
How to react to hostile behavior from a senior developer?
Significance of Cersei's obsession with elephants?
Dating a Former Employee
What does できなさすぎる means?
How can I save a vector layer to memory (or is there a reason QGIS doesn't allow this)?
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?How can I save a column from the attribute table of a vector layer to a variable?How to avoid the CRS Dialog when creating a vector layer memory?How to save data from QGIS 1.8 to PostGIS without shapefile intermediate?Memory Vector Layer Corrupted?Use raster memory layer from QGIS processing resultQGIS - some edit feature options disabled in vector layerCreating new empty memory layer with fields scheme from other layer in QGIS?QGIS Spatialite tabular updates are very slowQgis feature count increases at save layer editsHow to preserve geometry when saving vector files to a SpatiaLite db (QGIS)
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
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 normal workflow in manipulating vector layers, I find myself having to save several intermediate vector layers to file, clogging up my file system or databsase with something like "vector_layer", "vector_layer1", "vector_layer2", "vector_layer2a", etc. It is often trivial to perform the updates/edits to the layer, and because I really don't care about these intermediate files, I'd rather be able to just save them in memory within the QGIS environment. Saving to memory would allow me to simply remove the layers from the project when I finish my workflow instead of having to delete from my Postgres database or my desktop.
When performing a geoprocessing task, there is the option to save to memory, but why can't I have the option to export a layer to memory on its own?
qgis vector qgis-3 save memory-layer
add a comment |
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 normal workflow in manipulating vector layers, I find myself having to save several intermediate vector layers to file, clogging up my file system or databsase with something like "vector_layer", "vector_layer1", "vector_layer2", "vector_layer2a", etc. It is often trivial to perform the updates/edits to the layer, and because I really don't care about these intermediate files, I'd rather be able to just save them in memory within the QGIS environment. Saving to memory would allow me to simply remove the layers from the project when I finish my workflow instead of having to delete from my Postgres database or my desktop.
When performing a geoprocessing task, there is the option to save to memory, but why can't I have the option to export a layer to memory on its own?
qgis vector qgis-3 save memory-layer
I don't get why you are not using those temporary/virtual (memory) layers produced by e.g. the geoprocessing tools; they are, effectively, 'saved to memory'? they are pretty much exactly what you refer to: in-memory (or stored in the QGIS temp directory, kept there until deleted after saving the project), reusable in other tools in the chain and easily disposed of (cluttering only your layer panel, but that can be grouped accordingly)...or am I not getting your question? 'save to memory' is somewhat of a paradox...
– ThingumaBob
Apr 12 at 11:00
You can request a feature: issues.qgis.org.
– csk
Apr 12 at 19:50
@ThingumaBob - maybe "store to memory" is bit more accurate than "save to memory". Like you say, there is no problem storing to memory if using any of the geoprocessing tools. However, that isn't what I am trying to do. I was asking about the option to simply store to memory using the "Export" option.
– Tyler N
2 days ago
@TylerN I know that you asked for export, and I actually didn't know the GDAL virtual env is available from within QGIS. ...the purpose is puzzling me. make those layers available to other software?
– ThingumaBob
2 days ago
@ThingumaBob A common use case for me is to make a copy of a layer to do some edits to the attribute table. I don't necessarily want to make edits on the original data layer because I might risk overwriting/losing my original data. Also, I don't necessarily want to make a copy (or multiple copies) because it clutters up my file directory or database (after all, they are usually intermediate/temporary layers).
– Tyler N
2 days ago
add a comment |
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 normal workflow in manipulating vector layers, I find myself having to save several intermediate vector layers to file, clogging up my file system or databsase with something like "vector_layer", "vector_layer1", "vector_layer2", "vector_layer2a", etc. It is often trivial to perform the updates/edits to the layer, and because I really don't care about these intermediate files, I'd rather be able to just save them in memory within the QGIS environment. Saving to memory would allow me to simply remove the layers from the project when I finish my workflow instead of having to delete from my Postgres database or my desktop.
When performing a geoprocessing task, there is the option to save to memory, but why can't I have the option to export a layer to memory on its own?
qgis vector qgis-3 save memory-layer
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 normal workflow in manipulating vector layers, I find myself having to save several intermediate vector layers to file, clogging up my file system or databsase with something like "vector_layer", "vector_layer1", "vector_layer2", "vector_layer2a", etc. It is often trivial to perform the updates/edits to the layer, and because I really don't care about these intermediate files, I'd rather be able to just save them in memory within the QGIS environment. Saving to memory would allow me to simply remove the layers from the project when I finish my workflow instead of having to delete from my Postgres database or my desktop.
When performing a geoprocessing task, there is the option to save to memory, but why can't I have the option to export a layer to memory on its own?
qgis vector qgis-3 save memory-layer
qgis vector qgis-3 save memory-layer
asked Apr 12 at 3:50
Tyler NTyler N
6318
6318
I don't get why you are not using those temporary/virtual (memory) layers produced by e.g. the geoprocessing tools; they are, effectively, 'saved to memory'? they are pretty much exactly what you refer to: in-memory (or stored in the QGIS temp directory, kept there until deleted after saving the project), reusable in other tools in the chain and easily disposed of (cluttering only your layer panel, but that can be grouped accordingly)...or am I not getting your question? 'save to memory' is somewhat of a paradox...
– ThingumaBob
Apr 12 at 11:00
You can request a feature: issues.qgis.org.
– csk
Apr 12 at 19:50
@ThingumaBob - maybe "store to memory" is bit more accurate than "save to memory". Like you say, there is no problem storing to memory if using any of the geoprocessing tools. However, that isn't what I am trying to do. I was asking about the option to simply store to memory using the "Export" option.
– Tyler N
2 days ago
@TylerN I know that you asked for export, and I actually didn't know the GDAL virtual env is available from within QGIS. ...the purpose is puzzling me. make those layers available to other software?
– ThingumaBob
2 days ago
@ThingumaBob A common use case for me is to make a copy of a layer to do some edits to the attribute table. I don't necessarily want to make edits on the original data layer because I might risk overwriting/losing my original data. Also, I don't necessarily want to make a copy (or multiple copies) because it clutters up my file directory or database (after all, they are usually intermediate/temporary layers).
– Tyler N
2 days ago
add a comment |
I don't get why you are not using those temporary/virtual (memory) layers produced by e.g. the geoprocessing tools; they are, effectively, 'saved to memory'? they are pretty much exactly what you refer to: in-memory (or stored in the QGIS temp directory, kept there until deleted after saving the project), reusable in other tools in the chain and easily disposed of (cluttering only your layer panel, but that can be grouped accordingly)...or am I not getting your question? 'save to memory' is somewhat of a paradox...
– ThingumaBob
Apr 12 at 11:00
You can request a feature: issues.qgis.org.
– csk
Apr 12 at 19:50
@ThingumaBob - maybe "store to memory" is bit more accurate than "save to memory". Like you say, there is no problem storing to memory if using any of the geoprocessing tools. However, that isn't what I am trying to do. I was asking about the option to simply store to memory using the "Export" option.
– Tyler N
2 days ago
@TylerN I know that you asked for export, and I actually didn't know the GDAL virtual env is available from within QGIS. ...the purpose is puzzling me. make those layers available to other software?
– ThingumaBob
2 days ago
@ThingumaBob A common use case for me is to make a copy of a layer to do some edits to the attribute table. I don't necessarily want to make edits on the original data layer because I might risk overwriting/losing my original data. Also, I don't necessarily want to make a copy (or multiple copies) because it clutters up my file directory or database (after all, they are usually intermediate/temporary layers).
– Tyler N
2 days ago
I don't get why you are not using those temporary/virtual (memory) layers produced by e.g. the geoprocessing tools; they are, effectively, 'saved to memory'? they are pretty much exactly what you refer to: in-memory (or stored in the QGIS temp directory, kept there until deleted after saving the project), reusable in other tools in the chain and easily disposed of (cluttering only your layer panel, but that can be grouped accordingly)...or am I not getting your question? 'save to memory' is somewhat of a paradox...
– ThingumaBob
Apr 12 at 11:00
I don't get why you are not using those temporary/virtual (memory) layers produced by e.g. the geoprocessing tools; they are, effectively, 'saved to memory'? they are pretty much exactly what you refer to: in-memory (or stored in the QGIS temp directory, kept there until deleted after saving the project), reusable in other tools in the chain and easily disposed of (cluttering only your layer panel, but that can be grouped accordingly)...or am I not getting your question? 'save to memory' is somewhat of a paradox...
– ThingumaBob
Apr 12 at 11:00
You can request a feature: issues.qgis.org.
– csk
Apr 12 at 19:50
You can request a feature: issues.qgis.org.
– csk
Apr 12 at 19:50
@ThingumaBob - maybe "store to memory" is bit more accurate than "save to memory". Like you say, there is no problem storing to memory if using any of the geoprocessing tools. However, that isn't what I am trying to do. I was asking about the option to simply store to memory using the "Export" option.
– Tyler N
2 days ago
@ThingumaBob - maybe "store to memory" is bit more accurate than "save to memory". Like you say, there is no problem storing to memory if using any of the geoprocessing tools. However, that isn't what I am trying to do. I was asking about the option to simply store to memory using the "Export" option.
– Tyler N
2 days ago
@TylerN I know that you asked for export, and I actually didn't know the GDAL virtual env is available from within QGIS. ...the purpose is puzzling me. make those layers available to other software?
– ThingumaBob
2 days ago
@TylerN I know that you asked for export, and I actually didn't know the GDAL virtual env is available from within QGIS. ...the purpose is puzzling me. make those layers available to other software?
– ThingumaBob
2 days ago
@ThingumaBob A common use case for me is to make a copy of a layer to do some edits to the attribute table. I don't necessarily want to make edits on the original data layer because I might risk overwriting/losing my original data. Also, I don't necessarily want to make a copy (or multiple copies) because it clutters up my file directory or database (after all, they are usually intermediate/temporary layers).
– Tyler N
2 days ago
@ThingumaBob A common use case for me is to make a copy of a layer to do some edits to the attribute table. I don't necessarily want to make edits on the original data layer because I might risk overwriting/losing my original data. Also, I don't necessarily want to make a copy (or multiple copies) because it clutters up my file directory or database (after all, they are usually intermediate/temporary layers).
– Tyler N
2 days ago
add a comment |
3 Answers
3
active
oldest
votes
Try outputting a specific format to memory using the special "/vsimem
" virtual filesystem.
For example:
This option works and achieves what I am after. However, I still have to choose a file format, which seems to be meaningless from the end user perspective (I'm sure it's necessary from a storage/driver perspective). Also, I have to physically type "/vsimem/" which obviously isn't a big deal, but perhaps not the most ideal. Something I wonder is why vsimem isn't its own option in the "Format" dropdown (defaulting to some well known, generic format like geojson)? Probably a QGIS feature request.
– Tyler N
2 days ago
add a comment |
As a workaround, you can copy a layer to memory by running a processing tool in a way that generates an identical layer, and output the tool to [Create temporary layer].
For example, use the default $geometry
expression in the Geometry by expression tool:
Other options include:
- for polygon layers, Buffer tool with buffer distance of 0
- Translate tool with all offset distances 0
- Reproject Layer tool with Target CRS the same as the layer's current CRS
etc.
This option definitely achieves what I am after and works for me. It just requires that I rename my layer after the "dummy" geoprocessing. Ideally, I'd like to choose the name and still store to memory.
– Tyler N
2 days ago
add a comment |
Less an answer, but mere suggestions in the more flexible direction of SQL, as I personally think that the need for what you describe might be a hint to change your workflow (no offense), at least within the QGIS/PostGIS environment...
use the SQL GUI:
since you explained a common task is manipulating the attributes (without necessarily saving the results), work with theDB Manager
. Next to a full scale PostgreSQL/SpatiaLite client, theDB Manager
provides the full SpatiaLite SQL interface for all project layers.
Run queries to aggregate or analyze the attributes, stack queries to work with intermediate results, view them live in the GUI and load them as (memory) layers for further geoprocessing if needed (this works with simply copying the base layer, too).
use Virtual Layers:
similar to the features and handling from above, the Virtual Layers are flexible and multi-source instances of memory layers that are defined and manipulated with SQL.
Add a Virtual Layer, define it's sources and manipulate its data as needed, with the power of SQL just as above. Use it in further geoprocessing, save it's definition to .qlr and reuse it in other projects.
use Views:
on DB level, simply save your queries as Views and load them into QGIS.
Again, as above, you can view (no kidding) the results of queries just as with other layers, and use its 'data' in further geoprocessing, save to file or whatever. You can't and/or shouldn't edit in QGIS itself, though, without a bit of a setup in the DB.
The Virtual Layers can actually combine all these; you can add literally any data source supported in QGIS to its sources, and switch sources as needed. All these options effectively save to memory, with a name of your choice...
I work with this stack a lot, and I honestly can't remember the last time I used the export.
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%2f318555%2fhow-can-i-save-a-vector-layer-to-memory-or-is-there-a-reason-qgis-doesnt-allow%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try outputting a specific format to memory using the special "/vsimem
" virtual filesystem.
For example:
This option works and achieves what I am after. However, I still have to choose a file format, which seems to be meaningless from the end user perspective (I'm sure it's necessary from a storage/driver perspective). Also, I have to physically type "/vsimem/" which obviously isn't a big deal, but perhaps not the most ideal. Something I wonder is why vsimem isn't its own option in the "Format" dropdown (defaulting to some well known, generic format like geojson)? Probably a QGIS feature request.
– Tyler N
2 days ago
add a comment |
Try outputting a specific format to memory using the special "/vsimem
" virtual filesystem.
For example:
This option works and achieves what I am after. However, I still have to choose a file format, which seems to be meaningless from the end user perspective (I'm sure it's necessary from a storage/driver perspective). Also, I have to physically type "/vsimem/" which obviously isn't a big deal, but perhaps not the most ideal. Something I wonder is why vsimem isn't its own option in the "Format" dropdown (defaulting to some well known, generic format like geojson)? Probably a QGIS feature request.
– Tyler N
2 days ago
add a comment |
Try outputting a specific format to memory using the special "/vsimem
" virtual filesystem.
For example:
Try outputting a specific format to memory using the special "/vsimem
" virtual filesystem.
For example:
answered Apr 12 at 4:25
user2856user2856
31.1k258107
31.1k258107
This option works and achieves what I am after. However, I still have to choose a file format, which seems to be meaningless from the end user perspective (I'm sure it's necessary from a storage/driver perspective). Also, I have to physically type "/vsimem/" which obviously isn't a big deal, but perhaps not the most ideal. Something I wonder is why vsimem isn't its own option in the "Format" dropdown (defaulting to some well known, generic format like geojson)? Probably a QGIS feature request.
– Tyler N
2 days ago
add a comment |
This option works and achieves what I am after. However, I still have to choose a file format, which seems to be meaningless from the end user perspective (I'm sure it's necessary from a storage/driver perspective). Also, I have to physically type "/vsimem/" which obviously isn't a big deal, but perhaps not the most ideal. Something I wonder is why vsimem isn't its own option in the "Format" dropdown (defaulting to some well known, generic format like geojson)? Probably a QGIS feature request.
– Tyler N
2 days ago
This option works and achieves what I am after. However, I still have to choose a file format, which seems to be meaningless from the end user perspective (I'm sure it's necessary from a storage/driver perspective). Also, I have to physically type "/vsimem/" which obviously isn't a big deal, but perhaps not the most ideal. Something I wonder is why vsimem isn't its own option in the "Format" dropdown (defaulting to some well known, generic format like geojson)? Probably a QGIS feature request.
– Tyler N
2 days ago
This option works and achieves what I am after. However, I still have to choose a file format, which seems to be meaningless from the end user perspective (I'm sure it's necessary from a storage/driver perspective). Also, I have to physically type "/vsimem/" which obviously isn't a big deal, but perhaps not the most ideal. Something I wonder is why vsimem isn't its own option in the "Format" dropdown (defaulting to some well known, generic format like geojson)? Probably a QGIS feature request.
– Tyler N
2 days ago
add a comment |
As a workaround, you can copy a layer to memory by running a processing tool in a way that generates an identical layer, and output the tool to [Create temporary layer].
For example, use the default $geometry
expression in the Geometry by expression tool:
Other options include:
- for polygon layers, Buffer tool with buffer distance of 0
- Translate tool with all offset distances 0
- Reproject Layer tool with Target CRS the same as the layer's current CRS
etc.
This option definitely achieves what I am after and works for me. It just requires that I rename my layer after the "dummy" geoprocessing. Ideally, I'd like to choose the name and still store to memory.
– Tyler N
2 days ago
add a comment |
As a workaround, you can copy a layer to memory by running a processing tool in a way that generates an identical layer, and output the tool to [Create temporary layer].
For example, use the default $geometry
expression in the Geometry by expression tool:
Other options include:
- for polygon layers, Buffer tool with buffer distance of 0
- Translate tool with all offset distances 0
- Reproject Layer tool with Target CRS the same as the layer's current CRS
etc.
This option definitely achieves what I am after and works for me. It just requires that I rename my layer after the "dummy" geoprocessing. Ideally, I'd like to choose the name and still store to memory.
– Tyler N
2 days ago
add a comment |
As a workaround, you can copy a layer to memory by running a processing tool in a way that generates an identical layer, and output the tool to [Create temporary layer].
For example, use the default $geometry
expression in the Geometry by expression tool:
Other options include:
- for polygon layers, Buffer tool with buffer distance of 0
- Translate tool with all offset distances 0
- Reproject Layer tool with Target CRS the same as the layer's current CRS
etc.
As a workaround, you can copy a layer to memory by running a processing tool in a way that generates an identical layer, and output the tool to [Create temporary layer].
For example, use the default $geometry
expression in the Geometry by expression tool:
Other options include:
- for polygon layers, Buffer tool with buffer distance of 0
- Translate tool with all offset distances 0
- Reproject Layer tool with Target CRS the same as the layer's current CRS
etc.
answered Apr 12 at 18:52
cskcsk
9,9931035
9,9931035
This option definitely achieves what I am after and works for me. It just requires that I rename my layer after the "dummy" geoprocessing. Ideally, I'd like to choose the name and still store to memory.
– Tyler N
2 days ago
add a comment |
This option definitely achieves what I am after and works for me. It just requires that I rename my layer after the "dummy" geoprocessing. Ideally, I'd like to choose the name and still store to memory.
– Tyler N
2 days ago
This option definitely achieves what I am after and works for me. It just requires that I rename my layer after the "dummy" geoprocessing. Ideally, I'd like to choose the name and still store to memory.
– Tyler N
2 days ago
This option definitely achieves what I am after and works for me. It just requires that I rename my layer after the "dummy" geoprocessing. Ideally, I'd like to choose the name and still store to memory.
– Tyler N
2 days ago
add a comment |
Less an answer, but mere suggestions in the more flexible direction of SQL, as I personally think that the need for what you describe might be a hint to change your workflow (no offense), at least within the QGIS/PostGIS environment...
use the SQL GUI:
since you explained a common task is manipulating the attributes (without necessarily saving the results), work with theDB Manager
. Next to a full scale PostgreSQL/SpatiaLite client, theDB Manager
provides the full SpatiaLite SQL interface for all project layers.
Run queries to aggregate or analyze the attributes, stack queries to work with intermediate results, view them live in the GUI and load them as (memory) layers for further geoprocessing if needed (this works with simply copying the base layer, too).
use Virtual Layers:
similar to the features and handling from above, the Virtual Layers are flexible and multi-source instances of memory layers that are defined and manipulated with SQL.
Add a Virtual Layer, define it's sources and manipulate its data as needed, with the power of SQL just as above. Use it in further geoprocessing, save it's definition to .qlr and reuse it in other projects.
use Views:
on DB level, simply save your queries as Views and load them into QGIS.
Again, as above, you can view (no kidding) the results of queries just as with other layers, and use its 'data' in further geoprocessing, save to file or whatever. You can't and/or shouldn't edit in QGIS itself, though, without a bit of a setup in the DB.
The Virtual Layers can actually combine all these; you can add literally any data source supported in QGIS to its sources, and switch sources as needed. All these options effectively save to memory, with a name of your choice...
I work with this stack a lot, and I honestly can't remember the last time I used the export.
add a comment |
Less an answer, but mere suggestions in the more flexible direction of SQL, as I personally think that the need for what you describe might be a hint to change your workflow (no offense), at least within the QGIS/PostGIS environment...
use the SQL GUI:
since you explained a common task is manipulating the attributes (without necessarily saving the results), work with theDB Manager
. Next to a full scale PostgreSQL/SpatiaLite client, theDB Manager
provides the full SpatiaLite SQL interface for all project layers.
Run queries to aggregate or analyze the attributes, stack queries to work with intermediate results, view them live in the GUI and load them as (memory) layers for further geoprocessing if needed (this works with simply copying the base layer, too).
use Virtual Layers:
similar to the features and handling from above, the Virtual Layers are flexible and multi-source instances of memory layers that are defined and manipulated with SQL.
Add a Virtual Layer, define it's sources and manipulate its data as needed, with the power of SQL just as above. Use it in further geoprocessing, save it's definition to .qlr and reuse it in other projects.
use Views:
on DB level, simply save your queries as Views and load them into QGIS.
Again, as above, you can view (no kidding) the results of queries just as with other layers, and use its 'data' in further geoprocessing, save to file or whatever. You can't and/or shouldn't edit in QGIS itself, though, without a bit of a setup in the DB.
The Virtual Layers can actually combine all these; you can add literally any data source supported in QGIS to its sources, and switch sources as needed. All these options effectively save to memory, with a name of your choice...
I work with this stack a lot, and I honestly can't remember the last time I used the export.
add a comment |
Less an answer, but mere suggestions in the more flexible direction of SQL, as I personally think that the need for what you describe might be a hint to change your workflow (no offense), at least within the QGIS/PostGIS environment...
use the SQL GUI:
since you explained a common task is manipulating the attributes (without necessarily saving the results), work with theDB Manager
. Next to a full scale PostgreSQL/SpatiaLite client, theDB Manager
provides the full SpatiaLite SQL interface for all project layers.
Run queries to aggregate or analyze the attributes, stack queries to work with intermediate results, view them live in the GUI and load them as (memory) layers for further geoprocessing if needed (this works with simply copying the base layer, too).
use Virtual Layers:
similar to the features and handling from above, the Virtual Layers are flexible and multi-source instances of memory layers that are defined and manipulated with SQL.
Add a Virtual Layer, define it's sources and manipulate its data as needed, with the power of SQL just as above. Use it in further geoprocessing, save it's definition to .qlr and reuse it in other projects.
use Views:
on DB level, simply save your queries as Views and load them into QGIS.
Again, as above, you can view (no kidding) the results of queries just as with other layers, and use its 'data' in further geoprocessing, save to file or whatever. You can't and/or shouldn't edit in QGIS itself, though, without a bit of a setup in the DB.
The Virtual Layers can actually combine all these; you can add literally any data source supported in QGIS to its sources, and switch sources as needed. All these options effectively save to memory, with a name of your choice...
I work with this stack a lot, and I honestly can't remember the last time I used the export.
Less an answer, but mere suggestions in the more flexible direction of SQL, as I personally think that the need for what you describe might be a hint to change your workflow (no offense), at least within the QGIS/PostGIS environment...
use the SQL GUI:
since you explained a common task is manipulating the attributes (without necessarily saving the results), work with theDB Manager
. Next to a full scale PostgreSQL/SpatiaLite client, theDB Manager
provides the full SpatiaLite SQL interface for all project layers.
Run queries to aggregate or analyze the attributes, stack queries to work with intermediate results, view them live in the GUI and load them as (memory) layers for further geoprocessing if needed (this works with simply copying the base layer, too).
use Virtual Layers:
similar to the features and handling from above, the Virtual Layers are flexible and multi-source instances of memory layers that are defined and manipulated with SQL.
Add a Virtual Layer, define it's sources and manipulate its data as needed, with the power of SQL just as above. Use it in further geoprocessing, save it's definition to .qlr and reuse it in other projects.
use Views:
on DB level, simply save your queries as Views and load them into QGIS.
Again, as above, you can view (no kidding) the results of queries just as with other layers, and use its 'data' in further geoprocessing, save to file or whatever. You can't and/or shouldn't edit in QGIS itself, though, without a bit of a setup in the DB.
The Virtual Layers can actually combine all these; you can add literally any data source supported in QGIS to its sources, and switch sources as needed. All these options effectively save to memory, with a name of your choice...
I work with this stack a lot, and I honestly can't remember the last time I used the export.
answered 18 hours ago
ThingumaBobThingumaBob
6,5301424
6,5301424
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%2f318555%2fhow-can-i-save-a-vector-layer-to-memory-or-is-there-a-reason-qgis-doesnt-allow%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
I don't get why you are not using those temporary/virtual (memory) layers produced by e.g. the geoprocessing tools; they are, effectively, 'saved to memory'? they are pretty much exactly what you refer to: in-memory (or stored in the QGIS temp directory, kept there until deleted after saving the project), reusable in other tools in the chain and easily disposed of (cluttering only your layer panel, but that can be grouped accordingly)...or am I not getting your question? 'save to memory' is somewhat of a paradox...
– ThingumaBob
Apr 12 at 11:00
You can request a feature: issues.qgis.org.
– csk
Apr 12 at 19:50
@ThingumaBob - maybe "store to memory" is bit more accurate than "save to memory". Like you say, there is no problem storing to memory if using any of the geoprocessing tools. However, that isn't what I am trying to do. I was asking about the option to simply store to memory using the "Export" option.
– Tyler N
2 days ago
@TylerN I know that you asked for export, and I actually didn't know the GDAL virtual env is available from within QGIS. ...the purpose is puzzling me. make those layers available to other software?
– ThingumaBob
2 days ago
@ThingumaBob A common use case for me is to make a copy of a layer to do some edits to the attribute table. I don't necessarily want to make edits on the original data layer because I might risk overwriting/losing my original data. Also, I don't necessarily want to make a copy (or multiple copies) because it clutters up my file directory or database (after all, they are usually intermediate/temporary layers).
– Tyler N
2 days ago