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

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

Introduction

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

Prototype

public static Rectangle nextBox() 

Source Link

Document

returns next pseudorandom box: can cross the 180th meridian

Usage

From source file:org.elasticsearch.common.geo.GeoWKTShapeParserTests.java

License:Apache License

@Override
public void testParseEnvelope() throws IOException {
    org.apache.lucene.geo.Rectangle r = GeoTestUtil.nextBox();
    EnvelopeBuilder builder = new EnvelopeBuilder(new Coordinate(r.minLon, r.maxLat),
            new Coordinate(r.maxLon, r.minLat));
    Rectangle expected = SPATIAL_CONTEXT.makeRectangle(r.minLon, r.maxLon, r.minLat, r.maxLat);
    assertExpected(expected, builder);/*  ww w  . j  a v a  2s .  co m*/
    assertMalformed(builder);
}