public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var o = serializer.Deserialize<JArray>(reader);
            var pointConverter = new PointJsonConverter();
            var points =
                o.Select(
                    point => pointConverter.ReadJson(point.CreateReader(), typeof(Point), point, serializer)).Cast<Point>().ToList();

            return new MultiPoint(points.Select(p => p.Position).ToList());
        }
Пример #2
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var o = serializer.Deserialize <JArray>(reader);
            var pointConverter = new PointJsonConverter();
            var points         =
                o.Select(
                    point => pointConverter.ReadJson(point.CreateReader(), typeof(Point), point, serializer)).Cast <Point>().ToList();

            return(new LineString(points.Select(p => p.Position).ToList()));
        }