internal static Geometries.MultiPoint ToSharpMapMultiPoint(MultiPoint multiPoint) { Geometries.MultiPoint collection = new Geometries.MultiPoint(); foreach (GisSharpBlog.NetTopologySuite.Geometries.Point point in multiPoint.Geometries) { collection.Points.Add(ToSharpMapPoint(point)); } return(collection); }
private static IMultiPoint ReadMultiPoint(JsonTextReader jreader) { if (jreader == null) { throw new ArgumentNullException("reader", "A valid JSON reader object is required."); } IMultiPoint points = null; if (jreader.TokenClass == JsonTokenClass.Array) { jreader.ReadToken(JsonTokenClass.Array); List <IPoint> list = new List <IPoint>(); while (jreader.TokenClass == JsonTokenClass.Array) { ICoordinate item = new GisSharpBlog.NetTopologySuite.Geometries.Coordinate(); Read(ref item, jreader); list.Add(new GisSharpBlog.NetTopologySuite.Geometries.Point(item)); } jreader.ReadToken(JsonTokenClass.EndArray); points = new GisSharpBlog.NetTopologySuite.Geometries.MultiPoint(list.ToArray()); } return(points); }
private static MultiPoint ReadMultiPoint(ref MultiPoint points, TextReader reader) { if (reader == null) throw new ArgumentNullException("reader", "A valid text reader object is required."); JsonTextReader jreader = new JsonTextReader(reader); return ReadMultiPoint(jreader); }
private static MultiPoint ReadMultiPoint(JsonTextReader jreader) { if (jreader == null) throw new ArgumentNullException("reader", "A valid JSON reader object is required."); MultiPoint points = null; if (jreader.TokenClass == JsonTokenClass.Array) { jreader.ReadToken(JsonTokenClass.Array); List<Point> list = new List<Point>(); while (jreader.TokenClass == JsonTokenClass.Array) { Coordinate item = new Coordinate(); Read(ref item, jreader); list.Add(new Point(item)); } jreader.ReadToken(JsonTokenClass.EndArray); points = new MultiPoint(list.ToArray()); } return points; }
public static void Write(MultiPoint points, TextWriter writer) { if (points == null) return; if (writer == null) throw new ArgumentNullException("writer", "A valid text writer object is required."); JsonTextWriter jwriter = new JsonTextWriter(writer); Write(points, jwriter); }
public static void Write(MultiPoint points, JsonTextWriter jwriter) { if (points == null) return; if (jwriter == null) throw new ArgumentNullException("jwriter", "A valid JSON writer object is required."); jwriter.WriteStartObject(); jwriter.WriteMember("type"); jwriter.WriteString("MultiPoint"); jwriter.WriteMember("coordinates"); jwriter.WriteStartArray(); foreach (Coordinate entry in points.Coordinates) { Write(entry, jwriter); } jwriter.WriteEndArray(); jwriter.WriteEndObject(); }
public void GetHashCodeShoulBeComputed() { var multiPoint = new MultiPoint(new[] { new Point(1.0, 2.0), new Point(3.0, 4.0) }); Assert.AreEqual(2024009049, multiPoint.GetHashCode()); }
internal static Geometries.MultiPoint ToSharpMapMultiPoint(MultiPoint multiPoint) { Geometries.MultiPoint collection = new Geometries.MultiPoint(); foreach (GisSharpBlog.NetTopologySuite.Geometries.Point point in multiPoint.Geometries) collection.Points.Add(ToSharpMapPoint(point)); return collection; }