Bug report #6369
vsizip - relative paths not used & can't update path in "missing layers" dialogue
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||end of life|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||15633|
- enable relative save paths in the project settings
- load some layers from a zip file
- save the project in the same folder as the zip file
- rename the folder
- open the project
You will get the dialogue asking you to specify the paths of the "missing" layers.
- open the project file in a text editor and change the paths used for the vsizip layers to relative paths.
- open the project
The layers will still be "missing", so it seems the vsizip driver does not support relative paths.
Problem 1: the vsizip layer driver should ideally support relative save paths. (N.B. I'm testing on a Windows system and I can get the vsizip functionality to work with ogrinfo and gdalinfo in a terminal with either absolute or relative paths, but I can't figure out how to get it to work in an msys terminal with absolute paths...)
Problem 2: in the dialogue asking you to specify the paths to "missing" layers, if you correct the "path" for the vsizip layer, the dialogue doesn't recognise it as valid - it only recognises a simple path.
N.B. there are other issues with the dialogue, e.g. even if the path to a layer referred to a folder (instead of a file), the fileselector only allows you select a file (not a folder). But you can manually type the path to a folder and the dialogue correctly recognises it as valid.
#1 Updated by Donovan Cameron almost 7 years ago
I can confirm this is still the case in QGIS 2.0.1
Especially that vsizip datasets can't be repaired when asking to correct missing layers by either navigating to the zip file or manually adjusting the path to either absolute or relative.
Any broken VSIZIP datasets have to be re-added, styled and labelled.
#4 Updated by Donovan Cameron almost 7 years ago
- Status changed from Closed to Reopened
I applied this patch to QGIS 2.0.1 and still unable to update vsizip paths. I can navigate to the zip file, highlight it and select OK. But when I click OK to close the fix data sources window it still complains about some layers that will be lost.
It also enters the new zip path with an absolute path instead of a relative one - but even after coming in "green" the dialog still warns of missing un-referenced layers.
#7 Updated by Alister Hood almost 5 years ago
"Problem 1" from my initial report is fixed.
"Problem 2" is partially fixed - if you manually edit the path it is accepted, but as Donovan noted at #4 if you use the "Browse" button it does not work. The reason it does not work is because after using the browse button this is stripped from the front of the path:
Donovan also pointed out that the browse button replaces the relative path with an absolute path, but note that this is only an annoyance - when the project is saved it will be saved as a relative path.
#10 Updated by Giovanni Manghi over 1 year ago
- Resolution set to end of life
- Status changed from Open to Closed
End of life notice: QGIS 2.18 LTR