<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">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>