本文整理汇总了Python中karta.vector.geometry.Point.as_geojson方法的典型用法代码示例。如果您正苦于以下问题:Python Point.as_geojson方法的具体用法?Python Point.as_geojson怎么用?Python Point.as_geojson使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类karta.vector.geometry.Point
的用法示例。
在下文中一共展示了Point.as_geojson方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_point_write_cartesian
# 需要导入模块: from karta.vector.geometry import Point [as 别名]
# 或者: from karta.vector.geometry.Point import as_geojson [as 别名]
def test_point_write_cartesian(self):
p = Point((100.0, 0.0), crs=Cartesian)
s = p.as_geojson(urn="urn:ogc:def:crs:EPSG::5806", force_wgs84=False)
ans = """{"properties": {},"bbox": [100.0, 0.0, 100.0, 0.0],
"geometry": {"coordinates": [100.0, 0.0], "type": "Point"},
"type": "Feature",
"crs": {"properties": {"name": "urn:ogc:def:crs:EPSG::5806"}, "type": "name"} }"""
self.verifyJSON(s, ans)
return
示例2: test_point_write
# 需要导入模块: from karta.vector.geometry import Point [as 别名]
# 或者: from karta.vector.geometry.Point import as_geojson [as 别名]
def test_point_write(self):
p = Point((100.0, 0.0), crs=LonLatWGS84)
s = p.as_geojson(urn="urn:ogc:def:crs:EPSG::5806")
ans = """{"properties": {}, "bbox": [100.0, 0.0, 100.0, 0.0], "geometry": {"coordinates": [100.0, 0.0], "type": "Point"}, "type": "Feature", "crs": {"properties": {"name": "urn:ogc:def:crs:EPSG::5806"}, "type": "name"}}"""
self.verifyJSON(s, ans)
return