28
28
* {@link GeoJsonMultiPoint} is defined as list of {@link Point}s.
29
29
*
30
30
* @author Christoph Strobl
31
+ * @author Ivan Volzhev
31
32
* @since 1.7
32
33
* @see <a href="https://geojson.org/geojson-spec.html#multipoint">https://geojson.org/geojson-spec.html#multipoint</a>
33
34
*/
@@ -40,12 +41,12 @@ public class GeoJsonMultiPoint implements GeoJson<Iterable<Point>> {
40
41
/**
41
42
* Creates a new {@link GeoJsonMultiPoint} for the given {@link Point}s.
42
43
*
43
- * @param points points must not be {@literal null} and have at least 2 entries .
44
+ * @param points points must not be {@literal null} and have at least 1 entry .
44
45
*/
45
46
public GeoJsonMultiPoint (List <Point > points ) {
46
47
47
48
Assert .notNull (points , "Points must not be null." );
48
- Assert .isTrue (points .size () >= 2 , "Minimum of 2 Points required." );
49
+ Assert .isTrue (points .size () >= 1 , "Minimum of 1 Point required." );
49
50
50
51
this .points = new ArrayList <Point >(points );
51
52
}
@@ -69,6 +70,19 @@ public GeoJsonMultiPoint(Point first, Point second, Point... others) {
69
70
this .points .addAll (Arrays .asList (others ));
70
71
}
71
72
73
+ /**
74
+ * Creates a new {@link GeoJsonMultiPoint} for the given {@link Point}.
75
+ *
76
+ * @param point must not be {@literal null}.
77
+ */
78
+ public GeoJsonMultiPoint (Point point ) {
79
+
80
+ Assert .notNull (point , "First point must not be null!" );
81
+
82
+ this .points = new ArrayList <Point >();
83
+ this .points .add (point );
84
+ }
85
+
72
86
/*
73
87
* (non-Javadoc)
74
88
* @see org.springframework.data.mongodb.core.geo.GeoJson#getType()
0 commit comments