GeoHexAS3 is a project mainly written in ..., it's free.
AS3 class for GeoHex encoding/decoding
GeoHexAS3 (c) 2009 calcul http://blog.goo.ne.jp/calcul/ http://twitter.com/calcul_omikan
GeoHex クラス
・GeoHexAS3はAction Script3.0上で日本限定の斜形座標系を提供するクラスです。 ・GeoHexAS3は緯度経度と範囲レベルからGeoHexコードの生成、GeoHexコードから緯度経度・レベルの相互変換が可能です。 ・GeoHexコード変換の他、ユーティリティー関数、プロパティを提供します。
GeoHexの概要 (http://geogames.net/)
隣接するヘックスを6方向で表せるため、連続した軌跡をヘックスコード+[1-6]*nで表すことが可能です。
発明者はsa2da ( http://geogames.net/ ) AS3以外の実装として、JavaScript/Perl/Rubyが存在します。
使い方
・net/geogames 以下に、GeoHex.asをコピー。 import net.geogames.GeoHex を記述。
・リファレンスはアーカイブ中のASDOC/index.htmlに用意してあります。
・以下は、緯度経度をGeoHexコードに変換するコード
var GeoHexCode:String;
var zone:GeoHex = new GeoHex(); // import net.geogames.GeoHex;
GeoHexCode = zone.latlng2geohex(35,135,7); //緯度,経度,レベルの順
trace(GeoHexCode); //出力: rnvs
(The MIT License)
Copyright (c) 2008 David Troy, Roundhouse Technologies LLC
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.