本文简要介绍 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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
