[Qgis-user] QgsCoordinateReferenceSystem in
Martin Dobias
wonder.sk at gmail.com
Sat Jan 31 06:09:47 PST 2009
On Thu, Jan 29, 2009 at 1:41 PM, Radosław Pasiok <rpasiok at gmail.com> wrote:
> Hello list!
>
> I am happy OSGeo4W user with QGIS 1.0.0-5.
> I got strange things using QgsCoordinateReferenceSystem in a custom
> python script.
> For example, from the following script:
>
> from qgis.core import *
>
> QgsApplication.setPrefixPath("C:\OSGeo4W\apps",True)
> QgsApplication.initQgis()
>
> cs = QgsCoordinateReferenceSystem(2180)
> print "EPSG ID:", cs.epsg()
> print "Is it valid CRS? ", cs.isValid()
>
> QgsApplication.exitQgis()
>
> I get:
>
> EPSG ID: 10
> Is it valid CRS? False
Hi,
I haven't tried qgis from osgeo4w yet, but it's possible that the CRS
is not found because of different paths to the qgis.db file (which
contains database of CRS). By default it should be located (on
windows) in "resources" subdirectory from the specified prefix path.
In case it's different, you could use
QgsApplication.setPkgDataPath(path) to change it.
Martin
More information about the Qgis-user
mailing list