File Coverage

blib/lib/Geo/WebService/OpenCellID/cell.pm
Criterion Covered Total %
statement 15 19 78.9
branch n/a
condition n/a
subroutine 5 7 71.4
pod 2 2 100.0
total 22 28 78.5


line stmt bran cond sub pod time code
1             package Geo::WebService::OpenCellID::cell;
2 4     4   22 use warnings;
  4         6  
  4         231  
3 4     4   23 use strict;
  4         7  
  4         118  
4 4     4   16 use base qw{Geo::WebService::OpenCellID::Base};
  4         10  
  4         491  
5 4     4   1801 use Geo::WebService::OpenCellID::Response::cell::get;
  4         12  
  4         112  
6 4     4   1951 use Geo::WebService::OpenCellID::Response::cell::getMeasures;
  4         13  
  4         498  
7             our $VERSION = '0.06';
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 omitted. However, if cellid is not present or if cellid i unknown, a default return will be based on lac information, but with a much lower accuracy. In that case, cellid return will be -1.
53              
54             The position 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 COPYRIGHT
117              
118             Copyright (c) 2025 Michael R. Davis
119              
120             This program is free software; you can redistribute
121             it and/or modify it under the same terms as Perl itself.
122              
123             The full text of the license can be found in the
124             LICENSE file included with this module.
125              
126             =cut
127              
128             1;