Example #1
0
 def test_create_multipoint_from_points(self):
     points = []
     for vertex in [(70.205, 40.283166666666666), (70.205, 40.283),
                    (70.205, 40.282666666666664),
                    (70.1035, 40.14033333333333),
                    (70.10316666666667, 40.14),
                    (70.10283333333334, 40.13966666666666),
                    (70.00566666666667, 40.0115), (70.0055, 40.0115),
                    (70.00516666666667, 40.011),
                    (69.92983333333333, 39.899166666666666),
                    (69.9295, 39.899166666666666),
                    (69.92833333333333, 39.899166666666666),
                    (69.902, 39.8585),
                    (69.90116666666667, 39.858666666666664),
                    (69.89966666666666, 39.86),
                    (69.85133333333333, 39.791333333333334),
                    (69.85133333333333, 39.791333333333334),
                    (69.85116666666667, 39.791),
                    (69.7995, 39.70066666666666),
                    (69.79933333333334, 39.70033333333333),
                    (69.80066666666667, 39.6955),
                    (69.6525, 39.474333333333334),
                    (69.65333333333334, 39.47416666666667),
                    (69.66433333333333, 39.47),
                    (69.48716666666667, 39.266333333333336),
                    (69.4875, 39.26683333333333),
                    (69.48966666666666, 39.2675),
                    (69.33383333333333, 39.0145),
                    (69.33416666666666, 39.01416666666667),
                    (69.33933333333333, 39.01083333333333),
                    (69.18516666666666, 38.790333333333336),
                    (69.18516666666666, 38.790333333333336),
                    (69.18316666666666, 38.79)]:
         points.append(Point(vertex, crs=LonLatWGS84))
     mp = Multipoint(points)
     self.assertTrue(isinstance(mp, Multipoint))
     self.assertTrue(isinstance(mp[0].vertex, tuple))
     self.assertEqual(mp.crs, points[0].crs)
     return
Example #2
0
 def test_distance_meridional(self):
     pt = Point((-140.0, 41.0))
     pt_north = Point((-140.0, 41.5))
     d = pt.distance(pt_north)
     self.assertLess(abs(d - 55529.372145), 0.1)  # from geographicslib
     return
Example #3
0
 def test_distance_equatorial(self):
     pt = Point((-140.0, 0.0))
     pt_west = Point((-144.0, 0.0))
     d = pt.distance(pt_west)
     self.assertLess(abs(d - 445277.963), 1.0)  # from geod 4.8.0
     return
Example #4
0
 def test_distance(self):
     pt = Point((-140.0, 41.0))
     pt_northwest = Point((-142.0, 42.0))
     d = pt.distance(pt_northwest)
     self.assertLess(abs(d - 200544.120615), 0.1)  # from geographiclib
     return
Example #5
0
 def test_create_point(self):
     # tests that a Point can be instantiated
     point = Point((-70.672439, 41.524079), crs=LonLatWGS84)
     self.assertTrue(isinstance(point, Point))
     return
Example #6
0
 def test_distance_equatorial(self):
     pt = Point((-140.0, 0.0))
     pt_west = Point((-144.0, 0.0))
     d = pt.distance(pt_west)
     self.assertLess(abs(d - 445277.963), 1.0)       # from geod 4.8.0
     return
Example #7
0
 def test_distance_meridional(self):
     pt = Point((-140.0, 41.0))
     pt_north = Point((-140.0, 41.5))
     d = pt.distance(pt_north)
     self.assertLess(abs(d - 55529.372145), 0.1)     # from geographicslib
     return
Example #8
0
 def test_distance(self):
     pt = Point((-140.0, 41.0))
     pt_northwest = Point((-142.0, 42.0))
     d = pt.distance(pt_northwest)
     self.assertLess(abs(d - 200544.120615), 0.1)    # from geographiclib
     return