Beispiel #1
0
 //MULTIPOINT((0 0),(1 2))
 public static string ToWkt(PointBag2 <double> geom)
 {
     if (geom != null)
     {
         StringBuilder sb = new StringBuilder();
         sb.Append("MULTIPOINT(");
         for (uint i = 0; i < geom.VertexCount; i++)
         {
             sb.Append('(');
             sb.Append(geom[i].X);
             sb.Append(' ');
             sb.Append(geom[i].Y);
             sb.Append("),");
         }
         if (geom.VertexCount > 0)
         {
             sb[sb.Length - 1] = ')'; //replace last paren
         }
         else
         {
             sb.Append(')'); //empty case
         }
         return(sb.ToString());
     }
     return(string.Empty);
 }
Beispiel #2
0
 public PointBag2(PointBag2 <T> other)
 {
     if (other == null)
     {
         throw new ArgumentNullException();
     }
     this.Points = other.Points;
 }
Beispiel #3
0
        public static JObject ToGeoJson(PointBag2 <double> geom)
        {
            if (geom == null)
            {
                return((JObject)null);
            }
            JObject jobject = new JObject();

            jobject.Add("type", (JToken) new JValue("MultiPoint"));
            JArray jarray = new JArray();

            foreach (Point2 <double> point in geom)
            {
                jarray.Add((JToken) new JArray()
                {
                    (JToken) new JValue(point.X),
                    (JToken) new JValue(point.Y)
                });
            }
            jobject.Add("coordinates", (JToken)jarray);
            return(jobject);
        }
Beispiel #4
0
 public int CompareTo(PointBag2 <T> other)
 {
     throw new NotImplementedException();
 }
Beispiel #5
0
 public bool Equals(PointBag2 <T> other)
 {
     throw new NotImplementedException();
 }