Quantcast
Channel: SQL Server Spatial forum
Viewing all articles
Browse latest Browse all 364

How do you create a buffer of a geometry in SQL Server 2012?

$
0
0

Hello,

I am new to SQL Server 2012 and spatial data. I built a geometry object of coordinates from a polygon that I stored in a database.  The code is below:

DECLARE @digb GEOMETRY;
SET @digb = GEOMETRY::STGeomFromText('POLYGON ((-79.927138 40.362654, -79.91883 40.364224, -79.915966 40.361067, -79.917897 40.359266, -79.927398 40.360142, -79.927138 40.362654))', 4269);

I am using SRID 4269 (Latitude/Longitude NAD83).  I have no issues getting this geometry to load properly when the query is executed. (shown below)

My problem is that I am unable to create a valid buffer of 150 feet on this geometry.  I have tried using these 3 statements below (I assumed BufferWithCurves() would be the one that would work); however, ALL of them returned to an invalid buffer of the polygon (shown below):

-     DECLARE @digbb GEOMETRY = @digb.STBuffer(2);
-     DECLARE @digbb GEOMETRY = @digb.BufferWithCurves(2)
-     DECLARE @digbb GEOMETRY = @digb.BufferWithTolerance(@BufferSize,250.0,1);



Does anyone have any idea of how creating this buffer of a geometry object (polygon mentioned above) in SQL Server 2012? 

Thanks in advance for any help.
Nick



Viewing all articles
Browse latest Browse all 364

Trending Articles