ArcGIS10.1使用QueryLayer空间查询为空的问题

106 篇文章 0 订阅
99 篇文章 0 订阅

问题描述:

       我的目地是空间数据与属性数据做关联,使用ArcGIS提供的QueryLayer对象,但是发现一个问题,我可以创建相关的QueryLayer对象,但是我在使用Identify和拉框查询都查询不到结果。但是要素类在ArcMap可以进行空间查询。


而且同时有两个客户都有相同的问题,环境都是一样的,ArcGIS10.1,遇到的问题都是一样的。


问题分析:

碰到类似的问题,做空间查询,因为用户是使用了Oracle数据库,我就跟踪了后台的Trace文件。


Tips:ArcSDE性能分析——跟踪Oracle的Trace文件

PARSING IN CURSOR #24 len=183 dep=0 uid=91 oct=3 lid=91 tim=6720275108 hv=3771019214 ad='7ff2b5f0998' sqlid='68khff3hcabyf'
select * from (select * from lichuan where objectid<3) a where SDE.st_intersects(SHAPE,SDE.st_geometry(:st1,:st2,:st3,:st4,:st5,:st6,:st7,:st8,:st9,:st10,:st11,:st12,:st13,:st14)) = 1
END OF STMT
PARSE #24:c=15625,e=6

看到这个Trace文件,发现在对QueryLayer进行空间查询使用了ST_Intersects 函数,使用空间SQL,肯定是要配置ST_Geometry的。


ArcSDE10.1配置Oracle 监听器来使用SQL操作ST_Geometry

怎么配置 Oracle 侦听器来使用SQL操作ST_Geometry


查询一下ArcGIS10.1的QueryLayer帮助

http://resources.arcgis.com/en/help/main/10.1/index.html#/Preparing_to_use_query_layers/00s500000032000000/

Oracle databases
Two spatial types are supported in Oracle that you can use in your query layers: ST_Geometry and SDO_Geometry.

The ST_Geometry spatial type is installed when you create an enterprise geodatabase in Oracle or can be installed in an Oracle database using the Create Spatial Type geoprocessing tool. You also need to configure the Oracle EXTPROC to use ST_Geometry. Your GIS administrator or DBA can tell you if your database has been configured to use this spatial type. For information on configuring the EXTPROC, see Configuring the Oracle listener to use SQL and your Oracle documentation.

Oracle Locator objects, including the SDO_Geometry type, are present by default in Oracle databases. Therefore, you can access the SDO_Geometry type without additional installations. However, to access all SDO_Geometry functions, you may need to install Oracle Spatial in the DBMS.

Install on your client computer the Oracle Net application. You can obtain the Oracle Instant Client from the Esri Customer Care portal or get the Instant or full client from Oracle.

For information on installing and configuring the Oracle client, see Oracle's documentation set.
从帮助上可以看到,使用QueryLayer需要配置空间SQL,但是ArcGIS10版本的时候,并没有这个要求。

--------------------------------------------------------------------------------------------
版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

Blog:               http://blog.csdn.net/linghe301
Weibo:            http://www.weibo.com/linghe301
--------------------------------------------------------------------------------------------


其实对QueryLayer对象相简单说明一下:

一开始设计QueryLayer对象,最主要的目的是让ArcGIS客户端可以连接非ArcSDE的数据,比如Oracle的Oracle Spatial、SQL Server的Geometry或者Geography存储的数据,但是因为它可以自定义SQL语句,那么好多用户就觉得QueryLayer来进行关联数据也是一个不错的选择。


关于更多QueryLayer的了解:


从上面的描述我们可以看到

1:如果是要素类加载到ArcMap进行空间查询,是不需要配置空间SQL的,它是会将数据与查询图层的矩形包络线进行查询,然后在前台再进行过滤。

2:如果要素类创建的QueryLayer在ArcMap进行空间查询,那么就是用了空间SQL函数进行查询。


--------------------------------------------------------------------------------------------
版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

Blog:               http://blog.csdn.net/linghe301
Weibo:            http://www.weibo.com/linghe301
--------------------------------------------------------------------------------------------



所以用户问题的核心就是使用QueryLayer没有配置空间SQL,其实用户进行关联,有多种选择,比如Join,比如ArcSDE视图等都是一个和不错的选择。


Tips:ArcSDE视图的查询方式跟桌面查询要素类的方式是一样的。


我的另外一个用户配置完毕之后还是不能空间查询,因为刚好前几天碰到的一个Bug:

[Bug]ArcSDE10.1执行ST_Geometry大数据量的大范围查询范围结果为0


删除空间索引,能够查询,重建空间索引,能够查询,所以在ArcGIS10.1使用QueryLayer进行空间查询还是有相关的问题的。


我个人的建议:

1:升级ArcGIS10.2

2:使用ArcSDE视图代替QueryLayer

Tips:sdetable -o create_view


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值