Bug report #13873
"build virtual vector": file created fails to load correctly
|Affected QGIS version:||2.12.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||21896|
When opening such file:
1. The user is asked to select the layers (as when drag&drop a folder or a zip file). The tool should just open the layers as a single layer.
2. Once the layers have been selected, QGIS adds them to the Layer pane, all of them, rather than a single virtual layer.
3. Although the XML file created by the tool seems correct what QGIS does is opening the same one layer multiple times. This has happened when the file name is identical to all vector tiles (stored in different folders).
Is this tool meant to work the same way 'build virtual raster' does? If that can be achieved it would make mine and many other user's tasks much much easier.
#2 Updated by Luigi Pirelli over 5 years ago
This tool was introduced to override a problem using gdal/ogr commands that accept only a single filename as input. Were not possibile to pass a multiple list of files.
The virtual layer would be a collection of layer. So probably it works correctly with this point of view.
btw, I'll be with the person who commited this feature next week... I hope he can add some more comments here
#5 Updated by Armando Forlani over 5 years ago
- Status changed from Closed to Reopened
I somehow failed to spot the previous update: to feedback. My apologies. I propose to reopen this request. Feel free to close it again but I would appreciate some help in formulate a new feature request should there be the need to do so. I am unable to log in my work system right now. I hope to shed some light on this from memory.
If any of you are familiar with MI Pro proprietary seamless table then you should know what I mean. MI makes use of a seamless table (contains references to all the other tables) to open multiple tiles (either raster or vector), as far as the user is concerned, to the user it all appears as a single layer.
QGIS does this perfectly with Virtual Raster type of "layer" (.vrt), created by the Build Virtual Raster tool. The raster tiles appear as a single layer.
Build Virtual Vector does not seem to behave the same way: 1) all layers are listed in the Layers pane (with 100s of tiles it can be a problem, virtual raster seems more elegant in this respect); 2) it seems it uses resources to open all the layers even if not with the canvas extent (virtual raster only loads what is necessary, I think); and 3) depending on the folder structure this doesn't always work (details on this soon).
I'll offer details on all of this as soon as I can.
#6 Updated by Alexander Bruy over 5 years ago
Armando Forlani wrote:
1) all layers are listed in the Layers pane (with 100s of tiles it can be a problem, virtual raster seems more elegant in this respect);
This is not a bug. OGR Virtual Datasource has two modes: first when each layer acts as individual sublayer (this is how it works now) and so-called "union" layer when it represents concatenation of input layers (this is what you asked for, if I understand correctly). There is already feature request about this, see #12991
2) it seems it uses resources to open all the layers even if not with the canvas extent (virtual raster only loads what is necessary, I think);
Didn't tested yet, but maybe this is because currently tool does not create "union" layer. If even "union" layer opens all files, instead of opening only those withing canvas extent, than QGIS has nothing to do here. It is better to ask in GDAL mailing list about it then.
3) depending on the folder structure this doesn't always work (details on this soon).
More details needed to reproduce this.
I suggest to close this ticket and open new issues/feature request for each problem.
#7 Updated by Armando Forlani over 5 years ago
1) Agree. Feature request #12991 should achieve the outcome I am after.
3) Faced with vector tiles (Ordnance Survey MasterMap file system are supplied in tiles) supplied in the following folders structure:
├ parent folder
│ ├ child folder1
│ │ └ vector1
│ ├ child folder2
│ │ └ vector2
QGIS 2.12.0 on Windows7, where vector1 and vector2 have the same file name and extension. Files are "collected" by using windows file explorer's search box (called by 'Select from file system' button on the Batch Processing feature of 'Build virtual vector') and searching *.shp from parent folder, then selecting from resulting list of files. Build Virtual Vector uses vector1 twice and ignores vector2.
Ignoring point 1 and 2, which #12991 seems to address, I agree to close this issue and open a new one covering point 3 (unless I am the only one experiencing this issue, in which case perhaps I wouldn't bother opening an issue at all).
#9 Updated by Armando Forlani over 5 years ago
- Status changed from Reopened to Closed
Point 1. and 2. are not really issues, as explained by Alexander and Luigi. I will raise this as a feature request i.e. for an equivalent tool of Build Virtual Raster for vectors.
Point 3. has now been raised as a new issue: #14374