当前位置: 首页>>代码示例>>Python>>正文


Python SSUtilities.returnOutputSpatialRef方法代码示例

本文整理汇总了Python中SSUtilities.returnOutputSpatialRef方法的典型用法代码示例。如果您正苦于以下问题:Python SSUtilities.returnOutputSpatialRef方法的具体用法?Python SSUtilities.returnOutputSpatialRef怎么用?Python SSUtilities.returnOutputSpatialRef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SSUtilities的用法示例。


在下文中一共展示了SSUtilities.returnOutputSpatialRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import returnOutputSpatialRef [as 别名]
    def __init__(self, inputFC, templateFC = None, explicitSpatialRef = None,
                 silentWarnings = False, useChordal = True):
        #### Validate Input Feature Class ####
        ERROR.checkFC(inputFC)
        try:
            self.inPath, self.inName = OS.path.split(inputFC)
        except:
            self.inPath = None
            self.inName = inputFC

        #### Validate Template FC ####
        if templateFC != None:
            if ARCPY.Exists(templateFC) == False:
                templateFC = None

        #### ShapeFile Boolean ####
        self.shapeFileBool = False
        if self.inPath:
            self.shapeFileBool = UTILS.isShapeFile(inputFC)

            #### Create Feature Layer if LYR File ####
            path, ext = OS.path.splitext(inputFC)
            if ext.upper() == ".LYR":
                tempFC = "SSDO_FeatureLayer"
                DM.MakeFeatureLayer(inputFC, tempFC)
                inputFC = tempFC

        #### Describe Input ####
        self.info = ARCPY.Describe(inputFC)

        #### Assure Input are Features with OIDs ####
        if not self.info.hasOID:
            ARCPY.AddIDMessage("ERROR", 339, self.inName)
            raise SystemExit()

        #### Assign Describe Objects to Class Attributes ####
        self.inputFC = inputFC
        self.catPath = self.info.CatalogPath
        self.shapeType = self.info.ShapeType
        self.oidName = self.info.oidFieldName
        self.dataType = self.info.DataType
        self.shapeField = self.info.ShapeFieldName
        self.templateFC = templateFC
        self.hasM = self.info.HasM
        self.hasZ = self.info.HasZ
        self.silentWarnings = silentWarnings

        #### Set Initial Extent Depending on DataType ####
        if self.dataType in ["FeatureLayer", "Layer"]:
            try:
                tempInfo = ARCPY.Describe(self.catPath)
                extent = tempInfo.extent
            except:
                #### in_memory, SDE, NetCDF etc... ####
                extent = self.info.extent
            self.fidSet = self.info.FIDSet
            if self.fidSet == "":
                self.selectionSet = False
            else:
                self.selectionSet = True
        else:
            extent = self.info.extent
            self.fidSet = ""
            self.selectionSet = False
        self.extent = extent

        #### Set Spatial Reference ####
        inputSpatRef = self.info.SpatialReference
        inputSpatRefName = inputSpatRef.name
        if explicitSpatialRef:
            #### Explicitely Override Spatial Reference ####
            self.templateFC = None
            self.spatialRef = explicitSpatialRef
        else:
            #### 1. Feature Dataset, 2. Env Setting, 3. Input Hierarchy ####
            self.spatialRef = UTILS.returnOutputSpatialRef(inputSpatRef,
                                                  outputFC = templateFC)
        self.spatialRefString = UTILS.returnOutputSpatialString(self.spatialRef)
        self.spatialRefName = self.spatialRef.name
        self.spatialRefType = self.spatialRef.type

        #### Warn if Spatial Reference Changed ####
        if not silentWarnings:
            UTILS.compareSpatialRefNames(inputSpatRefName, self.spatialRefName)

        #### Check for Projection ####
        if self.spatialRefType.upper() != "PROJECTED":
            if self.spatialRefType.upper() == "GEOGRAPHIC":
                self.useChordal = useChordal
                if not explicitSpatialRef:
                    if self.useChordal:
                        ARCPY.AddIDMessage("WARNING", 1605)
                    else:
                        ARCPY.AddIDMessage("WARNING", 916)
            else:
                self.useChordal = False
                if not explicitSpatialRef:
                    ARCPY.AddIDMessage("WARNING", 916)
        else:
            self.useChordal = False
#.........这里部分代码省略.........
开发者ID:rvinc66,项目名称:ArcGISRuntimeBook,代码行数:103,代码来源:SSDataObject.py


注:本文中的SSUtilities.returnOutputSpatialRef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。