public static final class LegacyGeoPointFieldMapper.Encoding
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
GeoPoint |
decode(byte[] in,
int offset,
GeoPoint out)
Decode a geo point from a byte-array, reading
numBytes() bytes. |
GeoPoint |
decode(long latBits,
long lonBits,
GeoPoint out)
Decode a geo point from the bits of the encoded latitude and longitudes.
|
double |
decodeCoordinate(long bits)
Decode a sequence of bits into the original coordinate.
|
void |
encode(double lat,
double lon,
byte[] out,
int offset)
Encode a geo point into a byte-array, over
numBytes() bytes. |
long |
encodeCoordinate(double lat)
Return the bits that encode a latitude/longitude.
|
int |
numBitsPerCoordinate()
The number of bits required to encode a single coordinate of a geo point.
|
int |
numBytes()
The number of bytes required to encode a single geo point.
|
static LegacyGeoPointFieldMapper.Encoding |
of(DistanceUnit.Distance precision)
Get an instance based on the expected precision.
|
static LegacyGeoPointFieldMapper.Encoding |
of(int numBytesPerValue)
Get an instance based on the number of bytes that has been used to encode values.
|
DistanceUnit.Distance |
precision() |
public static LegacyGeoPointFieldMapper.Encoding of(int numBytesPerValue)
public static LegacyGeoPointFieldMapper.Encoding of(DistanceUnit.Distance precision)
public DistanceUnit.Distance precision()
public int numBytes()
public int numBitsPerCoordinate()
public long encodeCoordinate(double lat)
public double decodeCoordinate(long bits)
public void encode(double lat, double lon, byte[] out, int offset)
numBytes()
bytes.public GeoPoint decode(byte[] in, int offset, GeoPoint out)
numBytes()
bytes.