<div dir="ltr"><div dir="ltr"><div>Jesahel, <br></div><div>This may be something you already do and I don't know if this would save you any time but I often set up project variables in situations where I am using a layer across many expressions or layouts. Project>Properties>Variables <br></div><div>For example when I am referencing a DEM in expression over and over I create a variable DEM and set to to the layer ID e.g.  'DEM_d44338fa_1bf5_4ea6_b58e_7489ea8b28a8' and then in my expression reference @DEM in my expressions. While it is still a little annoying to have to change the variable when I change the DEM I only have to change it in one place. <br></div></div><div>-Bas</div><div><br></div><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Aug 19, 2021 at 2:23 PM Charles Dixon-Paver <<a href="mailto:charles@kartoza.com">charles@kartoza.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I would imagine there are just far too many projects and use cases where the same layer name is used for multiple layers. Saving and loading themes etc is a feature request I imagine. Copying styles between layers is supported (and you can save style and layer definitions). I imagine most issues can be resolved by just using an expression based id wherever possible, with something like this:<div><br></div><div><span style="font-family:monospace">QgsProject.instance().mapLayersByName('World Map')[0].id()</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 19 Aug 2021 at 17:15, Jésahel Benoist <<a href="mailto:djes1975@gmail.com" target="_blank">djes1975@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello all,<div><br></div><div>QGIS is now my favorite everyday tool. Anyway, there's something that is a real pain in the ass, the choice to use layer ID instead of layer name in layouts/reports/atlas/themes.<div><br></div><div>First, let me explain that I have a lot of layers so I'm using groups, I import/export needed groups with layers definition files and I'm often using the name to track the versions between projects.<br></div></div><div><br></div><div>At this stage, one bad thing is that deleting a layer and reloading is changing its ID and so... All layouts/reports/atlas need to be corrected. So I'm not deleting anymore groups/layers but instead have more dedicated projects, and I have created some scripts and plugins to alter existing layers, and loads/saves styles in DB. Fine but not easy for everybody and needs to correct more projects when needed.</div><div><br></div><div>Today I discovered that themes are also based on layers ID... But there isn't any way to load/save themes configuration. How to know what was the theme configuration before a change ? Only by peeking around in the project file or some python. But even with a save/load feature, when a modification occurs, all projects need to be corrected.</div><div><br></div><div>Well, as you can see, for some years that I've been working with QGIS, its use of the layer ID instead of layer name is clearly the most annoying thing in this great software. I think that is also a reason for some features not to be created. </div><div><br></div><div>I imagine that this is low level and needs a lot of modifications so I'm not asking for a change now. But could a discussion about this be initiated ?</div><div> </div><div>Best regards to all,</div><div><br></div><div>Jésahel</div><div><br></div></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div></div></div>