public class Geobox extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BITS_10_39km
10 bits gives a box of 39km at the Equator
|
static int |
BITS_12_10km
12 bits gives a box of 9.8km at the Equator
|
static int |
BITS_15_1224m
15 bits gives a box of 1224m at the Equator
|
static int |
BITS_17_307m
17 bits gives a box of 307m at the Equator
|
static int |
BITS_18_154m
18 bits gives a box of 154m at the Equator
|
static int |
BITS_19_77m
19 bits gives a box of 77.5m at the Equator
|
static int |
BITS_20_39m
20 bits gives a box of 39m at the Equator
|
static int |
BITS_21_19m
21 bits gives a box of 19.1m at the Equator
|
static int |
BITS_22_10m
22 bits gives a box of 10.6m at the Equator
|
static int |
BITS_23_53dm
23 bits gives a box of 5.3m at the Equator
|
static int |
BITS_24_32dm
24 bits gives a box of 3.2m at the Equator
|
static int |
RADIUS |
| Constructor and Description |
|---|
Geobox() |
| Modifier and Type | Method and Description |
|---|---|
static String |
compute(double lat,
double lng,
int resolution,
int slice) |
static List<String> |
computeSet(double lat,
double lng,
int resolution,
double slice) |
static double |
distance(DLocation p1,
DLocation p2)
Calculates the great circle distance between two points (law of cosines).
|
static long |
getCell(float lat,
float lng,
int precision) |
static long |
getHash(float lat,
float lng,
int bits) |
protected static long |
getHashIterative(float major,
float minor,
int bits) |
protected static long |
getHashRecursive(float major,
float minor,
int bit,
float dMajor,
float dMinor) |
static long |
getMask(float x,
float base,
int bits) |
static Set<Long> |
getTuple(float lat,
float lng,
int bits) |
static double |
makeDoubleInRange(double d)
This function is used to fix issue 10:
GeocellUtils.distance(...) uses Math.acos(arg) method.
|
public static final int RADIUS
public static final int BITS_10_39km
public static final int BITS_12_10km
public static final int BITS_15_1224m
public static final int BITS_17_307m
public static final int BITS_18_154m
public static final int BITS_19_77m
public static final int BITS_20_39m
public static final int BITS_21_19m
public static final int BITS_22_10m
public static final int BITS_23_53dm
public static final int BITS_24_32dm
public static long getMask(float x,
float base,
int bits)
public static long getHash(float lat,
float lng,
int bits)
protected static long getHashRecursive(float major,
float minor,
int bit,
float dMajor,
float dMinor)
protected static long getHashIterative(float major,
float minor,
int bits)
public static long getCell(float lat,
float lng,
int precision)
lat - lng - precision - in nibbles (4 bits per nibble)public static String compute(double lat, double lng, int resolution, int slice)
public static List<String> computeSet(double lat, double lng, int resolution, double slice)
public static double distance(DLocation p1, DLocation p2)
p1 - indicating the first point.p2 - indicating the second point.public static double makeDoubleInRange(double d)
d - Copyright © 2013. All Rights Reserved.