當前位置: 首頁>>代碼示例>>Python>>正文


Python Multipoint.as_geojson方法代碼示例

本文整理匯總了Python中karta.vector.geometry.Multipoint.as_geojson方法的典型用法代碼示例。如果您正苦於以下問題:Python Multipoint.as_geojson方法的具體用法?Python Multipoint.as_geojson怎麽用?Python Multipoint.as_geojson使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在karta.vector.geometry.Multipoint的用法示例。


在下文中一共展示了Multipoint.as_geojson方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_write_data_crs

# 需要導入模塊: from karta.vector.geometry import Multipoint [as 別名]
# 或者: from karta.vector.geometry.Multipoint import as_geojson [as 別名]
 def test_write_data_crs(self):
     capitols = Multipoint([Point((-112.1, 33.57), crs=LonLatWGS84),
                            Point((-121.5, 38.57), crs=LonLatWGS84),
                            Point((-84.42, 33.76), crs=LonLatWGS84),
                            Point((-86.15, 39.78), crs=LonLatWGS84),
                            Point((-112.0, 46.6), crs=LonLatWGS84),
                            Point((-82.99, 39.98), crs=LonLatWGS84),
                            Point((-77.48, 37.53), crs=LonLatWGS84),
                            Point((-95.69, 39.04), crs=LonLatWGS84),
                            Point((-71.02, 42.33), crs=LonLatWGS84),
                            Point((-96.68, 40.81), crs=LonLatWGS84),
                            Point((-97.51, 35.47), crs=LonLatWGS84),
                            Point((-134.2, 58.37), crs=LonLatWGS84),
                            Point((-100.3, 44.38), crs=LonLatWGS84)])
     s = capitols.as_geojson()
開發者ID:jmjak86,項目名稱:karta,代碼行數:17,代碼來源:vector_io_tests.py

示例2: test_write_string_data

# 需要導入模塊: from karta.vector.geometry import Multipoint [as 別名]
# 或者: from karta.vector.geometry.Multipoint import as_geojson [as 別名]
 def test_write_string_data(self):
     capitols = Multipoint(
         [Point((-112.1, 33.57), data={"n": "Phoenix, Arizona"}),
          Point((-121.5, 38.57), data={"n": "Sacramento, California"}),
          Point((-84.42, 33.76), data={"n": "Atlanta, Georgia"}),
          Point((-86.15, 39.78), data={"n": "Indianapolis, Indiana"}),
          Point((-112.0, 46.6,) , data={"n": "Helena, Montana"}),
          Point((-82.99, 39.98), data={"n": "Columbus, Ohio"}),
          Point((-77.48, 37.53), data={"n": "Richmond, Virginia"}),
          Point((-95.69, 39.04), data={"n": "Topeka, Kansas"}),
          Point((-71.02, 42.33), data={"n": "Boston, Massachusetts"}),
          Point((-96.68, 40.81), data={"n": "Lincoln, Nebraska"})])
     s = capitols.as_geojson(urn="urn:ogc:def:crs:EPSG::5806")
     ans = """{ "properties": { "n": [ "Phoenix, Arizona", "Sacramento, California", "Atlanta, Georgia", "Indianapolis, Indiana", "Helena, Montana", "Columbus, Ohio", "Richmond, Virginia", "Topeka, Kansas", "Boston, Massachusetts", "Lincoln, Nebraska" ] }, "bbox": [ [ -121.5, -71.02 ], [ 33.57, 46.6 ] ], "type": "Feature", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::5806" } }, "geometry": { "type": "MultiPoint", "coordinates": [ [ -112.1, 33.57 ], [ -121.5, 38.57 ], [ -84.42, 33.76 ], [ -86.15, 39.78 ], [ -112.0, 46.6 ], [ -82.99, 39.98 ], [ -77.48, 37.53 ], [ -95.69, 39.04 ], [ -71.02, 42.33 ], [ -96.68, 40.81 ] ] }, "id": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] } """
     self.verifyJson(s, ans)
     return
開發者ID:jmjak86,項目名稱:karta,代碼行數:18,代碼來源:vector_io_tests.py

示例3: test_write_data_crs

# 需要導入模塊: from karta.vector.geometry import Multipoint [as 別名]
# 或者: from karta.vector.geometry.Multipoint import as_geojson [as 別名]
 def test_write_data_crs(self):
     capitols = Multipoint([Point((-112.1, 33.57), crs=LonLatWGS84),
                            Point((-121.5, 38.57), crs=LonLatWGS84),
                            Point((-84.42, 33.76), crs=LonLatWGS84),
                            Point((-86.15, 39.78), crs=LonLatWGS84),
                            Point((-112.0, 46.6), crs=LonLatWGS84),
                            Point((-82.99, 39.98), crs=LonLatWGS84),
                            Point((-77.48, 37.53), crs=LonLatWGS84),
                            Point((-95.69, 39.04), crs=LonLatWGS84),
                            Point((-71.02, 42.33), crs=LonLatWGS84),
                            Point((-96.68, 40.81), crs=LonLatWGS84),
                            Point((-97.51, 35.47), crs=LonLatWGS84),
                            Point((-134.2, 58.37), crs=LonLatWGS84),
                            Point((-100.3, 44.38), crs=LonLatWGS84)])
     s = capitols.as_geojson()
     self.assertTrue("crs" in s)
     self.assertTrue('"name": "urn:ogc:def:crs:OGC:1.3:CRS84"' in s)
     return
開發者ID:fortyninemaps,項目名稱:karta,代碼行數:20,代碼來源:geojson_tests.py


注:本文中的karta.vector.geometry.Multipoint.as_geojson方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。