Class: GSfc4q

GSfc4q(level)

Generalized (G) Space-filling Curve (SFC) associated to a grid obtained by recursive 4-partitions of quadrilaterals. The generalization consist in the inclusion of "half levels", introduced by this article.

Concepts:

level: the curve's hierarchical level of the public (abstract) structure. Also named "public level", that can be half (0.5, 1, 1.5, 2, 2.5 etc.).

blevel: "blind structure" integer level, the concrete level adopted on internal calculations. The basic relation is blevel=ceil(level), with a flag isHalf when blevel is not equal to level.

key: the index of a position in the SFC of public level (abstract grid), sometimes sayd "distance from origin". The geometric representation of key is a cell in the regular grid. When isHalf the cell of level is the union of two cells of blevel. Sometimes, when isHalf (see Hilbert curve case), the abstract grid obtained by this union of adjacent cells is a non-regular "degenerated grid".

bkey: "blind structure" key. Same as key, changing only when isHalf, them key​ = floor (​bkey / 2).

bkey2: the second bkey, used only when isHalf, in the "union of cells for building abstract structure from blind structure". See key_encode().

grid of the unit square: the mathematical entity used as total area filled by the SFC, is the unit square. It can be transformed into any other quadrilateral, it is a reference canvas geometry. Partitions over unit square produces the grid of blevel. The SFC forms a path conecting centers of the cells of the grid. The set of all blevel grids can be named "hierarchical grid", but sometimes is simply designed as "grid". Grids of isHalf levels are named "degenerated grids". The unit square with no partition is the primordial cell, a grid of level zero.

(i,j) coordinates, or "integer XY grid": see grid of the "blind structure".
“i” and “j” are integers in the range [0,2^blevel-1]. IJ=(0,0) in the top-left corner.
“i” scan columns from left to right, “j” scan lines from top to bottom.

Constructor

new GSfc4q(level)

Parameters:
Name Type Description
level float

hierarchical level of aperture-4 hierarchical grid. Valid integer and "half levels".

Source:

Methods

bkey_decode(bkey) → {array}

Concrete method. Same as key_decode() method, but for integer levels only.

Parameters:
Name Type Description
bkey integer

distance from origin in the curve.

Source:
Returns:
  • the IJ coordinates of the key.
Type
array

bkey_encode(i, j)

Concrete method. Translates to bkey the (i,j) coordinates. Use blevel as reference.

Parameters:
Name Type Description
i integer

the rounded X coordinate, left to right.

j integer

the rounded Y coordinate, top to bottom.

Source:
Returns:

integer. and mutate bkeys

key_decode(key) → {array}

Translates key to (i,j) coordinates.

Parameters:
Name Type Description
key integer

distance from origin in the curve at level.

Source:
Returns:
  • the coordinates IJ in [IJ0,IJ1] with IJ1=null when not isHalf.
Type
array

key_encode(i, j) → {array}

Translates to key the (i,j) coordinates of "blind grid", Use level as reference, and supposing union of cells when isHalf, returning 2 cells instead one.

Parameters:
Name Type Description
i integer

the rounded X coordinate, left to right.

j integer

the rounded Y coordinate, top to bottom.

Source:
Returns:
  • of BigInts, bkey1 and null or, when isHalf, bkey1 and bkey2.
Type
array

refresh(level)

Refresh inicializations, mutating all propertis if necessary. Used by constructor.

Parameters:
Name Type Description
level float

null (no mutation) or hierarchical level of aperture-4 hierarchical grid. Valid integer and "half levels".

Source: