Bug report #11214

Symlinks added as layer sources: QGIS unexpectedly rewrites source location as target rather than symlink

Added by Adam Colligan about 10 years ago. Updated over 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Project Loading/Saving
Affected QGIS version:2.4.0 Regression?:No
Operating System:Ubuntu Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:19524

Description

Behavior:

A symlink to a source file (such as a raster image) can easily be added as a layer to a QGIS project. In layer properties, the location of the symlink appears as the data source.

If another program or script rewrites the symlink file to give it a different target, QGIS updates smoothly. Refreshing the map display results in the new target appearing with the same properties/symbology applied. This is true whether the project has been saved or not.

However, qgis does not write the symlink location as the layer's data source in the .qgis file that is saved. Rather, it writes the target file name. Therefore, when the project is closed and reopened, the symlink is cut out of the process. The layer properties dialog is now changed to show the data source as a back-end target file (not sure if the original one or the last one referenced by the symlink).

Expected behavior:
QGIS should save the location of a symlink file if the symlink file is what was added as the layer source.

Alternately, if QGIS is going to continue to write target locations rather than symlink locations to the .qgis file, the target location should immediately appear in layer properties. However, this will also be deceptive during the current session while the map is continuing to update from the symlink.

Use case:
I have a large set of radar imagery whose filenames are timestamps. A script creates a folder of symlinks such that a symlink called "0" references the newest radar image, "1" references the image 5 minutes older than that, and so forth.

As long as QGIS is reading from the symlinks, it will dynamically update with the latest radar image. I can also very easily create loops of, say, the last hour or the last 24 hours of radar without having to alter anything manually.

Unfortunately, this currently is only possible if I either (a) never close and reopen the .qgis file, or (b) continuously delete and create duplicate copies of underlying data files with dynamically-changing names.

History

#1 Updated by Giovanni Manghi over 7 years ago

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

#2 Updated by Giovanni Manghi over 5 years ago

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

Also available in: Atom PDF