1

I am currently learning to use PyQGIS, when loading a shapefile I get a warning message "The SRC is not defined", but I do not know what to do to prevent that message from appearing.

Warning message

1

If you want the message gone when you load your layer, you could use:

qgis.utils.iface.messageBar().clearWidgets(). 

Also, if you go to Settings > Options > CRS > CRS for new layers, you could choose which CRS to use for new layers or those without a CRS. This should also avoid the pop-up message from appearing.

Finally, it could save you some hassle if you ensure that your shapefile contains a .prj file associated with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.