80 |
self.assertEquals(proj.GetParameter("south"), "south") |
self.assertEquals(proj.GetParameter("south"), "south") |
81 |
|
|
82 |
def test_get_projection_units_geo(self): |
def test_get_projection_units_geo(self): |
83 |
"""Test Projection.GetProjectedUnits() for geographic projection""" |
"""Test Projection.GetProjectedUnits() for geographic projection. |
84 |
|
Test for the alias 'longlat' as well. |
85 |
|
""" |
86 |
proj = Projection(["proj=latlong", "to_meter=0.017453292519943295", |
proj = Projection(["proj=latlong", "to_meter=0.017453292519943295", |
87 |
"ellps=clrk66"]) |
"ellps=clrk66"]) |
88 |
self.assertEquals(proj.GetProjectedUnits(), PROJ_UNITS_DEGREES) |
self.assertEquals(proj.GetProjectedUnits(), PROJ_UNITS_DEGREES) |
89 |
|
proj = Projection(["proj=longlat", "to_meter=0.017453292519943295", |
90 |
|
"ellps=clrk66"]) |
91 |
|
self.assertEquals(proj.GetProjectedUnits(), PROJ_UNITS_DEGREES) |
92 |
|
|
93 |
def test_get_projection_units_normal(self): |
def test_get_projection_units_normal(self): |
94 |
"""Test Projection.GetProjectedUnits() for normal projection""" |
"""Test Projection.GetProjectedUnits() for normal projection""" |
244 |
self.assertRaises(SAXParseException, resource.read_proj_file, filename) |
self.assertRaises(SAXParseException, resource.read_proj_file, filename) |
245 |
|
|
246 |
def test_get_system_proj_file(self): |
def test_get_system_proj_file(self): |
247 |
"""Test resource.get_system_proj_file() |
"""Test resource.get_system_proj_file(DEFAULT_PROJ_FILE) |
248 |
|
|
249 |
This is primarily to test whether the system proj file contains |
This is primarily to test whether the system proj file contains |
250 |
invalid projection paramers and whether the proj file is not |
invalid projection paramers and whether the proj file is not |
251 |
empty |
empty |
252 |
""" |
""" |
253 |
projfile, warnings = resource.get_system_proj_file() |
projfile, warnings\ |
254 |
|
= resource.get_system_proj_file(resource.DEFAULT_PROJ_FILE) |
255 |
self.assertEquals(warnings, []) |
self.assertEquals(warnings, []) |
256 |
self.assert_(len(projfile.GetProjections()) > 0) |
self.assert_(len(projfile.GetProjections()) > 0) |
257 |
|
|
258 |
# see whether it got cached and we get the same projfile object |
# see whether it got cached and we get the same projfile object |
259 |
# when we read the file again |
# when we read the file again |
260 |
projfile2, warnings = resource.get_system_proj_file() |
projfile2, warnings \ |
261 |
|
= resource.get_system_proj_file(resource.DEFAULT_PROJ_FILE) |
262 |
self.assert_(projfile is projfile2) |
self.assert_(projfile is projfile2) |
263 |
|
|
264 |
|
|