示例#1
0
 def test_vertices_in_crs2(self):
     point = Point((-123.0, 49.0), crs=LonLatWGS84)
     BCAlbers = ProjectedCRS("+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 "
                 "+lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +datum=NAD83 "
                 "+units=m +no_defs", "BC Albers")
     self.assertTupleAlmostEqual(point.get_vertex(BCAlbers),
                                 (1219731.770879303, 447290.49891930853))
     return
示例#2
0
 def test_walk_albers_geodetic(self):
     AlaskaAlbers = ProjectedCRS("+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 "
                             "+x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs",
                             "+ellps=GRS80")
     start = Point((-2658638, 2443580), crs=AlaskaAlbers)
     dest = start.walk(4500, 195.0, projected=False)
     self.assertAlmostEqual(dest.x, -2662670.889, places=3)
     self.assertAlmostEqual(dest.y, 2441551.155, places=3)
示例#3
0
 def test_walk_albers_projected(self):
     AlaskaAlbers = ProjectedCRS("+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 "
                             "+x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs",
                             "+ellps=GRS80")
     start = Point((-2658638, 2443580), crs=AlaskaAlbers)
     dest = start.walk(4500, 195.0)
     self.assertAlmostEqual(dest.x, -2659802.686, places=3)
     self.assertAlmostEqual(dest.y, 2439233.334, places=3)
     return
示例#4
0
 def test_vertices_in_crs3(self):
     line = Line([(2.0, 34.0), (2.15, 34.2), (2.7, 34.1)], crs=LonLatWGS84)
     UTM31N = ProjectedCRS(
         "+proj=utm +zone=31 +ellps=WGS84 "
         "+datum=WGS84 +units=m +no_defs", "UTM 31N (WGS 84)")
     ans = [[407650.39665729, 3762606.65987638],
            [421687.71905897, 3784658.46708431],
            [472328.10951276, 3773284.48524179]]
     for v0, v1 in zip(line.get_vertices(UTM31N), ans):
         self.assertTupleAlmostEqual(v0, v1, places=6)
     return