public final class XYEncodingUtils extends Object
Modifier and Type | Field and Description |
---|---|
static double |
MAX_VAL_INCL |
static double |
MIN_VAL_INCL |
Modifier and Type | Method and Description |
---|---|
static void |
checkVal(double x)
validates value is within +/-
Float.MAX_VALUE coordinate bounds |
static double |
decode(byte[] src,
int offset)
Turns quantized value from byte array back into a double.
|
static double |
decode(int encoded)
Turns quantized value from
encode(double) back into a double. |
static int |
encode(double x)
Quantizes double (64 bit) values into 32 bits
|
public static final double MIN_VAL_INCL
public static final double MAX_VAL_INCL
public static void checkVal(double x)
Float.MAX_VALUE
coordinate boundspublic static int encode(double x)
x
- cartesian valueint
IllegalArgumentException
- if value is out of boundspublic static double decode(int encoded)
encode(double)
back into a double.encoded
- encoded value: 32-bit quantized value.public static double decode(byte[] src, int offset)
src
- byte array containing 4 bytes to decode at offset
offset
- offset into src
to decode from.Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.