Example #1
0
 def test_big_landsat_search(self):
     """ Search for a bunch of Landsat data """
     search = Query(date='2017-01-01', satellite_name='Landsat-8')
     self.assertEqual(search.found(), 564)
     scenes = search.scenes()
     self.assertEqual(len(scenes), 564)
     # verify this is 564 unique scenes
     ids = set([s.scene_id for s in scenes])
     self.assertEqual(len(ids), 564)
Example #2
0
 def test_big_sentinel_search(self):
     """ Search for a bunch of Sentinel data """
     search = Query(**{
         'datetime': '2017-01-01',
         'eo:platform': 'sentinel-2a'
     })
     self.assertEqual(search.found(), self.num_sentinel)
     scenes = search.items()
     self.assertEqual(len(scenes), self.num_sentinel)
Example #3
0
    def test_big_landsat_search(self):
        """ Search for a bunch of Landsat data """
        search = Query(**{
            'datetime': '2017-01-01',
            'eo:platform': 'landsat-8'
        })
        self.assertEqual(search.found(), self.num_landsat)

        scenes = search.items()

        self.assertEqual(len(scenes), self.num_landsat)
Example #4
0
 def test_big_sentinel_search(self):
     """ Search for a bunch of Sentinel data """
     search = Query(date='2017-01-01', satellite_name='Sentinel-2A')
     self.assertEqual(search.found(), self.num_sentinel)
     scenes = search.scenes()
     self.assertEqual(len(scenes), self.num_sentinel)
Example #5
0
 def test_big_landsat_search(self):
     """ Search for a bunch of Landsat data """
     search = Query(date='2017-01-01', satellite_name='Landsat-8')
     self.assertEqual(search.found(), self.num_landsat)
     scenes = search.scenes()
     self.assertEqual(len(scenes), self.num_landsat)
Example #6
0
 def test_bad_search(self):
     """ Run a bad query """
     q = Query(limit='a')
     with self.assertRaises(SatSearchError):
         q.found()
Example #7
0
 def test_empty_search(self):
     """ Perform search for 0 results """
     search = Query(scene_id='nosuchscene')
     self.assertEqual(search.found(), 0)
Example #8
0
 def test_hits(self):
     """ Check total number of results """
     search = Query(date='2017-01-01')
     hits = search.found()
     self.assertEqual(hits, 4267)
Example #9
0
 def get_queries(self):
     """ Initialize and return search object """
     return {
         s: Query(scene_id=self.results[s]['results'][0]['scene_id'])
         for s in self.results
     }
Example #10
0
 def test_bad_search(self):
     """ Run a bad query """
     q = Query(limit='a')
     q.found()
Example #11
0
 def get_queries(self):
     """ Initialize and return search object """
     return {
         s: Query(id=self.results[s]['features'][0]['properties']['id'])
         for s in self.results
     }