Exemplo n.º 1
0
 def test_geodesic_distance(self):
     self.assertApproximates(
         smath.geodesic_distance((0, 0), (0, 180)),
         smath._EARTH_MEAN_RADIUS_METERS * pi,
         1e-8)
     self.assertApproximates(
         smath.geodesic_distance((0, 0), (0, 90)),
         smath._EARTH_MEAN_RADIUS_METERS * pi / 2,
         1e-8)
Exemplo n.º 2
0
 def _record_filter(self, record):
     loc = record.get(u'location')  # TODO this should be [] but we're working with unnormalized records
     if loc:
         if geodesic_distance(loc, self.__center) > self.__radius:
             return None
     else:
         if not self.__include_no_location:
             return None
     return record
Exemplo n.º 3
0
 def test_geodesic_distance(self):
     self.assertApproximates(smath.geodesic_distance((0, 0), (0, 180)),
                             smath._EARTH_MEAN_RADIUS_METERS * pi, 1e-8)
     self.assertApproximates(smath.geodesic_distance((0, 0), (0, 90)),
                             smath._EARTH_MEAN_RADIUS_METERS * pi / 2, 1e-8)