22,209
社区成员
发帖
与我相关
我的任务
分享
declare @geo1 geography;
declare @geo2 geography;
declare @location geography;
set @geo1 = geography::Parse('POLYGON ((123.398815 41.745468, 123.404743 41.747406, 123.408013 41.739925, 123.400863 41.740544, 123.400827 41.740544, 123.398815 41.745468, 123.398815 41.745468))');
set @geo2 = geography::Parse('POLYGON ((123.43333 41.762615, 123.435755 41.76392, 123.440948 41.763315, 123.43854 41.7594, 123.43333 41.762615, 123.43333 41.762615))');
set @location = geography::Parse('POINT (123.415183 41.756125)');
select @location.STIntersects(@geo1), @location.STIntersects(@geo2);
select @geo1.STIntersects(@location), @geo2.STIntersects(@location);
select @geo1.STContains(@location), @geo2.STContains(@location);
declare @geo1 geography;
declare @geo2 geography;
declare @location geography;
set @geo1 = geography::Parse('POLYGON ((123.398815 41.745468, 123.404743 41.747406, 123.408013 41.739925, 123.400863 41.740544, 123.400827 41.740544, 123.398815 41.745468, 123.398815 41.745468))');
set @geo2 = geography::Parse('POLYGON ((123.43333 41.762615, 123.435755 41.76392, 123.440948 41.763315, 123.43854 41.7594, 123.43333 41.762615, 123.43333 41.762615))');
set @location = geography::Parse('POINT (123.415183 41.756125)');
set @geo1 = @geo1.ReorientObject();
set @geo2 = @geo2.ReorientObject();
select @location.STIntersects(@geo1), @location.STIntersects(@geo2);
select @geo1.STIntersects(@location), @geo2.STIntersects(@location);
select @geo1.STContains(@location), @geo2.STContains(@location);