예제 #1
0
    def test_init_from_wkt(self):
        nsr = NSR(
        'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,'\
        'AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,'\
        'AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],'\
        'AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]')

        self.assertEqual(type(nsr), NSR)
        self.assertEqual(nsr.Validate(), 0)
        self.assertTrue('longlat' in nsr.ExportToProj4())
예제 #2
0
    def test_init_from_NSR(self):
        nsr = NSR(NSR(osr.SRS_WKT_WGS84))

        self.assertEqual(type(nsr), NSR)
        self.assertEqual(nsr.Validate(), 0)
        self.assertTrue('longlat' in nsr.ExportToProj4())
예제 #3
0
    def test_init_from_proj4(self):
        nsr = NSR('+proj=longlat')

        self.assertEqual(type(nsr), NSR)
        self.assertEqual(nsr.Validate(), 0)
        self.assertTrue('longlat' in nsr.ExportToProj4())
예제 #4
0
    def test_init_from_EPSG(self):
        nsr = NSR(4326)

        self.assertEqual(type(nsr), NSR)
        self.assertEqual(nsr.Validate(), 0)
        self.assertTrue('4326' in nsr.ExportToWkt())
예제 #5
0
    def test_init_from_0(self):
        nsr = NSR(0)

        self.assertEqual(type(nsr), NSR)
        self.assertEqual(nsr.Validate(), 0)
예제 #6
0
    def test_init_from_none(self):
        nsr = NSR(None)

        self.assertEqual(type(nsr), NSR)
        self.assertEqual(nsr.Validate(), 5)
예제 #7
0
    def test_init_empty(self):
        nsr = NSR()

        self.assertEqual(type(nsr), NSR)
        self.assertEqual(nsr.Validate(), 0)