… | |
… | |
72 | use common::sense; |
72 | use common::sense; |
73 | |
73 | |
74 | use Carp (); |
74 | use Carp (); |
75 | |
75 | |
76 | BEGIN { |
76 | BEGIN { |
77 | our $VERSION = 0.9; |
77 | our $VERSION = '1.0'; |
78 | |
78 | |
79 | require XSLoader; |
79 | require XSLoader; |
80 | XSLoader::load (__PACKAGE__, $VERSION); |
80 | XSLoader::load (__PACKAGE__, $VERSION); |
81 | |
81 | |
82 | eval 'sub TORAD() { ' . ((atan2 1,0) / 90) . ' }'; |
82 | eval 'sub TORAD() { ' . ((atan2 1,0) / 90) . ' }'; |
… | |
… | |
118 | my ($self) = @_; |
118 | my ($self) = @_; |
119 | |
119 | |
120 | cdb_free $self->[1]; |
120 | cdb_free $self->[1]; |
121 | } |
121 | } |
122 | |
122 | |
123 | =item $res = $lookup->lookup ($lat $lon[, $radius]) |
123 | =item $res = $lookup->lookup ($lat, $lon[, $radius]) |
124 | |
124 | |
125 | Looks up the point in the database that is "nearest" to C<$lat, $lon>, |
125 | Looks up the point in the database that is "nearest" to C<$lat, $lon>, |
126 | search at leats up to C<$radius> kilometres. The default for C<$radius> is |
126 | search at least up to C<$radius> kilometres. The default for C<$radius> is |
127 | the cell size the database is built with, and this usually works best, so |
127 | the cell size the database is built with, and this usually works best, so |
128 | you usually do not specify this parameter. |
128 | you usually do not specify this parameter. |
129 | |
129 | |
130 | If something is found, the associated data blob (always a binary string) |
130 | If something is found, the associated data blob (always a binary string) |
131 | is returned, otherwise you receive C<undef>. |
131 | is returned, otherwise you receive C<undef>. |