How can I delete custom CRS by PyQGIS?
My not working solution is:
my_crs = QgsCoordinateReferenceSystem()
my_crs.createFromProj4("+proj=aea +lat_1=21 +lat_2=49 +lat_0=37 +lon_0=87 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs")
my_crs.saveAsUserCrs("my custom CRS")
Object QgsCoordinateReferenceSystem
not contains any method for deleting created CRS:
dir(my_crs)
['CrsType', 'EpsgCrsId', 'Format', 'FormatProj', 'FormatWkt', 'FullString', 'IdentifierType', 'InternalCrsId', 'MediumString', 'PostgisCrsId', 'ShortString', 'WKT1_ESRI', 'WKT1_GDAL', 'WKT2_2015', 'WKT2_2015_SIMPLIFIED', 'WKT2_2018', 'WKT2_2018_SIMPLIFIED', 'WKT2_2019', 'WKT2_2019_SIMPLIFIED', 'WKT_PREFERRED', 'WKT_PREFERRED_GDAL', 'WKT_PREFERRED_SIMPLIFIED', 'WktVariant', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'authid', 'bounds', 'createFromId', 'createFromOgcWmsCrs', 'createFromProj', 'createFromProj4', 'createFromSrid', 'createFromSrsId', 'createFromString', 'createFromUserInput', 'createFromWkt', 'description', 'ellipsoidAcronym', 'findMatchingProj', 'fromEpsgId', 'fromOgcWmsCrs', 'fromProj', 'fromProj4', 'fromSrsId', 'fromWkt', 'geographicCrsAuthId', 'hasAxisInverted', 'invalidateCache', 'isGeographic', 'isValid', 'mapUnits', 'postgisSrid', 'projectionAcronym', 'pushRecentCoordinateReferenceSystem', 'readXml', 'recentCoordinateReferenceSystems', 'recentProjections', 'saveAsUserCrs', 'setValidationHint', 'setupESRIWktFix', 'srsid', 'staticMetaObject', 'syncDatabase', 'toProj', 'toProj4', 'toWkt', 'userFriendlyIdentifier', 'validSrsIds', 'validate', 'validationHint', 'writeXml']
In QGIS is deleting very simple:
iface
, but this is just an assumption. I think he knows: @BenW