コード例 #1
0
ファイル: test_qgscrscache.py プロジェクト: AM7000000/QGIS
    def testcrsByProj4(self):
        """ test retrieving CRS from cache using proj4 """

        crs = QgsCRSCache.instance().crsByProj4('+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ')
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:28355')
        # a second time, so crs is fetched from cache
        crs = QgsCRSCache.instance().crsByProj4('+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ')
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:28355')

        # invalid
        crs = QgsCRSCache.instance().crsByProj4('asdasdasd')
        self.assertFalse(crs.isValid())
        # a second time, so invalid crs is fetched from cache
        crs = QgsCRSCache.instance().crsByProj4('asdasdasd')
        self.assertFalse(crs.isValid())
コード例 #2
0
ファイル: test_qgscrscache.py プロジェクト: AM7000000/QGIS
    def testcrsByOgcWmsCrs(self):
        """ test retrieving CRS from cache using Ogc WMS definition """

        crs = QgsCRSCache.instance().crsByOgcWmsCrs('EPSG:4326')
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:4326')
        # a second time, so crs is fetched from cache
        crs = QgsCRSCache.instance().crsByOgcWmsCrs('EPSG:4326')
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:4326')

        # invalid
        crs = QgsCRSCache.instance().crsByOgcWmsCrs('i am not a CRS')
        self.assertFalse(crs.isValid())
        # a second time, so invalid crs is fetched from cache
        crs = QgsCRSCache.instance().crsByOgcWmsCrs('i am not a CRS')
        self.assertFalse(crs.isValid())
コード例 #3
0
ファイル: test_qgscrscache.py プロジェクト: AM7000000/QGIS
    def testcrsByEpsgId(self):
        """ test retrieving CRS from cache using EPSG id """

        crs = QgsCRSCache.instance().crsByEpsgId(3111)
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:3111')
        # a second time, so crs is fetched from cache
        crs = QgsCRSCache.instance().crsByEpsgId(3111)
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:3111')

        # invalid
        crs = QgsCRSCache.instance().crsByEpsgId(-9999)
        self.assertFalse(crs.isValid())
        # a second time, so invalid crs is fetched from cache
        crs = QgsCRSCache.instance().crsByEpsgId(-9999)
        self.assertFalse(crs.isValid())
コード例 #4
0
ファイル: test_qgscrscache.py プロジェクト: akbargumbira/QGIS
    def testcrsByEpsgId(self):
        """ test retrieving CRS from cache using EPSG id """

        crs = QgsCRSCache.instance().crsByEpsgId(3111)
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:3111')
        # a second time, so crs is fetched from cache
        crs = QgsCRSCache.instance().crsByEpsgId(3111)
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:3111')

        # invalid
        crs = QgsCRSCache.instance().crsByEpsgId(-9999)
        self.assertFalse(crs.isValid())
        # a second time, so invalid crs is fetched from cache
        crs = QgsCRSCache.instance().crsByEpsgId(-9999)
        self.assertFalse(crs.isValid())
コード例 #5
0
ファイル: test_qgscrscache.py プロジェクト: akbargumbira/QGIS
    def testcrsByOgcWmsCrs(self):
        """ test retrieving CRS from cache using Ogc WMS definition """

        crs = QgsCRSCache.instance().crsByOgcWmsCrs('EPSG:4326')
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:4326')
        # a second time, so crs is fetched from cache
        crs = QgsCRSCache.instance().crsByOgcWmsCrs('EPSG:4326')
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:4326')

        # invalid
        crs = QgsCRSCache.instance().crsByOgcWmsCrs('i am not a CRS')
        self.assertFalse(crs.isValid())
        # a second time, so invalid crs is fetched from cache
        crs = QgsCRSCache.instance().crsByOgcWmsCrs('i am not a CRS')
        self.assertFalse(crs.isValid())
コード例 #6
0
ファイル: test_qgscrscache.py プロジェクト: akbargumbira/QGIS
    def testcrsByWkt(self):
        """ test retrieving CRS from cache using wkt """

        # EPSG3111
        wkt = 'PROJCS["GDA94 / Vicgrid94",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6283"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4283"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",-36],PARAMETER["standard_parallel_2",-38],PARAMETER["latitude_of_origin",-37],PARAMETER["central_meridian",145],PARAMETER["false_easting",2500000],PARAMETER["false_northing",2500000],AUTHORITY["EPSG","3111"],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'

        crs = QgsCRSCache.instance().crsByWkt(wkt)
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:3111')
        # a second time, so crs is fetched from cache
        crs = QgsCRSCache.instance().crsByWkt(wkt)
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:3111')

        # invalid
        crs = QgsCRSCache.instance().crsByWkt('asdasdasd')
        self.assertFalse(crs.isValid())
        # a second time, so invalid crs is fetched from cache
        crs = QgsCRSCache.instance().crsByWkt('asdasdasd')
        self.assertFalse(crs.isValid())
コード例 #7
0
ファイル: test_qgscrscache.py プロジェクト: belkacem77/QGIS
    def testcrsByWkt(self):
        """ test retrieving CRS from cache using wkt """

        # EPSG3111
        wkt = 'PROJCS["GDA94 / Vicgrid94",GEOGCS["GDA94",DATUM["Geocentric_Datum_of_Australia_1994",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6283"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4283"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",-36],PARAMETER["standard_parallel_2",-38],PARAMETER["latitude_of_origin",-37],PARAMETER["central_meridian",145],PARAMETER["false_easting",2500000],PARAMETER["false_northing",2500000],AUTHORITY["EPSG","3111"],AXIS["Easting",EAST],AXIS["Northing",NORTH]]'

        crs = QgsCRSCache.instance().crsByWkt(wkt)
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:3111')
        # a second time, so crs is fetched from cache
        crs = QgsCRSCache.instance().crsByWkt(wkt)
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:3111')

        # invalid
        crs = QgsCRSCache.instance().crsByWkt('asdasdasd')
        self.assertFalse(crs.isValid())
        # a second time, so invalid crs is fetched from cache
        crs = QgsCRSCache.instance().crsByWkt('asdasdasd')
        self.assertFalse(crs.isValid())
コード例 #8
0
ファイル: test_qgscrscache.py プロジェクト: akbargumbira/QGIS
    def testcrsByProj4(self):
        """ test retrieving CRS from cache using proj4 """

        crs = QgsCRSCache.instance().crsByProj4(
            '+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '
        )
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:28355')
        # a second time, so crs is fetched from cache
        crs = QgsCRSCache.instance().crsByProj4(
            '+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs '
        )
        self.assertTrue(crs.isValid())
        self.assertEqual(crs.authid(), 'EPSG:28355')

        # invalid
        crs = QgsCRSCache.instance().crsByProj4('asdasdasd')
        self.assertFalse(crs.isValid())
        # a second time, so invalid crs is fetched from cache
        crs = QgsCRSCache.instance().crsByProj4('asdasdasd')
        self.assertFalse(crs.isValid())
コード例 #9
0
ファイル: test_qgscrscache.py プロジェクト: AM7000000/QGIS
 def testInstance(self):
     """ test retrieving global instance """
     self.assertTrue(QgsCRSCache.instance())
コード例 #10
0
ファイル: test_qgscrscache.py プロジェクト: akbargumbira/QGIS
 def testInstance(self):
     """ test retrieving global instance """
     self.assertTrue(QgsCRSCache.instance())
コード例 #11
0
ファイル: application.py プロジェクト: lparchaeology/ArkPlan
 def layerDefaultCrs():
     return QgsCRSCache.instance().crsByOgcWmsCrs(Application.layerDefaultCrsAuthid())
コード例 #12
0
ファイル: application.py プロジェクト: lparchaeology/ArkPlan
 def projectDefaultCrs():
     return QgsCRSCache.instance().crsByOgcWmsCrs(Application.projectDefaultCrsAuthid())
コード例 #13
0
ファイル: application.py プロジェクト: lhow-atr/ArkSpatial
 def layerDefaultCrs():
     return QgsCRSCache.instance().crsByOgcWmsCrs(
         Application.layerDefaultCrsAuthid())
コード例 #14
0
ファイル: application.py プロジェクト: lhow-atr/ArkSpatial
 def projectDefaultCrs():
     return QgsCRSCache.instance().crsByOgcWmsCrs(
         Application.projectDefaultCrsAuthid())