Example #1
0
        /// <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());
        }
Example #2
0
        public string AsSqlServerWkt()
        {
            StringBuilder result = new StringBuilder("MULTILINESTRING(");

            for (int i = 0; i < NumberOfParts; i++)
            {
                result.Append(
                    string.Format("{0},",
                                  SqlServerWktMapFunctions.PointZGroupElementToWkt(
                                      ShapeHelper.GetPoints(this, i), ShapeHelper.GetZValues(this, i), ShapeHelper.GetMeasures(this, this.Parts[i]))));
            }

            return(result.Remove(result.Length - 1, 1).Append(")").ToString());
        }
Example #3
0
        public string AsSqlServerWkt()
        {
            //StringBuilder result = new StringBuilder("MULTIPOINT(");

            //for (int i = 0; i < NumberOfPoints - 1; i++)
            //{
            //    result.Append(string.Format(" {0} {1} {2} {3},", this.Points[i].X, this.Points[i].Y, this.ZValues[i], this.Measures[i] == ShapeConstants.NoDataValue ? "NULL" : this.Measures[i].ToString()));
            //}

            //result.Append(string.Format(" {0} {1} {2} {3})",
            //                                this.Points[NumberOfPoints - 1].X,
            //                                this.Points[NumberOfPoints - 1].Y,
            //                                this.ZValues[NumberOfPoints - 1],
            //                                this.Measures[NumberOfPoints - 1] == ShapeConstants.NoDataValue ? "NULL" : this.Measures[NumberOfPoints - 1].ToString()));

            //return result.ToString();
            return(string.Format("MULTIPOINT{0}", SqlServerWktMapFunctions.PointZGroupElementToWkt(this.Points, this.ZValues, this.Measures)));
        }
Example #4
0
 public string AsSqlServerWkt()
 {
     return(string.Format(
                "MULTIPOINT({0})",
                string.Join(",", this.points.Select(i => string.Format("({0})", SqlServerWktMapFunctions.SinglePointElementToWkt(i))).ToArray())));
 }