I can&#39;t say it&#39;s best practice but I have done it before.  You will need remove the legendlayer and use the layerid= to find any links to that legend item ie maplayer.  You will also need to change the &quot;projectlayers layercount=&quot;83&quot;&quot;<div>

<br></div><div>I have cc&#39;d this to the developer mailing list in case someone on there knows something that might help, before you start hacking away at things.</div><div><br></div><div>- Nathan <br><br><div class="gmail_quote">

On Tue, Oct 11, 2011 at 11:48 PM, Purves Ross <span dir="ltr">&lt;<a href="mailto:rmpurves@ntlworld.com" target="_blank">rmpurves@ntlworld.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Great suggestion. Thank you. I&#39;m guessing you mean manually remove a whole &lt;maplayer&gt; tag at a time and reduce the total layers count in the XML file, right? Is the XML project file structure robust enough to allow me to manually &#39;hack&#39; the file like this?<br>



<br>Thanks again!<br>Cheers<br><font color="#888888">Ross</font><div><div></div><div><br><br><br><div class="gmail_quote">On 11 October 2011 14:45, Nathan Woodrow <span dir="ltr">&lt;<a href="mailto:madmanwoo@gmail.com" target="_blank">madmanwoo@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Very strange.  The only thing I can think of at this time is take a backup of your project and remove each layer one by one resaving and opening the project each time to see if taking one out loads.<div><br></div><div>See how you go with that.</div>





<div><br></div><div><font color="#888888">- Nathan </font><div><div></div><div><br><br><div class="gmail_quote">On Tue, Oct 11, 2011 at 11:33 PM, Purves Ross <span dir="ltr">&lt;<a href="mailto:rmpurves@ntlworld.com" target="_blank">rmpurves@ntlworld.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">

Hi Nathan,<br><br>OK - even more strange. This string does not appear in my project file at all. I checked in a text editor and grepped to be absolutely sure.<div><div></div><div><br><br><div class="gmail_quote">

On 11 October 2011 14:20, Nathan Woodrow <span dir="ltr">&lt;<a href="mailto:madmanwoo@gmail.com" target="_blank">madmanwoo@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Can you search the xml in the project file for <span style="border-collapse:collapse;color:rgb(34, 34, 34);font-family:arial,sans-serif;font-size:13px">VectorBackgroundMapMarch2011 and post each line it is mentioned on.  The only time QGIS will throw the Data Source is invaild error is in the ogr provider and somehow it is trying to load your project as a layer which it then bombs on.</span><div>









<font color="#222222" face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><div><font color="#888888"><div class="gmail_quote">- Nathan</div></font><div><div></div><div><div class="gmail_quote">









<br></div><div class="gmail_quote">On Tue, Oct 11, 2011 at 11:10 PM, Nathan Woodrow <span dir="ltr">&lt;<a href="mailto:madmanwoo@gmail.com" target="_blank">madmanwoo@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">









Very strange indeed. <div><br></div><div><font color="#888888">- Nathan</font><div><div></div><div><br><br><div class="gmail_quote">On Tue, Oct 11, 2011 at 10:59 PM, Purves Ross <span dir="ltr">&lt;<a href="mailto:rmpurves@ntlworld.com" target="_blank">rmpurves@ntlworld.com</a>&gt;</span> wrote:<br>










<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">OK, thanks for the tip re file number! Fingers crossed it&#39;s not that though.<br><br>Sorry - now I get you. You mean can I load the layer called &#39;VectorBackgroundMapMarch2011&#39; in its own right into a fresh project, right? Here&#39;s the rub - and also why I was confused by your question - there&#39;s no apparent layer with that name in the project! That&#39;s the name of the overall .qgs file, not a layer within it. Seems strange?<br>











<br>Many thanks!<br><font color="#888888">Ross</font><div><div></div><div><br><br><br><br><div class="gmail_quote">On 11 October 2011 13:53, Nathan Woodrow <span dir="ltr">&lt;<a href="mailto:madmanwoo@gmail.com" target="_blank">madmanwoo@gmail.com</a>&gt;</span> wrote:<br>










<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div>I recall hearing about a bug where layers fail to load if there is a certain number of files in the project but this might be something unrelated.</div><div><br></div>I mean can you load <font color="#500050" face="arial, sans-serif"><span style="border-collapse:collapse">/mnt/bunker/ross/Research/PhD/</span></font><font color="#500050" face="arial, sans-serif"><span style="border-collapse:collapse">NewMapMarch2011/</span></font><font color="#500050" face="arial, sans-serif"><span style="border-collapse:collapse">VectorBackgroundMapMarch2011 in QGIS on it&#39;s own in a fresh</span></font><font color="#500050" face="arial, sans-serif"><span style="border-collapse:collapse"> project.</span></font><div>













<font color="#500050" face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><div><font color="#888888"><font color="#500050" face="arial, sans-serif"><span style="border-collapse:collapse">- Nathan<br>













</span></font></font><div><div></div><div><br><div class="gmail_quote">On Tue, Oct 11, 2011 at 10:51 PM, Purves Ross <span dir="ltr">&lt;<a href="mailto:rmpurves@ntlworld.com" target="_blank">rmpurves@ntlworld.com</a>&gt;</span> wrote:<br>











<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">

Hi Nathan,<br><br>OK - by counting the number of occurances of &#39;&lt;maplayer&#39; in the project file, I count 50 layers. Sounds a lot but there were no problems in 1.6 with this number!<br><br>Sorry to be stupid, not sure what you mean by load the file by itself. Are you saying that there is a way of selectively loading layers on opening a QGIS project file? Or do you mean opening the file in a text editor or something. If the latter, then it certainly loads the XML OK and there&#39;s no evidence that the file is corrupted.<br>














<br>Thanks again for the help!<br>Cheers<br><font color="#888888">Ross</font><div><div></div><div><br><br><div class="gmail_quote">On 11 October 2011 13:44, Nathan Woodrow <span dir="ltr">&lt;<a href="mailto:madmanwoo@gmail.com" target="_blank">madmanwoo@gmail.com</a>&gt;</span> wrote:<br>














<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">How many layers do you have in this project file?  And can you load the file by itself?<div>




<br></div><div><font color="#888888">- Nathan</font><div><div></div><div><br><br><div class="gmail_quote">On Tue, Oct 11, 2011 at 10:35 PM, Ross Purves <span dir="ltr">&lt;<a href="mailto:RMP@lutonsfc.ac.uk" target="_blank">RMP@lutonsfc.ac.uk</a>&gt;</span> wrote:<br>
















<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">Hi Nathan,<br>
<br>
Very many thanks for the quick response! OK, running from the command line gives me slight more info, to be sure:<br>
<br>
[Tue Oct 11 13:34:26 RMPT43:NewMapMarch2011 ]$ qgis VectorBackgroundMapMarch2011<br>
Warning: loading of qgis translation failed [/usr/share/qgis/i18n//qgis_en_GB]<br>
Warning: loading of qt translation failed [/usr/share/qt4/translations/qt_en_GB]<br>
Warning: Couldn&#39;t load Python support library: Cannot load library /usr/lib/qgispython: (/usr/lib/libqgispython.so: cannot open shared object file: No such file or directory)<br>
Critical: Data source is invalid<br>
Critical:<br>
<br>
Additionally, when I start QGIS this way I get a pop up window within the graphical interface that says:<br>
<br>
The layer /mnt/bunker/ross/Research/PhD/NewMapMarch2011/VectorBackgroundMapMarch2011 is not a valid layer and can not be added to the map<br>
<br>
The strange thing is that I&#39;m pretty certain there is no problem with the project file. It&#39;s timestamp reads 22 April, when I last worked on it. I.e. the version of QGIS has changed but my file has remained constant.<br>

















<br>
Many thanks!<br>
Ross<br>
________________________________________<br>
From: Nathan Woodrow [<a href="mailto:madmanwoo@gmail.com" target="_blank">madmanwoo@gmail.com</a>]<br>
Sent: 11 October 2011 13:26<br>
To: Purves Ross<br>
Cc: <a href="mailto:qgis-user@lists.osgeo.org" target="_blank">qgis-user@lists.osgeo.org</a><br>
Subject: Re: [Qgis-user] QGIS 1.6 project causing 1.7 to crash<br>
<div><br>
Hi Ross,<br>
<br>
That sounds a bit strange.  Can you start QGIS from the terminal and see what the output is when it locks up.<br>
<br>
- Nathan<br>
<br>
</div><div>On Tue, Oct 11, 2011 at 10:19 PM, Purves Ross &lt;<a href="mailto:rmpurves@ntlworld.com" target="_blank">rmpurves@ntlworld.com</a>&lt;mailto:<a href="mailto:rmpurves@ntlworld.com" target="_blank">rmpurves@ntlworld.com</a>&gt;&gt; wrote:<br>

















Hi there,<br>
<br>
I&#39;ve updated my Ubuntu 10.10 installation to use QGIS 1.7. I put a lot of work into a project using QGIS 1.6 but it won&#39;t open in 1.7. The layers all appear but then the screen freezes as though QGIS is rendering the resulting map forever.<br>

















<br>
A bit of googling revealed that there was a bug at some point which required the placement of &#39;gdal&#39; between all &lt;provider&gt;&lt;/provider&gt; tags in the project XML file in a scenario like this. However, I tried this and it didn&#39;t work. I also have read various posts that say the use of &#39;on the fly&#39; project appeared to cause problems going between 1.6 and 1.7. The project in question does indeed use on the fly projection.<br>

















<br>
As a final note, I have an ECW raster layer in this map that requires the modified GDAL to work. I thought that the crash might be to do with the upgrade having removed my modified version of GDAL. I therefore recompiled it all and have checked to see that my version of 1.7 can now read ECW files and it can (when they are presented a a fresh layer and not as part of the problematic project).<br>

















<br>
This is a really, really important project to me and I do need to get it back if at all possible. Please can anyone help?<br>
<br>
Very many thanks!<br>
Ross Purves<br>
<br>
_______________________________________________<br>
Qgis-user mailing list<br>
</div><a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>&lt;mailto:<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>&gt;<br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br>
</div>