コード例 #1
0
class TestService(unittest.TestCase):
    def setUp(self):
        config = StringIO("""[cassandra]
host=127.0.0.1
keyspace=nexustiles
local_datacenter=datacenter1
protocol_version=3
port=9042

[solr]
host=http://localhost:8983
core=nexustiles

[datastore]
store=cassandra""")
        cp = ConfigParser.RawConfigParser()
        cp.readfp(config)

        self.tile_service = NexusTileService(config=cp)

    def test_get_distinct_bounding_boxes_in_polygon(self):
        boxes = self.tile_service.get_distinct_bounding_boxes_in_polygon(box(-180, -90, 180, 90),
                                                                         "MXLDEPTH_ECCO_version4_release1",
                                                                         1, time.time())
        for b in boxes:
            print b.bounds

    def test_get_distinct_bounding_boxes_in_polygon_mur(self):
        boxes = self.tile_service.get_distinct_bounding_boxes_in_polygon(box(-180, -90, 180, 90),
                                                                         "JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1",
                                                                         1, time.time())
        for b in boxes:
            print b.bounds

    def test_find_tiles_by_exact_bounds(self):
        tiles = self.tile_service.find_tiles_by_exact_bounds((175.01, -42.68, 180.0, -40.2),
                                                             "JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1",
                                                             1, time.time())
        for tile in tiles:
            print tile.get_summary()

    def test_sorted_box(self):

        tiles = self.tile_service.get_tiles_bounded_by_box(-42.68, -40.2, 175.01, 180.0,
                                                   "JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1",
                                                   1, time.time())
        for tile in tiles:
            print tile.min_time

    def test_time_series_tile(self):
        tiles = self.tile_service.find_tile_by_id("055c0b51-d0fb-3f39-b48a-4f762bf0c994")
        for tile in tiles:
            print tile.get_summary()

    def test_get_tiles_by_metadata(self):
        tiles = self.tile_service.get_tiles_by_metadata(['id:60758e00-5721-3a6e-bf57-78448bb0aeeb'],
                                                        "MUR-JPL-L4-GLOB-v4.1", 1514764800, 1514764800)
        for tile in tiles:
            print tile.get_summary()
コード例 #2
0
class TestService(unittest.TestCase):
    def setUp(self):
        config = StringIO("""[cassandra]
host=127.0.0.1
keyspace=nexustiles
local_datacenter=datacenter1
protocol_version=3
port=32769

[solr]
host=localhost:8986
core=nexustiles""")
        cp = ConfigParser.RawConfigParser()
        cp.readfp(config)

        self.tile_service = NexusTileService(config=cp)

    def test_get_distinct_bounding_boxes_in_polygon(self):
        boxes = self.tile_service.get_distinct_bounding_boxes_in_polygon(box(-180, -90, 180, 90),
                                                                         "MXLDEPTH_ECCO_version4_release1",
                                                                         1, time.time())
        for b in boxes:
            print b.bounds

    def test_get_distinct_bounding_boxes_in_polygon_mur(self):
        boxes = self.tile_service.get_distinct_bounding_boxes_in_polygon(box(-180, -90, 180, 90),
                                                                         "JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1",
                                                                         1, time.time())
        for b in boxes:
            print b.bounds

    def test_find_tiles_by_exact_bounds(self):
        tiles = self.tile_service.find_tiles_by_exact_bounds((175.01, -42.68, 180.0, -40.2),
                                                             "JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1",
                                                             1, time.time())
        for tile in tiles:
            print tile.get_summary()

    def test_sorted_box(self):

        tiles = self.tile_service.get_tiles_bounded_by_box(-42.68, -40.2, 175.01, 180.0,
                                                   "JPL-L4_GHRSST-SSTfnd-MUR-GLOB-v02.0-fv04.1",
                                                   1, time.time())
        for tile in tiles:
            print tile.min_time