Sorry. I was in a mistake:
The current CRS is get by authid() method, not geographicCRSAuthId()
On the other hand, I wanted to avoid the CRS Dialog when I load a vector layer from pyQGIS.
Similar questions are been asked here and here . I have got the results setting QGIS like: Setting>Options>CRS ->Use CRS of project
And I put my snippet of code to load a PostGIS view like a vector layer: (please, let me know if I am in a mistake)
mycrs = QgsCoordinateReferenceSystem(25830)#If not specified otherwise in second parameter, PostGIS SRID is used by default.
iface.mapCanvas().mapRenderer().setDestinationCrs(mycrs)# set CRS to canvas
uri = QgsDataSourceURI()
uri.setConnection('localhost', '5432', '-mydb-', '-myname-', '-mypasswd-')
uri.setDataSource('public', '-my table/view-', 'the_geom')
uri.setKeyColumn('id')# neccesary for postgres views who doesn't support primary key
vlayer = QgsVectorLayer(uri.uri(), '-nameofmyvectorlayer-', 'postgres')
vlayer.setCrs(mycrs,True)#set CRS to vector layer. I'm not sure True param. is neccesary
QgsMapLayerRegistry.instance().addMapLayer(vlayer)
When I load the vector layer a Warning Message appears telling that: CRS is not defined, and will be used the CRS of the project...and it works.