[Qgis-developer] Extract epgs code from input layer

Salvatore Larosa lrssvtml at gmail.com
Sat Feb 16 06:33:48 PST 2013


Hi,

2013/2/16 francescoboccacci at libero.it <francescoboccacci at libero.it>

> Hi all,
> i would like to extract epsg code from inputvector layer.
> My code is:
>
> vlayerA = QGisLayers.getObjectFromUri(self.getParameterValue(href.INPUT))
> self.epsg = vlayerA.crs().srsid()
>
> Is it corrects?
> If i print the values it show strange value.
>
>
Those are not strange values, the srs id is the primary key that reference
to SRS in sqlite db.
You should use authid() [1] to get EPSG code or description() [2] to get a
textual description of the SRS.

Regards,

-SL

[1] - http://goo.gl/o29FU
[2] - http://goo.gl/IPvYx


> Thanks
>
> Francesco
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130216/98f63675/attachment.html>


More information about the Qgis-developer mailing list