Skip to main content
6 of 7
added 248 characters in body
Pertinax
  • 145
  • 1
  • 6

How can one solve the "Handle Unavailable Layers" error on a csv file in QGIS?

I've been working on this project for over a year and I have never had any substantial problem. Two days ago I was working on the project and everything worked fine. Today, when I try to load the project, I get the following:

enter image description here The content of "Datasource" in this screenshot is file:../../../Articles/[Some folder name]/[some file name].csv?type=csv&delimiter=%5Ct;&detectTypes=yes&xField=longitude&yField=latitude&crs=EPSG:4326&spatialIndex=no&subsetIndex=no&watchFile=no

The layer in question depicts points on my map. If I click on "Keep Unavailable Layers" and hover my mouse over the layer in question in the layers pane, I get the following message: Unavailable layer! Layer data source could not be found. Click to select a new data source.

enter image description here

I click and select the exact same data source, i.e. I "remind" QGIS where the .csv file is located, but then almost nothing seems to happen, apart from the layer's symbol changing from three dots to a cute cinderblock. The points on my map do not come back. enter image description here I am certain that neither the .qgs project file nor the .csv have been moved. Nor have I updated my operating system. The problem surfaced with QGIS 3.10 running on MacOS 11.1 (Big Sur), but I have tried with QGIS 3.16 too and I get the same error. The source file is readable by QGIS, because I can create a new layer with the same csv file and it works.

Why is this happening? How can I get my layer back?

Edit: If I try to copy the style (Styles > Copy Style > All styles categories) of the cinderblock layer to a newly created layer with the same source file (Styles > Paste style > All styles), I get the following error:

enter image description here

But if I copy the style before the old layer becomes a cinderblock (i.e. before clicking "click here to select a new data source"), I do get back my old points...

enter image description here ...but I don't get back the callout lines (the lines between the labels and the points). Before the problem, it looked like this (from a PDF file):

enter image description here

If I try to zoom in on this region in QGIS...

enter image description here

...I get this: enter image description here

Meanwhile the callouts on the new layer are defined like this (it used to say 0 mm of minimum length, I changed it to 3mm to no avail, nothing changes).

enter image description here

Pertinax
  • 145
  • 1
  • 6