本文簡要介紹 python 語言中 arcgis.geometry.to_geo_coordinate_string 的用法。
用法:
arcgis.geometry.to_geo_coordinate_string(spatial_ref, coordinates, conversion_type, conversion_mode='mgrsDefault', num_of_digits=None, rounding=True, add_spaces=True, gis=None, future=False)返回:
字符串數組或
GeometryJob對象。如果future = True,則結果是Future對象。調用result()獲取響應。>>> strings = from_geo_coordinate_string(spatial_ref = "wkid", coordinates = [[x1,y1], [x2,y2], [x3,y3]] conversion_type = "MGRS", conversion_mode = "mgrs_default", future = False) >>> strings ["01N AA 66021 00000","11S NT 00000 62155", "31U BT 94071 65288"]
to_geo_coordinate_string函數在Geometry服務資源上執行。該函數根據User提供的轉換類型和SpatialReference將 xy-coordinates 數組轉換為眾所周知的字符串。可選參數可用於某些轉換類型。有關相反轉換的更多信息,請參閱from_geo_coordinate_strings。注意:
如果可選參數不適用於特定轉換類型,但為該參數提供了值,則該值將被忽略。
Keys
Description
spatial_ref
輸入幾何圖形的
SpatialReference眾所周知的 ID 或 JSON 對象coordinates
要轉換的 JSON 格式的 xy-coordinates 數組。語法:[[x1,y2],…[xN,yN]]
conversion-type
輸入字符串的轉換類型。
注意:有效的轉換類型為:
MGRS- 軍事網格參考係統USNG- 美國國家網格UTM- 通用橫軸墨卡托GeoRef- 世界地理參考係統GARS- 全局區域參考係統DMS- 度分第二個DDM- 十進製度分DD- 十進製度conversion_mode
MGRS、UTM 和 GARS 轉換類型的轉換選項。
注意:MGRS 的有效轉換模式為:
mgrsDefault- 默認值。使用給定空間參考中的球體。mgrsNewStyle- 將所有球體視為新球體,如 WGS 1984。80 度經度屬於 60 區。mgrsOldStyle- 將所有球體視為舊球體,如 Bessel 1841。180 度經度屬於 60 區。mgrsNewWith180InZone01- 與 mgrsNewStyle 相同,但 180 度經度屬於 01 區mgrsOldWith180InZone01- 與 mgrsOldStyle 相同,但 180 度經度屬於 01 區注意:UTM 的有效轉換模式為:
utmDefault- 默認值。沒有選項。utmNorthSouth- 使用北/南緯度指示器而不是zone numbers- 非標準。推薦默認num_of_digits
為字符串中的每個數字部分輸出的位數。
num_of_digits的默認值取決於conversion_type。rounding
如果
True,則字符串的數字部分將四舍五入到 num_of_digits 指定的最接近的整數幅度。否則,字符串的數字部分將被截斷。舍入參數僅適用於轉換類型MGRS、USNG和GeoRef。默認值為True。addSpaces
如果
True,則在字符串的組件之間添加空格。addSpaces參數僅適用於轉換類型MGRS、USNG和UTM。MGRS的默認值為False,而USNG和UTM的默認值為True。future
可選布爾值。如果為 True,則將返回 future 對象,並且進程不會等待任務完成。默認為False,表示等待結果。
相關用法
- Python ArcGIS train_classifier用法及代碼示例
- Python ArcGIS tanh用法及代碼示例
- Python ArcGIS tan用法及代碼示例
- Python ArcGIS threshold用法及代碼示例
- Python ArcGIS train_random_trees_regression_model用法及代碼示例
- Python ArcGIS trace_downstream用法及代碼示例
- Python ArcGIS times用法及代碼示例
- Python arcgis.learn.train_model用法及代碼示例
- Python ArcGIS trim_extend用法及代碼示例
- Python ArcGIS power用法及代碼示例
- Python ArcGIS APIKeyManager.get用法及代碼示例
- Python ArcGIS KnowledgeGraph.named_object_type_delete用法及代碼示例
- Python ArcGIS ContentManager.unshare_items用法及代碼示例
- Python ArcGIS ImageryLayer.thumbnail用法及代碼示例
- Python ArcGIS FormFieldElement用法及代碼示例
- Python ArcGIS Geometry.true_centroid用法及代碼示例
- Python ArcGIS Site.delete用法及代碼示例
- Python ArcGIS GeoAccessor.bbox用法及代碼示例
- Python arcgis.apps.hub.Initiative.update用法及代碼示例
- Python ArcGIS generate_service_areas用法及代碼示例
- Python ArcGIS build_overview用法及代碼示例
- Python ArcGIS RunInterval用法及代碼示例
- Python ArcGIS describe_dataset用法及代碼示例
- Python ArcGIS acos用法及代碼示例
- Python ArcGIS Item.publish用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.geometry.to_geo_coordinate_string。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
