ListTransformations

摘要

返回有效变换方法列表。 对于某个特定的地理区域,可以使用区域范围来缩小有效变换方法列表的范围。

最合适的变换通常是返回列表中的第一个。 该列表按数据与变换使用区域的重叠数量进行排序。 如果两个或多个变换与数据的重叠数量相同,则变换精度值将用作辅助排序参数。

了解有关地理基准面变换的详细信息

语法

ListTransformations (from_sr, to_sr, {extent}, {vertical}, {first_only})
参数说明数据类型
from_sr

The starting geographic coordinate system. This can be specified with a SpatialReference object, the name of the spatial reference, or a path to a projection file (.prj).

SpatialReference
to_sr

The final geographic coordinate system. This can be specified with a SpatialReference object, the name of the spatial reference, or a path to a projection file (.prj).

SpatialReference
extent

Only transformations that span the entire extent will be returned. The extent needs to be specified in coordinates from the from_sr. When working with data, the extent on a Describe object can be used.

Extent
vertical

Specifies whether to return a list of vertical or horizontal transformations. By default, the function returns transformations that ignore vertical coordinate systems on the from_sr and to_sr.

The function returns only one type of transformation. If set to False, horizontal transformations will be returned; if set to True, vertical transformations will be returned.

To use True, both the from_sr and to_sr arguments must have a vertical coordinate system.

To use a transformation result as input to the Project tool, the tool's vertical parameter must be set appropriately to NO_VERTICAL or VERTICAL to match the transformation.

(默认值为 False)

Boolean
first_only

Specifies whether to limit the list of transformations to a single item or return all valid transformations. This is a performance optimization.

(默认值为 False)

Boolean
返回值
数据类型说明
String

作为字符串的有效变换方法的列表。

代码示例

ListTransformations 示例

使用 ListTransformations 函数确定可用于从一个坐标系投影到另一个坐标系的有效变换。

import arcpy

from_sr = arcpy.SpatialReference('WGS 1984')
to_sr = arcpy.SpatialReference('NAD 1927 StatePlane California VI FIPS 0406')

extent = arcpy.Extent(-178.217598182, 18.9217863640001,
                      -66.969270909, 71.4062354550001)
transformations = arcpy.ListTransformations(from_sr, to_sr, extent)

相关主题