资 源 简 介
USE [NSA]GO/****** Object: StoredProcedure [dbo].[BufferSelect] ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOALTER PROCEDURE [dbo].[BufferSelect]@WKT varchar(2000),@startPt varchar(30),@Buffer int,@OrderbyX intASbegindeclare @stPt geometry;set @stPt=geometry::STGeomFromText(@startPt,4326);declare @urplace GEOGRAPHY;set @urplace= GEOGRAPHY::STGeomFromText(@WKT,4326);declare @bufArea GEOGRAPHYset @bufArea = @urplace.STBuffer(3);declare @bufArea2 geometryset @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)