3.3.4.5  :  Spatial

This table stores coordinates and indexes for cells in the MField table. It allows one to translate between the Peano-HIlbert index (phkey) of a cell and its discrete cartesian coordinates (ix,iy,iz).

NOTE the (ix,iy,iz) coordinates have values in [-1,256], not in [0,255]! The motivation for this is that it makes it somewhat easier to deal with periodic boundary conditions when querying for the neighbours of a cell identified by its phkey:
select s2.phkey
  from mfield..spatial s1
  ,    mfield..spatial s2
 where s1.phkey=123456
   and s1.ix between 0 and 255
   and s1.iy between 0 and 255
   and s1.iz between 0 and 255
   and s2.ix between s1.ix-1 and s1.ix+1
   and s2.iy between s1.iy-1 and s1.iy+1
   and s2.iz between s1.iz-1 and s1.iz+1
columntypeUCDunitdescription
ix integer pos.cart.x The discrete x coordinate of the cell. Values between -1 and 256.
iy integer pos.cart.y The discrete y coordinate of the cell. Values between -1 and 256.
iz integer pos.cart.z The discrete z coordinate of the cell. Values between -1 and 256.
phkey integer The Peano-Hilbert index of the cell.
zindex integer time The bit-interleaving index of the cell.