21 |
support.initthuban() |
support.initthuban() |
22 |
|
|
23 |
from Thuban import _ |
from Thuban import _ |
24 |
from Thuban.Model.proj import Projection, ProjFile |
from Thuban.Model.proj import Projection, ProjFile, \ |
25 |
|
PROJ_UNITS_METERS, PROJ_UNITS_DEGREES |
26 |
|
|
27 |
import Thuban.Model.resource as resource |
import Thuban.Model.resource as resource |
28 |
|
|
71 |
proj = Projection(params, "MyName") |
proj = Projection(params, "MyName") |
72 |
self.assertEquals(proj.GetName(), "MyName") |
self.assertEquals(proj.GetName(), "MyName") |
73 |
|
|
74 |
|
def test_get_parameter_without_equals_sign(self): |
75 |
|
"""Test Projection.GetParameter() for a parameter without '=' sign""" |
76 |
|
proj = Projection(["proj=utm", "zone=34", "south", "ellps=clrk66"]) |
77 |
|
# The Projection class pretends that for parameters specified |
78 |
|
# without a value the value is the same as the parameter name. |
79 |
|
self.assertEquals(proj.GetParameter("south"), "south") |
80 |
|
|
81 |
|
def test_get_projection_units_geo(self): |
82 |
|
"""Test Projection.GetProjectedUnits() for geographic projection""" |
83 |
|
proj = Projection(["proj=latlong", "to_meter=0.017453292519943295", |
84 |
|
"ellps=clrk66"]) |
85 |
|
self.assertEquals(proj.GetProjectedUnits(), PROJ_UNITS_DEGREES) |
86 |
|
|
87 |
|
def test_get_projection_units_normal(self): |
88 |
|
"""Test Projection.GetProjectedUnits() for normal projection""" |
89 |
|
proj = Projection(["zone=26", "proj=utm", "ellps=clrk66"]) |
90 |
|
self.assertEquals(proj.GetProjectedUnits(), PROJ_UNITS_METERS) |
91 |
|
|
92 |
|
|
93 |
sample_projfile = '''\ |
sample_projfile = '''\ |
94 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |