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

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

Introduction

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

Prototype

public static double nextLatitude() 

Source Link

Document

returns next pseudorandom latitude (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());
    }/* ww w .j  a va2s. c o  m*/
    ShapeCollection expected = shapeCollection(shapes);
    assertExpected(expected, new MultiPointBuilder(coordinates));
    assertMalformed(new MultiPointBuilder(coordinates));
}