def setUpClass(cls):
        geojson = read_data(os.path.join(cls.INPUT_FOLDER,
                                         'cies_islands.json'))
        cls.area = shape(geojson)

        cls.test_cases = [
            cls.SplitterTestCase('BBoxSplitter',
                                 BBoxSplitter([cls.area],
                                              CRS.WGS84,
                                              5,
                                              reduce_bbox_sizes=True),
                                 bbox_len=19),
            cls.SplitterTestCase('OsmSplitter',
                                 OsmSplitter([cls.area],
                                             CRS.WGS84,
                                             15,
                                             reduce_bbox_sizes=True),
                                 bbox_len=24),
            cls.SplitterTestCase('TileSplitter',
                                 TileSplitter(
                                     [cls.area],
                                     CRS.WGS84, ('2017-10-01', '2018-03-01'),
                                     tile_split_shape=40,
                                     data_source=DataSource.SENTINEL2_L1C,
                                     reduce_bbox_sizes=True),
                                 bbox_len=13)
        ]
Beispiel #2
0
    def setUpClass(cls):
        super().setUpClass()

        geojson = read_data(os.path.join(cls.INPUT_FOLDER, 'cies_islands.json'))
        cls.area = shapely.geometry.shape(geojson)

        bbox_grid = [BBox((x / 10, y / 100, (x + 1) / 10, (y + 1) / 100), CRS.WGS84)
                     for x, y in itertools.product(range(-90, -87), range(4200, 4250))]

        cls.test_cases = [
            cls.SplitterTestCase('BBoxSplitter',
                                 BBoxSplitter([cls.area], CRS.WGS84, 5, reduce_bbox_sizes=True), bbox_len=19),
            cls.SplitterTestCase('OsmSplitter',
                                 OsmSplitter([cls.area], CRS.WGS84, 15, reduce_bbox_sizes=True), bbox_len=24),
            cls.SplitterTestCase('TileSplitter',
                                 TileSplitter([cls.area], CRS.WGS84, ('2017-10-01', '2018-03-01'), tile_split_shape=40,
                                              data_source=DataSource.SENTINEL2_L1C, reduce_bbox_sizes=True),
                                 bbox_len=13),
            cls.SplitterTestCase('CustomGridSplitter',
                                 CustomGridSplitter([cls.area], CRS.WGS84, bbox_grid, bbox_split_shape=(3, 4),
                                                    reduce_bbox_sizes=False),
                                 bbox_len=41),
            cls.SplitterTestCase('UTMGridSplitter',
                                 UtmGridSplitter([cls.area], CRS.WGS84, bbox_size=(1200, 1200)), bbox_len=16),
            cls.SplitterTestCase('UTMZoneSplitter',
                                 UtmZoneSplitter([cls.area], CRS.WGS84, bbox_size=(1000, 1000)), bbox_len=19)
        ]
Beispiel #3
0
show_splitter(osm_splitter, show_legend=True, title="OsmSplitter")
"""
The third option is to work on a level of satellite tiles and split them using TileSplitter. This requires an instance
ID to utilise Sentinel Hub WFS.
"""

INSTANCE_ID = 'cae04732-5ed8-40c2-a2c6-461e44f55720'
if INSTANCE_ID:
    config = SHConfig()
    config.instance_id = INSTANCE_ID
else:
    config = None

tile_splitter = TileSplitter([hawaii_area],
                             CRS.WGS84, ('2017-10-01', '2018-03-01'),
                             data_collection=DataCollection.SENTINEL2_L1C,
                             config=config)

tile_bbox_list = tile_splitter.get_bbox_list()

print()
print(len(tile_bbox_list))
print(tile_bbox_list[0].__repr__())
print(tile_splitter.get_info_list()[0])
print()
print(tile_splitter.get_bbox_list(crs=CRS.WGS84)[0])

show_splitter(tile_splitter, show_legend=True, title="Satellite tiles")

finer_tile_splitter = TileSplitter(
    [hawaii_area],