Skip to main content

Hello,


I can’t access the Landsat level 2 catalog:(I have read everything here I could about the topic, and it doesn’t work.)


this the config I’m using:


SHConfig(
instance_id='Data_TfS',
sh_client_id='hidden',
sh_client_secret='hidden',
sh_base_url='services-uswest2.sentinel-hub.com',
sh_auth_base_url='https://services.sentinel-hub.com',
geopedia_wms_url='https://service.geopedia.world',
geopedia_rest_url='https://www.geopedia.world/rest',
aws_access_key_id='',
aws_secret_access_key='',
aws_session_token='',
aws_metadata_url='https://roda.sentinel-hub.com',
aws_s3_l1c_bucket='sentinel-s2-l1c',
aws_s3_l2a_bucket='sentinel-s2-l2a',
opensearch_url='http://opensearch.sentinel-hub.com/resto/api/collections/Sentinel2',
max_wfs_records_per_query=100,
max_opensearch_records_per_query=500,
max_download_attempts=4,
download_sleep_time=5,
download_timeout_seconds=120.0,
number_of_download_processes=1

and the code I run:


resolution = (100,100)
betsiboka_bbox = BBox(bbox=betsiboka_coords_wgs84, crs=CRS.WGS84)
betsiboka_size = bbox_to_dimensions(betsiboka_bbox, resolution=resolution)
time_interval = "2016-01-01", "2016-01-30"
time_difference = dt.timedelta(hours=1)

search_iterator = catalog.search(
DataCollection.LANDSAT_OT_L2,
bbox=betsiboka_bbox,
time=time_interval,
query={"eo:cloud_cover": {"lt": 100}},
fields={"include": u"id", "properties.datetime", "properties.eo:cloud_cover"], "exclude": u]},
)
results = list(search_iterator)

the result is:



MissingSchema: Invalid URL ‘services-uswest2.sentinel-hub.com/api/v1/catalog/search/api/v1/catalog/search’: No schema supplied. Perhaps you meant http://services-uswest2.sentinel-hub.com/api/v1/catalog/search/api/v1/catalog/search?



(I’ve had many other results during the day as I’ve tried several sh_base_url)

In your config the https:// is ommited. As suggested by the error message, please try using


config.sh_base_url = 'https://services-uswest2.sentinel-hub.com/'


Thanks


I did try it before. just to make sure, did it again:


  sh_base_url='https://services-uswest2.sentinel-hub.com/',
sh_auth_base_url='https://services.sentinel-hub.com',
geopedia_wms_url='https://service.geopedia.world',
geopedia_rest_url='https://www.geopedia.world/rest',
aws_access_key_id='',
aws_secret_access_key='',
aws_session_token='',
aws_metadata_url='https://roda.sentinel-hub.com',
aws_s3_l1c_bucket='sentinel-s2-l1c',
aws_s3_l2a_bucket='sentinel-s2-l2a',
opensearch_url='http://opensearch.sentinel-hub.com/resto/api/collections/Sentinel2',
max_wfs_records_per_query=100,
max_opensearch_records_per_query=500,
max_download_attempts=4,
download_sleep_time=5,
download_timeout_seconds=120.0,
number_of_download_processes=1

and the error:
MissingSchema: Invalid URL 'services-uswest2.sentinel-hub.com/api/v1/catalog/search/api/v1/catalog/search': No schema supplied. Perhaps you meant http://services-uswest2.sentinel-hub.com/api/v1/catalog/search/api/v1/catalog/search?


ok , more info:
this works:
catalog = SentinelHubCatalog(config=config)
betsiboka_coords_wgs84 = [13.05,41.75,13.25,41.9]
config.sh_base_url='services-uswest2.sentinel-hub.com/api/v1/catalog/collections/landsat-ot-l2 '


resolution = (100,19730)
betsiboka_bbox = BBox(bbox=betsiboka_coords_wgs84, crs=CRS.WGS84)
betsiboka_size = bbox_to_dimensions(betsiboka_bbox, resolution=resolution)
time_interval = "2016-01-01", "2016-01-30"
time_difference = dt.timedelta(hours=1)

search_iterator = catalog.search(
DataCollection.LANDSAT_OT_L2,
bbox=betsiboka_bbox,
time=time_interval,
query={"eo:cloud_cover": {"lt": 100}},
fields={"include": ["id", "properties.datetime", "properties.eo:cloud_cover"], "exclude": []},
)
results = list(search_iterator)

with these results:



results

Out[103]:

[{‘id’: ‘LC08_L2SP_191031_20160125_20200907_02_T1’,

‘properties’: {‘datetime’: ‘2016-01-25T09:53:27.532Z’,

‘eo:cloud_cover’: 3.74}},

{‘id’: ‘LC08_L2SP_190031_20160118_20200907_02_T1’,

‘properties’: {‘datetime’: ‘2016-01-18T09:47:17.181Z’,

‘eo:cloud_cover’: 29.91}},

{‘id’: ‘LC08_L2SP_191031_20160109_20200907_02_T1’,

‘properties’: {‘datetime’: ‘2016-01-09T09:53:26.748Z’,

‘eo:cloud_cover’: 36.08}},

{‘id’: ‘LC08_L2SP_190031_20160102_20200907_02_T2’,

‘properties’: {‘datetime’: ‘2016-01-02T09:47:17.885Z’,

‘eo:cloud_cover’: 99.91}}]



but only once.

second time it failed

with this error:
MissingSchema: Invalid URL 'services-uswest2.sentinel-hub.com/api/v1/catalog/collections/landsat-ot-l2\t/api/v1/catalog/search': No schema supplied. Perhaps you meant http://services-uswest2.sentinel-hub.com/api/v1/catalog/collections/landsat-ot-l2 /api/v1/catalog/search?


weird


please declare the config as a first thing before proceeding to avoid overwritting . Seems to be the case that the base url is overwritten somewhere in the loop.


This should work


uswest_config = SHConfig()
uswest_config.sh_base_url = "https://services-uswest2.sentinel-hub.com"
uswest_catalog = SentinelHubCatalog(config=uswest_config)

betsiboka_coords_wgs84 = [13.05,41.75,13.25,41.9]
resolution = (100,19730)
.......

thank you. it does work now.


Reply