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


Python AIUtils.isDict方法代碼示例

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


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

示例1: fromStr

# 需要導入模塊: from arccore.utils.AIUtils import AIUtils [as 別名]
# 或者: from arccore.utils.AIUtils.AIUtils import isDict [as 別名]
 def fromStr(self, attrs):
     obj = None
     if AIUtils.isStr(attrs):
         attrs = AIUtils.str2dict(attrs)
         obj = self
         if AIUtils.isDict(attrs):
             for key in attrs:
                 func = getattr(obj, 'set' + AIStrUtils.toUpperF(key))
                 if AIUtils.isFunc(func):
                     apply(func, [attrs[key]])
     else:
         raise Exception('input parameter type not correct!')
     
     return obj
開發者ID:Chandler0591,項目名稱:mygis,代碼行數:16,代碼來源:AIBean.py

示例2: toStr

# 需要導入模塊: from arccore.utils.AIUtils import AIUtils [as 別名]
# 或者: from arccore.utils.AIUtils.AIUtils import isDict [as 別名]
 def toStr(self, obj):
     result = None
     if not AIUtils.isEmpty(obj):
         attrs = dir(obj)
         result = []
         for attr in attrs:
             if attr.startswith('get'):
                 prop = AIStrUtils.toLowerF(attr[3:])
                 func = getattr(obj, attr)
                 value = apply(func, [])
                 # 判斷類型,不同的字符串轉換方式
                 propValue = AIUtils.list2str(value) if AIUtils.isList(value) \
                 else AIUtils.dict2str(value) if AIUtils.isDict(value) \
                 else ('\'' + AIUtils.toStr(value) + '\'') if AIUtils.isStr(value) \
                 else AIUtils.toStr(value)
                 result.append('\'' + prop + '\':' + propValue + '')
         result = '{' + ','.join(result) + '}'
     else:
         raise Exception('input parameter type not correct!')
     
     return result
開發者ID:Chandler0591,項目名稱:mygis,代碼行數:23,代碼來源:AIBean.py

示例3: if

# 需要導入模塊: from arccore.utils.AIUtils import AIUtils [as 別名]
# 或者: from arccore.utils.AIUtils.AIUtils import isDict [as 別名]
 fcDict = AIUtils.str2dict(param2)
 keys = fcDict.keys()
 fcName = None if 'name' not in keys else fcDict['name']
 fcAlias = None if 'alias' not in keys else fcDict['alias']
 fcFtype = None if 'ftype' not in keys else fcDict['ftype']
 fcWkid = None if 'wkid' not in keys else fcDict['wkid']
 fcFds = None if 'fds' not in keys else fcDict['fds']
 fcFields = None if 'fields' not in keys else fcDict['fields']
 
 try:
     if not AIUtils.isEmpty(fcName):
         fcName = fcName if ('.' in fcName) else fcName if AIUtils.isEmpty(sdeUsername) else (sdeUsername + '.') + fcName
         fcFtype = 'All' if AIUtils.isEmpty(fcFtype) else fcFtype
         # 要素集名稱
         fdsName = None
         if AIUtils.isDict(fcFds) and not AIUtils.isEmpty(fcFds['name']):
             fdsName = fcFds['name']
             fdsName = fdsName if ('.' in fdsName) else fdsName if AIUtils.isEmpty(sdeUsername) else (sdeUsername + '.') + fdsName
             try:
                 if not AIUtils.isEmpty(fdsName):
                     fdsName = fdsName if ('.' in fdsName) else fdsName if AIUtils.isEmpty(sdeUsername) else (sdeUsername + '.') + fdsName
                     datasets = arcpy.ListDatasets(fdsName, 'Feature')
                     if len(datasets) > 0 and not AIUtils.isEmpty(datasets[0]):
                         dataset = datasets[0]
                         desc = arcpy.Describe(dataset)
                         sr = desc.spatialReference
                         fcFds = {'name' : AIUtils.unicode2utf8(desc.name), 'wkid' : None if AIUtils.isEmpty(sr) else sr.factoryCode}
             except Exception as e:        
                 logger.info(unicode(e.message).encode("utf-8"))
                 logger.info('要素集' + fdsName + '查詢失敗')
         
開發者ID:Chandler0591,項目名稱:mygis,代碼行數:32,代碼來源:queryFc.py

示例4: if

# 需要導入模塊: from arccore.utils.AIUtils import AIUtils [as 別名]
# 或者: from arccore.utils.AIUtils.AIUtils import isDict [as 別名]
 param2 = param2.replace('true', 'True')
 param2 = param2.replace('false', 'False')
 fcDict = AIUtils.str2dict(param2)
 keys = fcDict.keys()
 fcName = None if 'name' not in keys else fcDict['name']
 fcAlias = None if 'alias' not in keys else fcDict['alias']
 fcFtype = None if 'ftype' not in keys else fcDict['ftype']
 fcWkid = None if 'wkid' not in keys else fcDict['wkid']
 fcFds = None if 'fds' not in keys else fcDict['fds']
 fcFields = None if 'fields' not in keys else fcDict['fields']
 
 try:
     if not AIUtils.isEmpty(fcName) and not AIUtils.isEmpty(fcFtype):
         # 要素集名稱
         fdsName = None
         if AIUtils.isDict(fcFds) and 'name' in fcFds.keys() and not AIUtils.isEmpty(fcFds['name']):
             fdsName = fcFds['name']
             fdsName = fdsName if ('.' in fdsName) else fdsName if AIUtils.isEmpty(sdeUsername) else (sdeUsername + '.') + fdsName
         wksName = sdeOutFullName if AIUtils.isEmpty(fdsName) else os.path.join(sdeOutFullName, fdsName).replace('\\', '/')
         fcWkid = 4326 if not AIUtils.isInt(fcWkid) else fcWkid
         # 創建要素類
         arcpy.CreateFeatureclass_management(wksName, fcName, fcFtype, None, "DISABLED", "DISABLED", arcpy.SpatialReference(fcWkid))
         # 更改別名
         if not AIUtils.isEmpty(fcAlias):
             arcpy.AlterAliasName(fcName, fcAlias)
         # 添加字段(排除保留字段)
         if AIUtils.isList(fcFields):
             for field in fcFields:
                 keys = field.keys()
                 fldName = AIStrUtils.toUpper(field['name'])
                 if not AIStrUtils.isEqual(fldName, 'OBJECTID') and \
開發者ID:Chandler0591,項目名稱:mygis,代碼行數:33,代碼來源:addFc.py


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