1

This is getting worse... I created a project with about 6 vector layers (which I digitised) with some raster tiles. It is stored locally on my Windows 7 PC, running QGIS 2.0

The project was fine until I came to open it yesterday, when I got the Bad Layers dialogue. Entering the correct paths does not fix it.

I've opened up various iterations of this project I had made, and my backups & they're all broken. Some I definitely experimented with Tools/Scripts (IRO my other post), but I don't think I had in the earlier ones. One of these projects' "bad layers" is a temp output from a tool.

Not sure if the time coincides, but the list of Recent Projects has reverted to that of some weeks ago. I did a System Restore, which assured me my data was safe, but as I'm investigating, it suggests this is the culprit - if the temporary file in AppData has gone that would trip it up.

Where is the "recently used files" list - is that in AppData too? (this is less of a problem, just a possible clue to the above)

I've skimmed the .qgs file in Notepad++ to see if I could identify these layers, but can't work it out. Can this be edited like the old ArcView .apr files?

user3418765
  • 609
  • 1
  • 5
  • 15

2 Answers2

2

You can surely edit your .qgs project file in Notepad++, but you have to restore the data that was in temp folders anyway. If you can't get it working again, start a new project and add the layers from source. You can then compare the structure of the two project files. This might prevent you from doing the styling again (if that was much work).

I suggest to save everything important always in tif, shapefiles or spatialite databases to avoid such mess.

The recently used files list should only contain project files, not the data sources you are missing.

AndreJ
  • 76,698
  • 5
  • 86
  • 162
  • Thanks, yes there is quite a lot of styling that I was hoping to to not have to re-do. In comparing the project structure, can I just copy styling text over? – user3418765 Apr 05 '14 at 07:07
  • If you find the data sources (or you can recreate them), you can replace them in the original project file manually. I think that is easier than copying the style. But you can make a backup and try both. – AndreJ Apr 05 '14 at 07:08
  • I think those layers have been swept away & are irrecoverable - but I don't need those. I've found one on the QGS file - I can't just delete that? – user3418765 Apr 05 '14 at 07:10
  • I know the recently used list is projects, but why has it changed to earlier projects - I assume the System Restore? – user3418765 Apr 05 '14 at 07:10
  • 1
    Yes, system restore might overwrite that. It could be somewhere in the registry. - The Handle Bad Layers dialogue should delete unrecovered layers, that should equal deleting it from the project file. After saving, the project should open normally. – AndreJ Apr 05 '14 at 07:12
  • Andre, This gets even worse: Started a clean project and added the rasters OK, tried to add the vector layers & I get a red message that they are not "valid or recognised data source". Any ideas as this was a fair amount of work? – user3418765 Apr 05 '14 at 07:36
  • Just tried ArcMap-error opening feature class & GVSig wouldn't open them: they're screwed. But why? I don't think this is the System Restore as it was 3 days ago & this happened since then. – user3418765 Apr 05 '14 at 07:43
  • The SHX files have gone. Any ideas? – user3418765 Apr 05 '14 at 07:46
  • The shx is essential for shapefiles. It connects the attribute data in dbf with the geometry in shp. I think you have to recreate those shapefiles. – AndreJ Apr 05 '14 at 08:45
  • http://forums.esri.com/Thread.asp?c=93&f=982&t=136771 and http://gis.stackexchange.com/questions/7809/corrupt-shapefile-how-to-fix gives some insight. – AndreJ Apr 05 '14 at 08:48
  • Andre, I'll look at those. Your help is very much appreciated. – user3418765 Apr 05 '14 at 09:35
  • I had Shapefile Checker but it truncated them with only a few features, so no-go there. I might look at Bill Huber's suggestion later in the week. Right now I need this map & have restored the previous folder version which, I think, doesn't leave me too much work. I am somewhat concerned though as to what happened to these shapefiles – user3418765 Apr 05 '14 at 18:58
0

Resolved this after it happened again. Nothing to do with the "recently used files": It seems that System Restore removes the SHX files...despite Windows assuring that my data will be safe...

As mentioned in this discussion: http://forums.esri.com/Thread.asp?c=93&f=986&t=129364

I was able to recover a previous version of the folder (useful tool in Windows 7). Hope this helps someone else.

user3418765
  • 609
  • 1
  • 5
  • 15