当前位置: 首页>>代码示例>>Python>>正文


Python SentinelAPI.to_geojson方法代码示例

本文整理汇总了Python中sentinelsat.SentinelAPI.to_geojson方法的典型用法代码示例。如果您正苦于以下问题:Python SentinelAPI.to_geojson方法的具体用法?Python SentinelAPI.to_geojson怎么用?Python SentinelAPI.to_geojson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sentinelsat.SentinelAPI的用法示例。


在下文中一共展示了SentinelAPI.to_geojson方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_footprints_s2

# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import to_geojson [as 别名]
def test_footprints_s2(products):
    footprints = SentinelAPI.to_geojson(products)
    for footprint in footprints['features']:
        assert not footprint['geometry'].errors()

    with open(FIXTURES_DIR + '/expected_search_footprints_s2.geojson') as geojson_file:
        expected_footprints = geojson.loads(geojson_file.read())
    # to compare unordered lists (JSON objects) they need to be sorted or changed to sets
    assert set(footprints) == set(expected_footprints)
开发者ID:NiklasKeck,项目名称:sentinelsat,代码行数:11,代码来源:test_mod.py

示例2: test_footprints_s2

# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import to_geojson [as 别名]
def test_footprints_s2(products):
    footprints = SentinelAPI.to_geojson(products)
    for footprint in footprints['features']:
        validation = geojson.is_valid(footprint['geometry'])
        assert validation['valid'] == 'yes', validation['message']

    with open('tests/expected_search_footprints_s2.geojson') as geojson_file:
        expected_footprints = geojson.loads(geojson_file.read())
    # to compare unordered lists (JSON objects) they need to be sorted or changed to sets
    assert set(footprints) == set(expected_footprints)
开发者ID:ibamacsr,项目名称:sentinelsat,代码行数:12,代码来源:test_mod.py

示例3: test_footprints_s1

# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import to_geojson [as 别名]
def test_footprints_s1():
    api = SentinelAPI(**_api_auth)
    products = api.query(
        geojson_to_wkt(read_geojson(FIXTURES_DIR + '/map.geojson')),
        (datetime(2014, 10, 10), datetime(2014, 12, 31)), producttype="GRD"
    )

    footprints = api.to_geojson(products)
    for footprint in footprints['features']:
        assert not footprint['geometry'].errors()

    with open(FIXTURES_DIR + '/expected_search_footprints_s1.geojson') as geojson_file:
        expected_footprints = geojson.loads(geojson_file.read())
    # to compare unordered lists (JSON objects) they need to be sorted or changed to sets
    assert set(footprints) == set(expected_footprints)
开发者ID:NiklasKeck,项目名称:sentinelsat,代码行数:17,代码来源:test_mod.py

示例4: test_footprints_s1

# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import to_geojson [as 别名]
def test_footprints_s1():
    api = SentinelAPI(**_api_auth)
    products = api.query(
        geojson_to_wkt(read_geojson('tests/map.geojson')),
        datetime(2014, 10, 10), datetime(2014, 12, 31), producttype="GRD"
    )

    footprints = api.to_geojson(products)
    for footprint in footprints['features']:
        validation = geojson.is_valid(footprint['geometry'])
        assert validation['valid'] == 'yes', validation['message']

    with open('tests/expected_search_footprints_s1.geojson') as geojson_file:
        expected_footprints = geojson.loads(geojson_file.read())
    # to compare unordered lists (JSON objects) they need to be sorted or changed to sets
    assert set(footprints) == set(expected_footprints)
开发者ID:ibamacsr,项目名称:sentinelsat,代码行数:18,代码来源:test_mod.py


注:本文中的sentinelsat.SentinelAPI.to_geojson方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。