Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

ASP.NET - scratching discs of code & entrepreneurship

Archive · View All
January 2012 8
April 2011 6
March 2011 4
August 2012 2
June 2011 2
May 2012 1
May 2011 1

John Katsiotis's Blog

Using SqlGeographyBuilder to construct a LineString

May 18 2012 12:00AM by John Katsiotis   

When you need to construct a LineString object from C# you can use the SqlGeographyBuilder class located in the Microsoft.SqlServer.Types dll to help you do it. This is how:

var points = ...;//a list of points that you want to add;
var firstPoint = points[0];
var builder = new SqlGeographyBuilder();
builder.SetSrid(4326);
builder.BeginGeography(OpenGisGeographyType.LineString);
builder.BeginFigure(firstPoint.Lat, firstPoint.Lng);
points.GetRange(1, points.Count - 1).ForEach(point => builder.AddLine(point.Lat, point.Lng));
builder.EndFigure();
builder.EndGeography();
var lineString = builder.ConstructedGeography;

 

Cheers!


Republished from djsolid - scratching discs of code & entrepreneurship [19 clicks].  Read the original version here [0 clicks].

John Katsiotis
989 · 0% · 26
1 Readers Liked this
Guru Samy Liked this on 5/22/2012 11:48:00 PM
Profile · Blog
1
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"Using SqlGeographyBuilder to construct a LineString" rated 5 out of 5 by 1 readers
Using SqlGeographyBuilder to construct a LineString , 5.0 out of 5 based on 1 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]