1. A method performed by a computer having a processor and a memory for efficiently accessing sparse spatial data by its position in a multidimensional space, the method comprising: storing a hash table by the processor in a memory of the computer containing the sparse spatial data in densely packed form; storing a set of offset values in an offset table by the processor in the memory of the computer, wherein the offset values map the positions of the sparse spatial data in the multidimensional space to a hash index of the densely packed sparse spatial data's location in the hash table according to a perfect hash function formed as a sum modulo of a size of the hash table of a first hash function of the positions plus an offset value obtained from the offset table indexed by a second hash function of the positions, where the first hash function and second hash functions are calculated using identity matrix transforms of the positions to provide coherent data access from the positions to the sparse spatial data in the hash table; and accessing the sparse spatial data by the processor from the hash table in the memory according to the perfect hash function of the sparse spatial data's positions within the multidimensional space.