使用ArcPy连接到ESRI ArcSDE 10.2 for Oracle(Connecting to ESRI ArcSDE 10.2 for Oracle with ArcPy)
我有一个运行ArcPy 10.0的Python脚本通过连接文件连接到SDE for Oracle。 一切都很好但是当ArcGIS(ArcPy)升级到10.2.1时,我无法获得ArcPy函数来返回任何结果。 我可以使用ArcCatalog通过相同的连接文件连接到数据库。 尝试对同一个连接文件运行ArcPy函数时没有错误,但我仍然没有得到任何结果。
例如:
arcpy.ListFeatureClasses()
返回一个空列表。
任何可能导致这种情况的指针都将非常感激。
I had a Python script running ArcPy 10.0 connecting to SDE for Oracle through connection files. Everything worked great but when ArcGIS (ArcPy) was upgraded to 10.2.1 I can't get the ArcPy functions to return any results. I can connect to the database through the same connection file using ArcCatalog. I get no errors when trying to run an ArcPy function against the same connection file but I still get no results.
For example:
arcpy.ListFeatureClasses()
returns an empty list.
Any pointers for what might be causing this would be greatly appreciated.
原文:https://stackoverflow.com/questions/24642018
更新时间:2020-02-03 08:48
最满意答案
结果证明这是ArcPy版本之间的不匹配。 ArcGIS Engine安装在ArcGIS Desktop之后,ArcGIS Desktop安装了新的64位版本的Python2.7 / ArcPy。 64位ArcPy在这种情况下不起作用,因此行为很奇怪。 我不确定为什么这个64位版本甚至会被安装,如果它不能正常工作但我认为必须有一个原因。 这里带回家是为了确保您使用32位版本的ArcPy。
This turned out to be a mismatch between versions of ArcPy. ArcGIS Engine was installed after ArcGIS Desktop which installed a new 64 bit version of Python2.7/ArcPy. 64bit ArcPy does NOT work in this context and so was the reason why the behavior was strange. I am not sure why this 64bit version would even be installed if it doesn't work correctly but I assume there must be a reason. The take home here is to make sure you are using a 32bit version of ArcPy.
2014-07-10
相关问答
第一步、下载并解压ArcSDE。ArcSDE最好下载10.0系列的,对arcgis10.0和9.3系列的都能兼容。解压后如下图。 第二步、因为本级安装的是oracle11G数据库,所有直接选择目录下的ArcSDEoracle11G64的文件夹。当然运行ersi.exe然后在选择也可以 第三步、点击setup.exe运行安装ArcSDEoracle11G64 。 第四步、开始安装弹出同意用户使用协议窗口,点击同意后,点击下一步进行安装。 第六步、指定软件安装路径,或者使用默认安装路径,点击下一步进行
...
如果您启用了PLW错误,您会提前注意到情况 - 您将得到“远离类型”错误的转换。 我重新编写了你的查询: SELECT t.period,
t.asset_cost_company_code,
t.asset_cost_center_id,
t.depreciation_account_id,
add.description,
pd.project_num,
pd.project_name,
ROU
...
EXP和IMP很古老 - 除非你绝对必须,否则不要使用它们。 它们无法处理较新Oracle版本的某些功能。 选择的工具是EXPDP和IMPDP(EXP数据泵和IMP数据泵的简称)。 不幸的是,使用它们有点复杂,因为您只能在数据库服务器上运行它们(与可以从任何客户端计算机运行的旧式EXP / IMP相反)。 因此,要将您的架构从11g源数据库获取到10g目标数据库,您必须: 在11g数据库服务器上打开终端会话 运行expdp,版本设置为10(这样您就可以在10g服务器上导入它) 将11g服务器的转储
...
这是10.2.2 SDE SDK的错误。 BUG-000087489 。 Java 1.6绝对不会有这个问题。 这是我使用的解决方法。 您还可以尝试Java 1.7或1.8的较低版本。 This is a bug with the 10.2.2 SDE SDK. BUG-000087489. Java 1.6 will definitely not have this problem. That's the workaround I use. You could also try lower re
...
我可以看到两个问题。 首先,df = arcpy.ListDataFrames(mxd)[0]需要是arcpy.mapping.ListDataFrames(mxd)[0] 其次可能是主要问题,arcpy.mapping.ListLayers(mxd,df)当前正在传递df作为通配符,请参阅以下语法: ListLayers (map_document_or_layer, {wildcard}, {data_frame})
你需要输入一个额外的空白通配符arg,即arcpy.mapping.Lis
...
是的,ArcView仅限于在文件和个人地理数据库中进行编辑。 您需要ArcEditor或更高版本的许可证才能编辑ArcSDE。 请参阅本页上的“使用ArcView进行编辑”一节。 Yes, ArcView is restricted to editing in file and personal geodatabases. You need an ArcEditor or higher license to edit ArcSDE. See the section "Editing with Ar
...
首先,我假设您正在使用Progress的Oracle DataServer。 如果是这种情况,请记住,所有USE-INDEX将在生成的查询中基本上转换为ORDER BY,因此主要用于命令不访问数据。 如果您想知道如何访问您的信息,则需要在连接到架构持有者时启用qt_debug ,这样您就可以打印许多有关如何将进度代码转换为SQL以访问Oracle DB的信息。 您需要分析这些SQL(SQL EXPLAIN作为示例)以查看查询的性能以及它们如何访问数据库。 First I assume you ar
...
结果证明这是ArcPy版本之间的不匹配。 ArcGIS Engine安装在ArcGIS Desktop之后,ArcGIS Desktop安装了新的64位版本的Python2.7 / ArcPy。 64位ArcPy在这种情况下不起作用,因此行为很奇怪。 我不确定为什么这个64位版本甚至会被安装,如果它不能正常工作但我认为必须有一个原因。 这里带回家是为了确保您使用32位版本的ArcPy。 This turned out to be a mismatch between versions of Arc
...
问题是我使用的是版本化数据库。 删除版本全部再次工作。 The problem was I was using a versioned database. Removing the version all worked again.
如果每个记录都有XY,则只需在数据库中查询提供的地址(使用SqlDataReader或任何其他类型的数据库访问技术),并使用它来缩放到正确的坐标。 此外,您使用的是什么API用于地图。 我假设它是ESRI(即Flex for ArcGIS)。 我认为你实际上可以在ESRI的api中包含一个控件,它提供了一个地理编码服务,你可以使用它从你的数据库中获取坐标。 If you have the X Y for each record, you could just query the database
...