使用空间数据刀片的 IBM Informix

发布于 2024-08-26 19:04:45 字数 199 浏览 4 评论 0原文

我需要在我的项目中使用 IBM Informix,其中我有点坐标,并且需要查找查询矩形区域中存在哪些点。

Informix 具有带有 ST_POINT 和 ST_POLYGON 数据对象的空间 datablade 模块。 我知道如何在具有此类对象的表上创建、插入和创建 r 树索引。

但问题是如何执行 SELECT 语句,列出特定矩形区域中的所有点。

I need to use IBM Informix for my project where I have point coordinates and I need to find which points are present in query rectangular region.

Informix has spatial datablade module with ST_POINT and ST_POLYGON data objects.
I know how to create, insert and create r-tree index on tables with such objects.

But problem is how to do a SELECT statement, something which list all the points in a particular rectangular region.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千と千尋 2024-09-02 19:04:45

您已经掌握了 Spatial Datablade 文档吗?它位于 IDS 11.50 信息中心

例如,第 1 章中的部分讨论了执行空间查询:

执行空间查询

GIS 应用程序中的一项常见任务是检索空间数据的可见子集以在窗口中显示。最简单的方法是定义一个表示窗口边界的多边形,然后使用 SE_EnvelopesIntersect() 函数查找与该窗口重叠的所有空间对象:

SELECT name, type, zone FROM sensitive_areas
   WHERE SE_EnvelopesIntersect(zone, 
      ST_PolyFromText('polygon((20000 20000,60000 20000,60000 60000,20000 60000,20000 20000))', 5));

查询还可以在 SQL WHERE 子句中使用空间列来限定结果集;空间列根本不需要位于结果集中。例如,如果敏感区域距危险废物场 5 英里以内,则以下 SQL 语句将检索每个敏感区域及其附近的危险废物场。 ST_Buffer() 函数生成一个圆形多边形,表示每个危险位置周围五英里的半径。 ST_Buffer() 函数返回的 ST_Polygon 几何形状成为 ST_Overlaps() 函数的参数,如果sensitive_areas 表的区域 ST_Polygon 与 ST_Buffer() 函数生成的 ST_Polygon 重叠,则该函数返回 t (TRUE):

SELECT sa.name sensitive_area, hs.name hazardous_site
   FROM sensitive_areas sa, hazardous_sites hs
   WHERE ST_Overlaps(sa.zone, ST_Buffer(hs.location, 26400));


sensitive_area  Summerhill Elementary School
hazardous_site  Landmark Industrial

sensitive_area  Johnson County Hospital
hazardous_site  Landmark Industrial 

You've got the Spatial Datablade documentation at your fingertips? It is available in the IDS 11.50 Info Centre.

For example, the section in Chapter 1 discusses performing spatial queries:

Performing Spatial Queries

A common task in a GIS application is to retrieve the visible subset of spatial data for display in a window. The easiest way to do this is to define a polygon representing the boundary of the window and then use the SE_EnvelopesIntersect() function to find all spatial objects that overlap this window:

SELECT name, type, zone FROM sensitive_areas
   WHERE SE_EnvelopesIntersect(zone, 
      ST_PolyFromText('polygon((20000 20000,60000 20000,60000 60000,20000 60000,20000 20000))', 5));

Queries can also use spatial columns in the SQL WHERE clause to qualify the result set; the spatial column need not be in the result set at all. For example, the following SQL statement retrieves each sensitive area with its nearby hazardous waste site if the sensitive area is within five miles of a hazardous site. The ST_Buffer() function generates a circular polygon representing the five-mile radius around each hazardous location. The ST_Polygon geometry returned by the ST_Buffer() function becomes the argument of the ST_Overlaps() function, which returns t (TRUE) if the zone ST_Polygon of the sensitive_areas table overlaps the ST_Polygon generated by the ST_Buffer() function:

SELECT sa.name sensitive_area, hs.name hazardous_site
   FROM sensitive_areas sa, hazardous_sites hs
   WHERE ST_Overlaps(sa.zone, ST_Buffer(hs.location, 26400));


sensitive_area  Summerhill Elementary School
hazardous_site  Landmark Industrial

sensitive_area  Johnson County Hospital
hazardous_site  Landmark Industrial 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文