How to use the sentinelhub.DataSource function in sentinelhub

To help you get started, we’ve selected a few sentinelhub examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sentinel-hub / sentinelhub-py / tests / test_fis.py View on Github external
result_length=1),
            cls.FisTestCase('bbox',
                            FisRequest(layer='BANDS-S2-L1C',
                                       geometry_list=[bbox],
                                       time='2017-1-1',
                                       resolution="50m",
                                       maxcc=0.2,
                                       custom_url_params={
                                           CustomUrlParam.ATMFILTER: "ATMCOR",
                                           CustomUrlParam.DOWNSAMPLING: "BICUBIC",
                                           CustomUrlParam.UPSAMPLING: "BICUBIC"}
                                       ),
                            raw_result=results[1],
                            result_length=1),
            cls.FisTestCase('list',
                            FisRequest(data_source=DataSource.LANDSAT8,
                                       layer='BANDS-L8',
                                       geometry_list=[bbox, geometry1],
                                       time=('2017-1-1', '2017-1-10'),
                                       resolution="100m",
                                       bins=32, data_folder=cls.OUTPUT_FOLDER),
                            raw_result=results[2], result_length=2,
                            save_data=True),
            cls.FisTestCase('Polygon in WGS84',
                            FisRequest(layer='TRUE-COLOR-S2-L1C',
                                       geometry_list=[geometry2],
                                       time=('2017-10-1', '2017-10-2'),
                                       resolution="60m",
                                       bins=11, histogram_type=HistogramType.EQUALFREQUENCY),
                            raw_result=results[3], result_length=1),
        ]
github sentinel-hub / sentinelhub-py / tests / test_areas.py View on Github external
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)
        ]
github sentinel-hub / eo-learn / mask / eolearn / mask / cloud_mask.py View on Github external
def __init__(self, classifier, data_feature, cm_size_x=None, cm_size_y=None, cmask_feature='CLM',
                 cprobs_feature=None, instance_id=None, data_source=DataSource.SENTINEL2_L1C,
                 image_format=MimeType.TIFF_d32f, model_evalscript=MODEL_EVALSCRIPT):
        """ Constructor

        If both `cm_size_x` and `cm_size_y` are `None` and `data_feature` exists, cloud detection is computed at same
        resolution of `data_feature`.

        :param classifier: Cloud detector classifier. This object implements a `get_cloud_probability_map` and
                            `get_cloud_masks` functions to generate probability maps and binary masks
        :param data_feature: Name of key in eopatch.data dictionary to be used as input to the classifier. If the
                           `data_feature` does not exist, a new OGC request at the given cloud mask resolution is made
                           with layer name set to `data_feature` parameter.
        :param cm_size_x: Resolution to be used for computation of cloud mask. Allowed values are number of column
                            pixels (WMS-request) or spatial resolution (WCS-request, e.g. '10m'). Default is `None`
        :param cm_size_y: Resolution to be used for computation of cloud mask. Allowed values are number of row
                            pixels (WMS-request) or spatial resolution (WCS-request, e.g. '10m'). Default is `None`
        :param cmask_feature: Name of key to be used for the cloud mask to add. The cloud binary mask is added to the
github sentinel-hub / eo-learn / io / eolearn / io / sentinelhub_service.py View on Github external
def __init__(self, layer, **kwargs):
        super().__init__(layer=layer, data_source=DataSource.SENTINEL2_L2A, **kwargs)
github sentinel-hub / eo-learn / io / eolearn / io / sh_add.py View on Github external
def __init__(self, layer, **kwargs):
        super(AddS2L2AFeature, self).__init__(feature_type=FeatureType.DATA, layer=layer,
                                              data_source=DataSource.SENTINEL2_L2A, **kwargs)
github sentinel-hub / eo-learn / io / eolearn / io / sentinelhub_service.py View on Github external
def __init__(self, layer, feature=None, **kwargs):
        if feature is None:
            feature = (FeatureType.DATA_TIMELESS, layer)
        elif isinstance(feature, str):
            feature = (FeatureType.DATA_TIMELESS, feature)
        super().__init__(layer=layer, feature=feature, data_source=DataSource.DEM, **kwargs)
github sentinel-hub / eo-learn / io / eolearn / io / sh_add.py View on Github external
def __init__(self, layer, **kwargs):
        super(AddDEMFeature, self).__init__(feature_type=FeatureType.DATA_TIMELESS, layer=layer,
                                            data_source=DataSource.DEM, **kwargs)
github sentinel-hub / eo-learn / io / eolearn / io / sentinelhub_service.py View on Github external
def __init__(self, layer, **kwargs):
        super().__init__(layer=layer, data_source=DataSource.SENTINEL1_IW, **kwargs)
github sentinel-hub / eo-learn / io / eolearn / io / sh_input.py View on Github external
def __init__(self, layer, resx=None, resy=None, **kwargs):
        super().__init__(layer=layer, data_source=DataSource.SENTINEL2_L1C, service_type=ServiceType.WCS,
                         size_x=resx, size_y=resy, **kwargs)
github sentinel-hub / eo-learn / io / eolearn / io / sh_input.py View on Github external
def __init__(self, layer, width=None, height=None, **kwargs):
        super().__init__(layer=layer, data_source=DataSource.LANDSAT8, service_type=ServiceType.WMS,
                         size_x=width, size_y=height, **kwargs)