Bug report #6369

vsizip - relative paths not used & can't update path in "missing layers" dialogue

Added by Alister Hood over 11 years ago. Updated about 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Project Loading/Saving
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

Description

- 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 dos terminal with either absolute or relative paths, but I can't figure out how to get it to work in an msys rxvt 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.

Associated revisions

Revision 4a75a95a
Added by Etienne Tourigny over 10 years ago

fix project saving and reading of vsizip paths (fixes #6369)

Revision accd06dc
Added by Jürgen Fischer over 10 years ago

Merge pull request #1032 from etiennesky/vsifile-relative

fix project saving and reading of vsizip paths (fixes #6369)

History

#1 Updated by Donovan Cameron over 10 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.

#2 Updated by Etienne Tourigny over 10 years ago

I am the author of this functionality and I'll try look into this eventually...

#3 Updated by Jürgen Fischer over 10 years ago

  • Status changed from Open to Closed

#4 Updated by Donovan Cameron over 10 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.

#5 Updated by Jürgen Fischer almost 9 years ago

  • Category changed from Data Provider to Project Loading/Saving

#6 Updated by Médéric RIBREUX over 8 years ago

  • Status changed from Reopened to Feedback

Hello, bug triage...

this seems to be fixed in QGIS 2.13 and probably in 2.12.1. Can you confirm ?

#7 Updated by Alister Hood over 8 years ago

No.
"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: /vsizip/
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.

#8 Updated by Giovanni Manghi over 8 years ago

  • Status changed from Feedback to Open

#9 Updated by Giovanni Manghi almost 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#10 Updated by Giovanni Manghi about 5 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF