나는, 더 효율적인 방법이 될 수있다 SqlGeographyBuilder를 사용하는 방법을 발견하지만,이 작품 :
List<SqlGeography> areaPolygons = GetAreaPolygons()
SqlGeography multiPoly = null;
SqlGeographyBuilder sqlbuilder = new SqlGeographyBuilder();
sqlbuilder.SetSrid(4326);
sqlbuilder.BeginGeography(OpenGisGeographyType.MultiPolygon);
foreach (SqlGeography geog in areaPolygons)
{
sqlbuilder.BeginGeography(OpenGisGeographyType.Polygon);
for (int i = 1; i <= geog.STNumPoints(); i++)
{
if (i == 1)
sqlbuilder.BeginFigure((double)geog.STPointN(i).Lat, (double)geog.STPointN(i).Long);
else
sqlbuilder.AddLine((double)geog.STPointN(i).Lat, (double)geog.STPointN(i).Long);
}
sqlbuilder.EndFigure();
sqlbuilder.EndGeography();
}
sqlbuilder.EndGeography();
multiPoly = sqlbuilder.ConstructedGeography;