Package be.panako.util
Class Morton2D
java.lang.Object
be.panako.util.Morton2D
Encode/decode 2D coordinates to Morton codes (Z-order curve)
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Morton2D
public Morton2D()
-
-
Method Details
-
encode
public static long encode(int x, int y) Morton (z-ordering) encoding with Lookup Table method- Parameters:
x
- range is from 0 to 16777215 (24bits).y
- range is from 0 to 16777215 (24bits).- Returns:
- return Morton Code as long .
-
decode
public static int[] decode(long c) Decode Morton (z-ordering)- Parameters:
c
- morton code up to 48 bits- Returns:
- array [x,y] .
-