List of usage examples for org.apache.lucene.geo GeoTestUtil nextLatitude
public static double nextLatitude()
From source file:org.elasticsearch.common.geo.GeoWKTShapeParserTests.java
License:Apache License
@Override public void testParseMultiPoint() throws IOException { int numPoints = randomIntBetween(2, 100); List<Coordinate> coordinates = new ArrayList<>(numPoints); Shape[] shapes = new Shape[numPoints]; GeoPoint p = new GeoPoint(); for (int i = 0; i < numPoints; ++i) { p.reset(GeoTestUtil.nextLatitude(), GeoTestUtil.nextLongitude()); coordinates.add(new Coordinate(p.lon(), p.lat())); shapes[i] = SPATIAL_CONTEXT.makePoint(p.lon(), p.lat()); }/* ww w .j a va2s. c o m*/ ShapeCollection expected = shapeCollection(shapes); assertExpected(expected, new MultiPointBuilder(coordinates)); assertMalformed(new MultiPointBuilder(coordinates)); }