Class: Geoq::Geohash

Inherits:
Entity show all
Defined in:
lib/geoq/entity.rb

Instance Attribute Summary

Attributes inherited from Entity

#entity, #raw

Instance Method Summary collapse

Methods inherited from Entity

#as_geojson, #gh_string, #initialize, #to_geojson, #to_wkt

Constructor Details

This class inherits a constructor from Geoq::Entity

Instance Method Details

#gh_childrenObject



51
52
53
# File 'lib/geoq/entity.rb', line 51

def gh_children
  BASE_32.chars.map { |char| raw + char }
end

#gh_neighbors(inclusive = false) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/geoq/entity.rb', line 55

def gh_neighbors(inclusive = false)
  if inclusive
    [raw] + GeoHash.neighbors(raw)
  else
    GeoHash.neighbors(raw)
  end
end