本文整理汇总了Python中sentinelsat.SentinelAPI._format_url方法的典型用法代码示例。如果您正苦于以下问题:Python SentinelAPI._format_url方法的具体用法?Python SentinelAPI._format_url怎么用?Python SentinelAPI._format_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sentinelsat.SentinelAPI
的用法示例。
在下文中一共展示了SentinelAPI._format_url方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_format_url_custom_api_url
# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import _format_url [as 别名]
def test_format_url_custom_api_url():
api = SentinelAPI("user", "pw", api_url='https://scihub.copernicus.eu/dhus/')
url = api._format_url()
assert url.startswith('https://scihub.copernicus.eu/dhus/search')
api = SentinelAPI("user", "pw", api_url='https://scihub.copernicus.eu/dhus')
url = api._format_url()
assert url.startswith('https://scihub.copernicus.eu/dhus/search')
示例2: test_format_url
# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import _format_url [as 别名]
def test_format_url():
api = SentinelAPI(**_api_auth)
start_row = 0
url = api._format_url(offset=start_row)
assert url == 'https://scihub.copernicus.eu/apihub/search?format=json&rows={rows}&start={start}'.format(
rows=api.page_size, start=start_row)
limit = 50
url = api._format_url(limit=limit, offset=start_row)
assert url == 'https://scihub.copernicus.eu/apihub/search?format=json&rows={rows}&start={start}'.format(
rows=limit, start=start_row)
url = api._format_url(limit=api.page_size + 50, offset=start_row)
assert url == 'https://scihub.copernicus.eu/apihub/search?format=json&rows={rows}&start={start}'.format(
rows=api.page_size, start=start_row)
url = api._format_url(order_by="beginposition desc", limit=api.page_size + 50, offset=10)
assert url == 'https://scihub.copernicus.eu/apihub/search?format=json&rows={rows}&start={start}' \
'&orderby={orderby}'.format(rows=api.page_size, start=10,
orderby="beginposition desc")
示例3: test_format_url
# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import _format_url [as 别名]
def test_format_url():
api = SentinelAPI(**_api_auth)
start_row = 0
url = api._format_url(start_row=start_row)
assert url == 'https://scihub.copernicus.eu/apihub/search?format=json&rows={rows}&start={start}'.format(
rows=api.page_size, start=start_row)