如何使用来自2个不同表的STBuffer和STInteresct创建新的数据库表?

时间:2019-03-18 22:48:55

标签: sql sqlgeography

我正在尝试进行一些站点集水量分析,我想创建一个新表,其位置在距已知点特定半径内。

我目前正在使用下面的代码钓鱼,但没有成功。 SiteLocation和HHlocation是我要用作STBuffer和STIntersect函数的参考点的2个单独表中的地理点列。

SELECT Top 10        
[dbo].[Households].[LocationID] AS 'HH ID', 
null AS 'Site ID', 
[dbo].[Households].[HHLocation] AS 'HH Point',
null AS 'Site Point'
*[dbo].[Households].[HHLocation].STBuffer(5 * 1000) as 'Dynamic Buffer'
FROM [Households] union all

SELECT Top 10        
null AS 'HH ID', 
[dbo].[Sites].[LocationID] AS 'Site ID', 
null AS 'HH Point',
[dbo].[Sites].[SiteLocation] AS 'Site Point',
null as 'Dynamic Buffer'
from [Sites]
*ON [dbo].[Sites].[SiteLocation].STIntersects([dbo].[Households].[HHLocation].STBuffer(5 * 1000)) = 1

0 个答案:

没有答案