Skip to content

manbeardave/geohex_v3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

* https://rubygems.org/gems/geohex_v3

## GEOHEX DESCRIPTION
GeoHex Gem for Ruby (c) 2009 Haruyuki Seki
http://twitter.com/hal_sk_e  (en)
http://twitter.com/hal_sk  (ja)

  * The GeoHex is a latitude/longitude encoding system invented by sa2da.
  * GeoHex divides geometry regions into hexagonal grid and set an unique identifier to each grid.
  * The coding idea is opened under the Creative Commons Attribution 2.1 Japan Lisence. 
  * GeoHex Documentation: https://sites.google.com/site/geohexdocs/
  * GeoHex Original Wiki(Japanese): http://geogames.net/labs/geohex
  * GeoHex Demo: http://geohex.net/v3.html
  * Various GeoHex Libraries: http://github.com/geohex/
  
## GEOHEX GEM DESCRIPTION
   
  This GeoHex Ruby gem can convert latitude/longitude to GeoHex code each others.
  * Encode from latitude/longitude to GeoHex code to an arbitrary level of precision
  * Decode from GeoHex code to latitude/longitude and level of precision
  * Return Zone from X,Y + Level
  * Return XY from L,L + level
  * Return XY From Code
  * Return Zone from Code
  

## INSTALL

   gem install geohex_v3

## QUICK START

   require 'geohex'
   GeoHex::Zone.encode(35.647401,139.716911,1)
   => '132KpuG' 
   
   GeoHex::Zone.decode('0dMV')
   => [24.338279000000004,124.1577708779443,7]
   
   GeoHex::Zone.getZoneByLocation(33.127120,-117.3274073, 11)
   => #<GeoHex::Zone:0x007fdbf180aca8
         @code="PC22751337146",
         @lat=33.127103696872936,
         @lon=-117.32741734265892,
         @x=-250028,
         @y=789182>
    
   GeoHex::Zone.getZoneByCode('PC22751337146')
   => #<GeoHex::Zone:0x007fce3d8758d0
         @code="PC22751337146",
         @lat=33.127103696872936,
         @lon=-117.32741734265892,
         @x=-250028,
         @y=789182>


## LICENSE

NOTE: 
The idea of GeoHex is licensed by sa2da. 
You should follow original license of GeoHex.
(The license is opened by CC-BY-SA license)
You must attribute this work to sa2da (with link).
http://geogames.net

This ruby code is covered by MIT License.
(The MIT License)

Copyright (c) 2009 Haruyuki SEKI 

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

GeoHex Gem for Ruby, v3.2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published