GeoHex v3
• created by @sa2da
• MIT License
• http://geohex.net/
Slide 58
Slide 58 text
use Geo::Hex::V3::XS;
my $zone = Geo::Hex::V3::XS->new(
lat => 35.6295764,
lng => 139.794686,
level => 10
);
$zone->code # => XM4885355114
Slide 59
Slide 59 text
GeoHex v3 encode example
use Geo::Hex::V3::XS;
my $zone = Geo::Hex::V3::XS->new(
lat => 35.6295764,
lng => 139.794686,
level => 10
);
$zone->code # => XM4885355114
ϨϕϧΛ্͛Δͱਫ਼্͕ঢ
Slide 60
Slide 60 text
GeoHex v3 encode example
use Geo::Hex::V3::XS;
my $zone = Geo::Hex::V3::XS->new(
lat => 35.6295764,
lng => 139.794686,
level => 10
);
$zone->code # => XM4885355114
΄΅ࣗવͳܗͰ Encode
w w
Slide 61
Slide 61 text
GeoHex v3 encode example
use Geo::Hex::V3::XS;
my $zone = Geo::Hex::V3::XS->new(
lat => 35.6295764,
lng => 139.794686,
level => 10
);
$zone->code # => XM4885355114
಄ͷ30ਐදهͷ༷Λআ͚ɺ
શͳࣗવදه
Slide 62
Slide 62 text
ۙͷใͲ͏͔ʁ
Slide 63
Slide 63 text
use Geo::Hex::V3::XS;
Geo::Hex::V3::XS->new(
lat => 35.6295764,
lng => 139.794686,
level => $_
)->code for 0..10;
Slide 64
Slide 64 text
use Geo::Hex::V3::XS;
Geo::Hex::V3::XS->new(
lat => 35.6295764,
lng => 139.794686,
level => $_
)->code for 0..10;
# =>
XM
XM4
XM48
XM488
XM4885
XM48853
XM488535
XM4885355
XM48853551
XM488535511
XM4885355114
SELECT name FROM station
WHERE
geohex LIKE ‘XM4885355114’
# => Empty set
Slide 73
Slide 73 text
SELECT name FROM station
WHERE
geohex LIKE ‘XM488535511_’
# => Empty set
Slide 74
Slide 74 text
SELECT name FROM station
WHERE
geohex LIKE ‘XM48853551__’
# => Empty set
Slide 75
Slide 75 text
SELECT name FROM station
WHERE
geohex LIKE ‘XM4885355___’
# => Empty set
Slide 76
Slide 76 text
SELECT name FROM station
WHERE
geohex LIKE ‘XM488535____’
# => 国際展示場正門
Slide 77
Slide 77 text
SELECT name FROM station
WHERE
geohex LIKE ‘XM48853_____’
# =>
テレコムセンター
船の科学館
青海
国際展示場正門
新木場
Slide 78
Slide 78 text
ݱࡏ͔Βͬͱ͍ۙӺʁ
A. ࠃࡍలࣔਖ਼
Slide 79
Slide 79 text
GeoHex v3 Encodeʹ͍ͭͯ
Slide 80
Slide 80 text
GeoHex v3 Encodeʹ͍ͭͯ
• Web ϝϧΧτϧਤΛਖ਼֯ܗͰ۠
• WebϝϧΧτϧͱɺϝϧΧτϧਤΛϒϥ
βͷpositionදݱʹࣹӨͨ͠ͷ
Slide 81
Slide 81 text
GeoHex v3 Encodeʹ͍ͭͯ
• Web ϝϧΧτϧਤΛਖ਼֯ܗͰ۠
• WebϝϧΧτϧͱɺϝϧΧτϧਤΛϒϥ
βͷpositionදݱʹࣹӨͨ͠ͷ
x = longtitude * R / 180;
y = ln(tan((90 + latitude) * pi / 360))
* (pi / 180) * R / 180
R = ٿͷܘ = 20037508.34