@@ -222,53 +222,68 @@ class TestMercatorCylindrical:
222
222
Tests for the Mercator Cylindrical projection.
223
223
"""
224
224
225
- prj = projection .MercatorCylindrical (
225
+ prj1 = projection .MercatorCylindrical (
226
226
central_longitude = 145 , central_latitude = - 35 , width = 12
227
227
)
228
+ prj2 = projection .MercatorCylindrical (width = 12 )
228
229
229
230
def test_default_unit (self ):
230
231
"Test the default value for the figure units"
231
- assert self .prj .unit == "c"
232
+ assert self .prj1 .unit == "c"
232
233
233
- def test_string_conversion (self ):
234
+ def test_string_conversion1 (self ):
235
+ "Test the string representation of the projection class"
236
+ assert str (self .prj1 ) == "M145/-35/12c"
237
+
238
+ def test_string_conversion2 (self ):
234
239
"Test the string representation of the projection class"
235
- assert str (self .prj ) == "M145/-35/12c "
240
+ assert str (self .prj2 ) == "M12c "
236
241
237
242
238
243
class TestCylindricalStereographic :
239
244
"""
240
245
Tests for the Cylindrical Stereographic projection.
241
246
"""
242
247
243
- prj = projection .CylindricalStereographic (
248
+ prj1 = projection .CylindricalStereographic (
244
249
central_longitude = 145 , central_latitude = - 35 , width = 12
245
250
)
251
+ prj2 = projection .CylindricalStereographic (width = 12 )
246
252
247
253
def test_default_unit (self ):
248
254
"Test the default value for the figure units"
249
- assert self .prj .unit == "c"
255
+ assert self .prj1 .unit == "c"
250
256
251
- def test_string_conversion (self ):
257
+ def test_string_conversion1 (self ):
252
258
"Test the string representation of the projection class"
253
- assert str (self .prj ) == "Cyl_stere/145/-35/12c"
259
+ assert str (self .prj1 ) == "Cyl_stere/145/-35/12c"
260
+
261
+ def test_string_conversion2 (self ):
262
+ "Test the string representation of the projection class"
263
+ assert str (self .prj2 ) == "Cyl_stere/12c"
254
264
255
265
256
266
class TestCylindricalEqualArea :
257
267
"""
258
268
Tests for the Cylindrical Equal Area projection.
259
269
"""
260
270
261
- prj = projection .CylindricalEqualArea (
271
+ prj1 = projection .CylindricalEqualArea (
262
272
central_longitude = 145 , central_latitude = - 35 , width = 12
263
273
)
274
+ prj2 = projection .CylindricalEqualArea (width = 12 )
264
275
265
276
def test_default_unit (self ):
266
277
"Test the default value for the figure units"
267
- assert self .prj .unit == "c"
278
+ assert self .prj1 .unit == "c"
268
279
269
- def test_string_conversion (self ):
280
+ def test_string_conversion1 (self ):
270
281
"Test the string representation of the projection class"
271
- assert str (self .prj ) == "Y145/-35/12c"
282
+ assert str (self .prj1 ) == "Y145/-35/12c"
283
+
284
+ def test_string_conversion2 (self ):
285
+ "Test the string representation of the projection class"
286
+ assert str (self .prj1 ) == "Y12c"
272
287
273
288
274
289
class TestHammerEqualArea :
@@ -505,6 +520,7 @@ class TestObliqueMercator1:
505
520
"""
506
521
Tests for the Oblique Mercator projection (option 1).
507
522
"""
523
+
508
524
prj1 = projection .ObliqueMercator1 (
509
525
central_longitude = 145 , central_latitude = - 35 , azimuth = 45 , width = 12
510
526
)
@@ -536,6 +552,7 @@ class TestObliqueMercator2:
536
552
"""
537
553
Tests for the Oblique Mercator projection (option 2).
538
554
"""
555
+
539
556
prj1 = projection .ObliqueMercator2 (
540
557
central_longitude = 145 , central_latitude = - 35 , oblique_longitude = 110 , oblique_latitude = - 20 , width = 12
541
558
)
@@ -567,6 +584,7 @@ class TestObliqueMercator3:
567
584
"""
568
585
Tests for the Oblique Mercator projection (option 3).
569
586
"""
587
+
570
588
prj1 = projection .ObliqueMercator3 (
571
589
central_longitude = 145 , central_latitude = - 35 , pole_longitude = 110 , pole_latitude = - 20 , width = 12
572
590
)
@@ -594,6 +612,76 @@ def test_string_conversion3(self):
594
612
assert str (self .prj2 ) == "O145/-35/110/-20/12c+v"
595
613
596
614
615
+ class TestTransverseMercator :
616
+ """
617
+ Tests for the Transverse Mercator projection.
618
+ """
619
+
620
+ prj1 = projection .TransverseMercator (central_longitude = 145 , width = 12 )
621
+ prj2 = projection .TransverseMercator (
622
+ central_longitude = 145 , central_latitude = - 35 , width = 12
623
+ )
624
+
625
+ def test_default_unit (self ):
626
+ "Test the default value for the figure units"
627
+ assert self .prj1 .unit == "c"
628
+
629
+ def test_string_conversion1 (self ):
630
+ "Test the string representation of the projection class"
631
+ assert str (self .prj1 ) == "T145/12c"
632
+
633
+ def test_string_conversion2 (self ):
634
+ "Test the string representation of the projection class"
635
+ assert str (self .prj2 ) == "T145/-35/12c"
636
+
637
+
638
+ class TestUniversalTransverseMercator :
639
+ """
640
+ Tests for the Universal Transverse Mercator projection.
641
+ """
642
+
643
+ prj1 = projection .UniversalTransverseMercator (zone = "-55" , width = 12 )
644
+ prj2 = projection .UniversalTransverseMercator (zone = "55H" , width = 12 )
645
+
646
+ def test_default_unit (self ):
647
+ "Test the default value for the figure units"
648
+ assert self .prj1 .unit == "c"
649
+
650
+ def test_string_conversion1 (self ):
651
+ "Test the string representation of the projection class"
652
+ assert str (self .prj1 ) == "U-55/12c"
653
+
654
+ def test_string_conversion2 (self ):
655
+ "Test the string representation of the projection class"
656
+ assert str (self .prj1 ) == "U55H/12c"
657
+
658
+
659
+ class TestEquidistantCylindrical :
660
+ """
661
+ Tests for the Equidistant Cylindrical projection.
662
+ """
663
+
664
+ prj1 = projection .EquidistantCylindrical (width = 12 )
665
+ prj2 = projection .EquidistantCylindrical (central_longitude = 145 , width = 12 )
666
+ prj3 = projection .EquidistantCylindrical (central_longitude = 145 , central_latitude = - 35 , width = 12 )
667
+
668
+ def test_default_unit (self ):
669
+ "Test the default value for the figure units"
670
+ assert self .prj1 .unit == "c"
671
+
672
+ def test_string_conversion1 (self ):
673
+ "Test the string representation of the projection class"
674
+ assert str (self .prj1 ) == "Q12c"
675
+
676
+ def test_string_conversion2 (self ):
677
+ "Test the string representation of the projection class"
678
+ assert str (self .prj2 ) == "Q145/12c"
679
+
680
+ def test_string_conversion3 (self ):
681
+ "Test the string representation of the projection class"
682
+ assert str (self .prj2 ) == "Q145/-35/12c"
683
+
684
+
597
685
class TestPolar :
598
686
"""
599
687
Tests for the Polar projection.
0 commit comments