Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Geography maximum limit reached
Message
 
To
11/11/2013 09:14:56
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01587737
Message ID:
01587827
Views:
81
This message has been marked as the solution to the initial question of the thread.
>If I execute this SQL, I obtain 2493 records:
>
>
>DECLARE @GeographyCoordinate Geography
>DECLARE @Area Geography
>
>SET @GeographyCoordinate=Geography::Point(47.79208,-65.71996,4326)
>SET @Area=@GeographyCoordinate.STBuffer(9931*1000)
>
>SELECT Company.PrimaryKey,@GeographyCoordinate.STDistance(Geography)/1000 AS Distance 
>FROM Company 
>WHERE @Area.STIntersects(Company.Geography)=1
>
>
>However, if I add one kilometer:
>
>
>DECLARE @GeographyCoordinate Geography
>DECLARE @Area Geography
>
>SET @GeographyCoordinate=Geography::Point(47.79208,-65.71996,4326)
>SET @Area=@GeographyCoordinate.STBuffer(9932*1000)
>
>SELECT Company.PrimaryKey,@GeographyCoordinate.STDistance(Geography)/1000 AS Distance 
>FROM Company 
>WHERE @Area.STIntersects(Company.Geography)=1
>
>
>...it cannot find any more record.
>
>Is this a limit of the buffer?


From BOL:

STBuffer (geography Data Type)

distance
Is a value of type float (double in the .NET Framework) specifying the distance from the geography instance around
which to calculate the buffer.

The maximum distance of the buffer cannot exceed 0.999 * π * minorAxis * minorAxis / majorAxis (~0.999 * 1/2 Earth’s
circumference) or the full globe.


So, maybe 9931*1000 exceed max distance, becuase
DECLARE @GeographyCoordinate Geography
DECLARE @Area Geography

SET @GeographyCoordinate=Geography::Point(47.79208,-65.71996,4326)
SET @Area=@GeographyCoordinate.STBuffer(9931*1000)

SELECT @Area
shows NULL as a result.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform