| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Geo::WebService::OpenCellID::cell; |
|
2
|
4
|
|
|
4
|
|
23
|
use warnings; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
119
|
|
|
3
|
4
|
|
|
4
|
|
24
|
use strict; |
|
|
4
|
|
|
|
|
8
|
|
|
|
4
|
|
|
|
|
125
|
|
|
4
|
4
|
|
|
4
|
|
20
|
use base qw{Geo::WebService::OpenCellID::Base}; |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
315
|
|
|
5
|
4
|
|
|
4
|
|
18352
|
use Geo::WebService::OpenCellID::Response::cell::get; |
|
|
4
|
|
|
|
|
12
|
|
|
|
4
|
|
|
|
|
169
|
|
|
6
|
4
|
|
|
4
|
|
4054
|
use Geo::WebService::OpenCellID::Response::cell::getMeasures; |
|
|
4
|
|
|
|
|
9
|
|
|
|
4
|
|
|
|
|
575
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Geo::WebService::OpenCellID::cell - Perl API for the opencellid.org database |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Geo::WebService::OpenCellID; |
|
16
|
|
|
|
|
|
|
my $gwo=Geo::WebService::OpenCellID->new(key=>$apikey); |
|
17
|
|
|
|
|
|
|
my $point=$gwo->cell->get(mcc=>$country, |
|
18
|
|
|
|
|
|
|
mnc=>$network, |
|
19
|
|
|
|
|
|
|
lac=>$locale, |
|
20
|
|
|
|
|
|
|
cellid=>$cellid); |
|
21
|
|
|
|
|
|
|
printf "Lat:%s, Lon:%s\n", $point->latlon; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Perl Interface to the database at http://www.opencellid.org/ |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 USAGE |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 METHODS |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head2 get |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Returns a response object L. |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
my $response=$gwo->cell->get(key=>$myapikey, |
|
36
|
|
|
|
|
|
|
mnc=>1, |
|
37
|
|
|
|
|
|
|
mcc=>2, |
|
38
|
|
|
|
|
|
|
lac=>200, |
|
39
|
|
|
|
|
|
|
cellid=>234); |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Documentation from: http://www.opencellid.org/api |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Get the position of a specific cell http://www.opencellid.org/cell/get?key=myapikey&mnc=1&mcc=2&lac=200&cellid=234 |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Where: |
|
46
|
|
|
|
|
|
|
key: The apikey |
|
47
|
|
|
|
|
|
|
mcc: mobile country code (decimal) |
|
48
|
|
|
|
|
|
|
mnc: mobile network code (decimal) |
|
49
|
|
|
|
|
|
|
lac: locale area code (decimal) |
|
50
|
|
|
|
|
|
|
cellid: value of the cell id |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
lac can be ommitted. However, if cellid is not present or if cellid i unkown, a defaut return will be based on lac information, but with a much lower accuracy. In that case, cellid return will be -1. |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
The postion is returned in xml format by the web service but this package wraps this return in a blessed object. |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Example: http://www.opencellid.org/cell/get?mcc=250&mnc=99&cellid=29513&lac=0 |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
| |
|
61
|
|
|
|
|
|
|
lat="57.8240013122559" |
|
62
|
|
|
|
|
|
|
lon="28.00119972229" |
|
63
|
|
|
|
|
|
|
range="6000" |
|
64
|
|
|
|
|
|
|
mcc="250" |
|
65
|
|
|
|
|
|
|
mnc="99" |
|
66
|
|
|
|
|
|
|
lac="0" |
|
67
|
|
|
|
|
|
|
cellId="29513" /> |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Note: nbSamples=0 is very common! |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub get { |
|
75
|
0
|
|
|
0
|
1
|
|
my $self=shift; |
|
76
|
0
|
|
|
|
|
|
return $self->parent->call("cell/get", |
|
77
|
|
|
|
|
|
|
"Geo::WebService::OpenCellID::Response::cell::get", |
|
78
|
|
|
|
|
|
|
@_); |
|
79
|
|
|
|
|
|
|
} |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 getMeasures |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Returns a response object L |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
my $response=$gwo->cell->getMeasures(key=>$myapikey, |
|
86
|
|
|
|
|
|
|
mnc=>1, |
|
87
|
|
|
|
|
|
|
mcc=>2, |
|
88
|
|
|
|
|
|
|
lac=>200, |
|
89
|
|
|
|
|
|
|
cellid=>234); |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
| |
|
94
|
|
|
|
|
|
|
lat="38.865953" |
|
95
|
|
|
|
|
|
|
lon="-77.108595" |
|
96
|
|
|
|
|
|
|
mnc="784" |
|
97
|
|
|
|
|
|
|
mcc="608" |
|
98
|
|
|
|
|
|
|
lac="46156" |
|
99
|
|
|
|
|
|
|
cellId="40072"> |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
lon="-77.108595" |
|
102
|
|
|
|
|
|
|
takenOn="Sat Feb 28 06:07:12 +0100 2009" |
|
103
|
|
|
|
|
|
|
takenBy="582" /> |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub getMeasures { |
|
110
|
0
|
|
|
0
|
1
|
|
my $self=shift; |
|
111
|
0
|
|
|
|
|
|
return $self->parent->call("cell/getMeasures", |
|
112
|
|
|
|
|
|
|
"Geo::WebService::OpenCellID::Response::cell::getMeasures", |
|
113
|
|
|
|
|
|
|
@_); |
|
114
|
|
|
|
|
|
|
} |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 BUGS |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Submit to RT and email the Author |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 SUPPORT |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Try the Author or Try 8motions.com |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 AUTHOR |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Michael R. Davis |
|
127
|
|
|
|
|
|
|
CPAN ID: MRDVT |
|
128
|
|
|
|
|
|
|
STOP, LLC |
|
129
|
|
|
|
|
|
|
domain=>michaelrdavis,tld=>com,account=>perl |
|
130
|
|
|
|
|
|
|
http://www.stopllc.com/ |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
This program is free software; you can redistribute |
|
135
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
The full text of the license can be found in the |
|
138
|
|
|
|
|
|
|
LICENSE file included with this module. |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=cut |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
1; |