Search in sources :

Example 1 with PlanetModel

use of org.apache.lucene.spatial3d.geom.PlanetModel in project lucene-solr by apache.

the class TestGeo3DPoint method testComplexPolygons.

public void testComplexPolygons() {
    final PlanetModel pm = PlanetModel.WGS84;
    // Pick a random pole
    final GeoPoint randomPole = new GeoPoint(pm, toRadians(GeoTestUtil.nextLatitude()), toRadians(GeoTestUtil.nextLongitude()));
    int iters = atLeast(100);
    for (int i = 0; i < iters; i++) {
        // Create a polygon that's less than 180 degrees
        final Polygon clockWise = makePoly(pm, randomPole, true, true);
    }
    iters = atLeast(100);
    for (int i = 0; i < iters; i++) {
        // Create a polygon that's greater than 180 degrees
        final Polygon counterClockWise = makePoly(pm, randomPole, false, true);
    }
}
Also used : GeoPoint(org.apache.lucene.spatial3d.geom.GeoPoint) PlanetModel(org.apache.lucene.spatial3d.geom.PlanetModel) GeoPolygon(org.apache.lucene.spatial3d.geom.GeoPolygon) Polygon(org.apache.lucene.geo.Polygon) GeoPoint(org.apache.lucene.spatial3d.geom.GeoPoint)

Aggregations

Polygon (org.apache.lucene.geo.Polygon)1 GeoPoint (org.apache.lucene.spatial3d.geom.GeoPoint)1 GeoPolygon (org.apache.lucene.spatial3d.geom.GeoPolygon)1 PlanetModel (org.apache.lucene.spatial3d.geom.PlanetModel)1