public class MortonEncoder extends Object
Modifier and Type | Method and Description |
---|---|
static double |
decodeLatitude(long hash)
decode latitude value from morton encoded geo point
|
static double |
decodeLongitude(long hash)
decode longitude value from morton encoded geo point
|
static long |
encode(double latitude,
double longitude)
Main encoding method to quantize lat/lon points and bit interleave them into a binary morton code
in the range of 0x00000000...
|
static long |
encodeCeil(double latitude,
double longitude)
Quantizes lat/lon points and bit interleaves them into a sortable morton code
ranging from 0x00 : 0xFF...
|
static String |
geoTermToString(long term)
Converts a long value into a full 64 bit string (useful for debugging)
|
public static final long encode(double latitude, double longitude)
latitude
- latitude value: must be within standard +/-90 coordinate bounds.longitude
- longitude value: must be within standard +/-180 coordinate bounds.long
IllegalArgumentException
- if latitude or longitude is out of boundspublic static final long encodeCeil(double latitude, double longitude)
latitude
- latitude value: must be within standard +/-90 coordinate bounds.longitude
- longitude value: must be within standard +/-180 coordinate bounds.long
IllegalArgumentException
- if latitude or longitude is out of boundspublic static final double decodeLatitude(long hash)
public static final double decodeLongitude(long hash)
public static String geoTermToString(long term)
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.