Hi Devs,

Came across the following message while opening a QGIS project with more than 300 layers:

Problem is that I could not find which layer posed problem!

I've tried a little python script, below, to show the crs of all layers, but it turned out that most of them did not have an intrinsic crs but a QGIS set crs (in the QGZ file). So the script failed on those layers, and I was left to go one layer by one layer to find the only one with no intrinsic or explicit crs: the one generating the error message.

It would be most useful to get the name of the offending layer in the message.

Even the log did not help, merely repeating the same message!

for layer in iface.layerTreeView().selectedLayers():
    # Get EPSG code from layer's CRS
    dp = layer.dataProvider()
    thecrs = dp.crs()
    epsg = thecrs.authid()[5:]
    # Generate crs suffix for layer name
    suff = ' (' + epsg + ')' if epsg.strip() != '' else crstip
    print(suff)

Thanks for this great piece of software.

Regards,
Benoit de Cabissole


_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to