Example usage for org.apache.lucene.geo GeoTestUtil nextLongitude

List of usage examples for org.apache.lucene.geo GeoTestUtil nextLongitude

Introduction

In this page you can find the example usage for org.apache.lucene.geo GeoTestUtil nextLongitude.

Prototype

public static double nextLongitude() 

Source Link

Document

returns next pseudorandom longitude (anywhere)

Usage

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));
}