Showing posts with label Spatial Types. Show all posts
Showing posts with label Spatial Types. Show all posts

Monday, October 28, 2013

C# Create DbGeography Point in Entity Framework

public DbGeography GeoPoint(Double latitude, Double longitude)
{
//Assembly Microsoft.SqlServer.Types.dll, v11.0.0.0
       SqlGeography sqlGeo = SqlGeography.Point(latitude, longitude, 4326);

       //Assembly System.Data.Entity.dll, v4.0.0.0
       DbGeography dbGeom = DbGeography.FromText(sqlGeo.ToString(), 4326);

       return dbGeom;

}

Monday, October 21, 2013

Sql Server Spatial Geography Draw Circle

declare @circular geography = geography::STGeomFromText('CIRCULARSTRING(0 4, 4 0, 8 4, 4 8, 0 4)', 4326)

select @circular