/// <summary> /// Note: the returned geometry may not be valid in the case of multigeometies /// </summary> /// <returns>Note: the returned geometry may not be valid in the case of multigeometies</returns> public string AsSqlServerWkt() { StringBuilder result = new StringBuilder("POLYGON("); for (int i = 0; i < NumberOfParts; i++) { result.Append(string.Format("{0},", SqlServerWktMapFunctions.PointGroupElementToWkt(ShapeHelper.GetEsriPoints(this, this.Parts[i])))); } return(result.Remove(result.Length - 1, 1).Append(")").ToString()); }
public string AsSqlServerWkt() { if (this.NumberOfParts > 1) { StringBuilder result = new StringBuilder("MULTILINESTRING("); for (int i = 0; i < NumberOfParts; i++) { result.Append(string.Format("{0},", SqlServerWktMapFunctions.PointGroupElementToWkt(ShapeHelper.GetPoints(this, this.Parts[i])))); } return(result.Remove(result.Length - 1, 1).Append(")").ToString()); } else { return(string.Format("LINESTRING{0}", SqlServerWktMapFunctions.PointGroupElementToWkt(ShapeHelper.GetPoints(this, this.Parts[0])))); } }