Example usage for com.google.common.geometry S2Cap fromAxisArea

List of usage examples for com.google.common.geometry S2Cap fromAxisArea

Introduction

In this page you can find the example usage for com.google.common.geometry S2Cap fromAxisArea.

Prototype

public static S2Cap fromAxisArea(S2Point axis, double area) 

Source Link

Document

Create a cap given its axis and its area in steradians.

Usage

From source file:com.norman0406.slimgress.API.Common.Utils.java

public static String[] getCellIdsFromLocationArea(Location location, double areaM2, int minLevel,
        int maxLevel) {
    final double radius_m2 = 6371 * 1000;
    final double sr = areaM2 / (radius_m2 * radius_m2);

    S2LatLng pointLatLng = S2LatLng.fromE6(location.getLatitude(), location.getLongitude());
    S2Cap cap = S2Cap.fromAxisArea(pointLatLng.toPoint(), sr);

    return getCellIdsFromRegion(cap, minLevel, maxLevel);
}