public static final class GeoPointFieldMapperLegacy.Encoding extends 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 GeoPointFieldMapperLegacy.Encoding |
of(DistanceUnit.Distance precision)
Get an instance based on the expected precision.
|
static GeoPointFieldMapperLegacy.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 final GeoPointFieldMapperLegacy.Encoding of(int numBytesPerValue)
public static final GeoPointFieldMapperLegacy.Encoding of(DistanceUnit.Distance precision)
public DistanceUnit.Distance precision()
public final 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.Copyright © 2009–2017. All rights reserved.