MS SQL Server 2008 空间索引 - 它有效吗?
有没有人尝试过使用它并且可以说它是否实施得很好?
-- Assaf(过去几周他对 MySQL 对 OpenGIS 功能的实现不足感到越来越沮丧,现在正在考虑切换到 MSSQL)
Has anyone tried using it and can say if it's well implemented?
-- Assaf (who spent the last few weeks getting increasingly frustrated with MySQL's deficient implementation of OpenGIS functions and is now considering switching to MSSQL)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,它有效,我这里有一些示例代码 使用地理数据类型的 SQL Server 2008 邻近搜索
Yes it works, I have some sample code here SQL Server 2008 Proximity Search With The Geography Data Type
是的。 它们得到正确实施。 您还可以选择 PostgreSQL 的 PostGIS,Oracle Spatial。 Informix 和 DB2 也有空间类型的实现。
Yes. They are implemented correctly. You also have PostgreSQL's PostGIS as an option, Oracle Spatial. Informix and DB2 also have implementations of a spatial type.
是的,它们起作用了。
我刚刚将我的一个类从使用 ISpatialFilter 的基于 ESRI-ArcObject 的查询切换到返回相同数据的 SqlCommand。 这是邻近搜索(返回距离 x 点 1000 英尺以内的任何记录)。
起初,ESRI 查询仍然更快,但这是由于构造不良的 where 子句导致效率非常低(我仍在学习如何使用 SQLSVR2008 中的空间函数)。
经过一些调整,我的 SQL 方法比 ESRI 方法快,但也快不了多少。 然后我将搜索距离提高到 10000 英尺,然后我看到了差异。 SQL Server 2008 方法要快得多。
(ESRI) 搜索附近客户所用时间(秒):1.503
(SQL2008) 查询附近客户所用时间(秒):0.925
虽然速度差异与索引无关,但与 ESRI-ArcObjects 有关。 在我的 ESRI 方法中,我从 IProximityOperator 和 IPoint 获取距离、x 和 y。 在SQL2008方法中,我让数据库完成所有工作:SHAPE.STX作为X,SHAPE.STY作为Y,SHAPE.STDistance(但是ArcObject开发人员知道所有这些开销)。
到目前为止我印象深刻。
Yes, they work.
I just switched one my classes from an ESRI-ArcObject-based query using ISpatialFilter to a SqlCommand that returns the same data. It's a proximity search (return any records that are within 1000 feet of point x).
At first the ESRI query was still faster but that was due to a poorly constructed where clause that was very ineffecient (I'm still learning how to use the spatial functions in SQLSVR2008).
After some tweaking,my SQL method was faster than the ESRI method but not by much. Then I jacked my search distance up to 10000 feet and then I saw the difference. The SQL Server 2008 method was a lot faster.
(ESRI) Search Nearby Customers Elapsed Time(sec): 1.503
(SQL2008) Query Nearby Customers Elapsed Time(sec): 0.925
Although the speed differences don't have to do with the indexes, but with ESRI-ArcObjects. In my ESRI method, I'm getting my distance, x, and y from IProximityOperator and IPoint. In the SQL2008 method, I'm letting the database do all of the work: SHAPE.STX as X ,SHAPE.STY as Y ,SHAPE.STDistance(but the ArcObject developers know all about that overhead).
I'm impressed so far.