List of usage examples for org.apache.lucene.geo GeoTestUtil nextLongitude
public static double nextLongitude()
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()); }/*from w w w . j a va 2s . com*/ ShapeCollection expected = shapeCollection(shapes); assertExpected(expected, new MultiPointBuilder(coordinates)); assertMalformed(new MultiPointBuilder(coordinates)); }