本文整理汇总了Python中sentinelsat.SentinelAPI.to_geodataframe方法的典型用法代码示例。如果您正苦于以下问题:Python SentinelAPI.to_geodataframe方法的具体用法?Python SentinelAPI.to_geodataframe怎么用?Python SentinelAPI.to_geodataframe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sentinelsat.SentinelAPI
的用法示例。
在下文中一共展示了SentinelAPI.to_geodataframe方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_missing_dependency_dataframe
# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import to_geodataframe [as 别名]
def test_missing_dependency_dataframe(monkeypatch):
api = SentinelAPI("mock_user", "mock_password")
with pytest.raises(ImportError):
monkeypatch.setitem(sys.modules, "pandas", None)
api.to_dataframe({"test":"test"})
with pytest.raises(ImportError):
monkeypatch.setitem(sys.modules, "geopandas", None)
api.to_geodataframe({"test":"tst"})
示例2: test_to_geopandas
# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import to_geodataframe [as 别名]
def test_to_geopandas(products):
gdf = SentinelAPI.to_geodataframe(products)
assert type(gdf).__name__ == 'GeoDataFrame'
print(gdf.unary_union.area)
assert gdf.unary_union.area == pytest.approx(89.6, abs=0.1)
assert len(gdf) == len(products)
assert gdf.crs == {'init': 'epsg:4326'}
示例3: test_to_geopandas
# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import to_geodataframe [as 别名]
def test_to_geopandas(products):
gdf = SentinelAPI.to_geodataframe(products)
assert abs(gdf.unary_union.area - 132.16) < 0.01
示例4: test_to_geopandas_empty
# 需要导入模块: from sentinelsat import SentinelAPI [as 别名]
# 或者: from sentinelsat.SentinelAPI import to_geodataframe [as 别名]
def test_to_geopandas_empty(products):
gdf = SentinelAPI.to_geodataframe({})
assert type(gdf).__name__ == 'GeoDataFrame'
assert len(gdf) == 0