• 大小: 0.82KB
    文件类型: .txt
    金币: 1
    下载: 0 次
    发布日期: 2021-03-26
  • 语言: 其他
  • 标签: 存储过程  

资源简介

USE [NSA]
GO
/****** Object:  StoredProcedure [dbo].[BufferSelect] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[BufferSelect]
@WKT varchar(2000),
@startPt varchar(30),
@Buffer int,
@OrderbyX int
AS
begin
declare @stPt geometry;
set @stPt=geometry::STGeomFromText(@startPt,4326);
declare @urplace GEOGRAPHY;
set @urplace= GEOGRAPHY::STGeomFromText(@WKT,4326);
declare @bufArea GEOGRAPHY
set @bufArea = @urplace.STBuffer(3);
declare @bufArea2 geometry
set @bufArea2=geometry::STGeomFromWKB(@bufArea.STAsBinary(),4326)
select  p.*,l.LineID as LineName,l.Path as LinePath from SVPoint p left join SVLine l on p.LineID=l.LineID inner join (
select ptID as PointID, PtGeo from SVPointGeo where PtGeo.Filter(@bufArea2)=1 
) g on p.PointID= g.PointID order by g.PtGeo.STDistance(@stPt)

资源截图

代码片段和文件信息

评论

共有 条评论