[Qgis-user] Themes, visibility, layout, report, atlas and Layer ID vs Layer name

Charles Dixon-Paver charles at kartoza.com
Thu Aug 19 11:22:54 PDT 2021


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:

QgsProject.instance().mapLayersByName('World Map')[0].id()

On Thu, 19 Aug 2021 at 17:15, Jésahel Benoist <djes1975 at gmail.com> wrote:

> Hello all,
>
> 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.
>
> 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.
>
> 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.
>
> 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.
>
> 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.
>
> 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
> ?
>
> Best regards to all,
>
> Jésahel
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210819/560c34d3/attachment.html>


More information about the Qgis-user mailing list