module S2Cells::S2Base
Constants
- INVERT_MASK
- LINEAR_PROJECTION
- LOOKUP_BITS
- LOOKUP_IJ
- LOOKUP_POS
- MAX_LEVEL
- MAX_SIZE
- NUM_FACES
- POS_BITS
- POS_TO_IJ
- POS_TO_OR
- QUADRATIC_PROJECTION
- SWAP_MASK
- TAN_PROJECTION
Public Class Methods
lookup_bits(i, j, orig_orientation, pos, orientation)
click to toggle source
# File lib/s2_cells/s2_cell_base.rb, line 37 def self.lookup_bits(i, j, orig_orientation, pos, orientation) ij = (i << LOOKUP_BITS) + j LOOKUP_POS[(ij << 2) + orig_orientation] = (pos << 2) + orientation LOOKUP_IJ[(pos << 2) + orig_orientation] = (ij << 2) + orientation end
lookup_cells(level, i, j, orig_orientation, pos, orientation)
click to toggle source
# File lib/s2_cells/s2_cell_base.rb, line 25 def self.lookup_cells(level, i, j, orig_orientation, pos, orientation) return lookup_bits(i, j, orig_orientation, pos, orientation) if level == LOOKUP_BITS r = POS_TO_IJ[orientation] 4.times do |index| lookup_cells( level + 1, (i << 1) + (r[index] >> 1), (j << 1) + (r[index] & 1), orig_orientation, (pos << 2) + index, orientation ^ POS_TO_OR[index] ) end end