本文整理汇总了Python中nansat.domain.Domain.get_border_geojson方法的典型用法代码示例。如果您正苦于以下问题:Python Domain.get_border_geojson方法的具体用法?Python Domain.get_border_geojson怎么用?Python Domain.get_border_geojson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nansat.domain.Domain
的用法示例。
在下文中一共展示了Domain.get_border_geojson方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_border_geojson
# 需要导入模块: from nansat.domain import Domain [as 别名]
# 或者: from nansat.domain.Domain import get_border_geojson [as 别名]
def test_border_geojson(self):
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
expected_geojson = '{ "type": "Polygon", "coordinates": [ [ [ 25.0, 72.0 ],' \
' [ 26.0, 72.0 ], [ 27.0, 72.0 ], [ 28.0, 72.0 ], [ 29.0, 72.0 ], ' \
'[ 30.0, 72.0 ], [ 31.0, 72.0 ], [ 32.0, 72.0 ], [ 33.0, 72.0 ],' \
' [ 34.0, 72.0 ], [ 35.0, 72.0 ], [ 35.0, 72.0 ], [ 35.0, 71.8 ], ' \
'[ 35.0, 71.6 ], [ 35.0, 71.4 ], [ 35.0, 71.2 ], [ 35.0, 71.0 ],' \
' [ 35.0, 70.8 ], [ 35.0, 70.6 ], [ 35.0, 70.4 ], [ 35.0, 70.2 ], ' \
'[ 35.0, 70.0 ], [ 35.0, 70.0 ], [ 34.0, 70.0 ], [ 33.0, 70.0 ], ' \
'[ 32.0, 70.0 ], [ 31.0, 70.0 ], [ 30.0, 70.0 ], [ 29.0, 70.0 ], ' \
'[ 28.0, 70.0 ], [ 27.0, 70.0 ], [ 26.0, 70.0 ], [ 25.0, 70.0 ], ' \
'[ 25.0, 70.0 ], [ 25.0, 70.2 ], [ 25.0, 70.4 ], [ 25.0, 70.6 ],' \
' [ 25.0, 70.8 ], [ 25.0, 71.0 ], [ 25.0, 71.2 ], [ 25.0, 71.4 ], ' \
'[ 25.0, 71.6 ], [ 25.0, 71.8 ], [ 25.0, 72.0 ] ] ] }'
border_geojson = d.get_border_geojson()
self.assertIsInstance(border_geojson, str)
self.assertEqual(border_geojson, expected_geojson)