OpenCellID/cell.pm

filter: Statementstmt 80.9% 17 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 71.4% 5 / 7 Podpod 100% 2 / 2 totaltotal 80.0% 24 / 30 CC 1 SCAR 2.5
CC
1
Cov
81%
get
2.0
getMeasures
2.0
BEGIN
1.0
CRAP 1.3
« OpenCellID/Response/cell/getMeasures.pm ↑ Summary OpenCellID/measure.pm »
1 package Geo::WebService::OpenCellID::cell;
2 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use base qw{Geo::WebService::OpenCellID::Base};
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use Geo::WebService::OpenCellID::Response::cell::get;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Geo::WebService::OpenCellID::Response::cell::getMeasures;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 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<Geo::WebService::OpenCellID::Response::cell::get>.
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 <?xml version="1.0" encoding="UTF-8" ?>
59 <rsp stat="ok">
60 <cell nbSamples="38"
61 lat="57.8240013122559"
62 lon="28.00119972229"
63 range="6000"
64 mcc="250"
65 mnc="99"
66 lac="0"
67 cellId="29513" />
68 </rsp>
69  
70 Note: nbSamples=0 is very common!
71  
72 =cut
73  
74 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
Pod documented
75 0 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<Geo::WebService::OpenCellID::Response::cell::getMeasures>
84  
85 my $response=$gwo->cell->getMeasures(key=>$myapikey,
86 mnc=>1,
87 mcc=>2,
88 lac=>200,
89 cellid=>234);
90  
91 <?xml version="1.0" encoding="UTF-8" ?>
92 <rsp stat="ok">
93 <cell nbSamples="1"
94 lat="38.865953"
95 lon="-77.108595"
96 mnc="784"
97 mcc="608"
98 lac="46156"
99 cellId="40072">
100 <measure lat="38.865953"
101 lon="-77.108595"
102 takenOn="Sat Feb 28 06:07:12 +0100 2009"
103 takenBy="582" />
104 </cell>
105 </rsp>
106  
107 =cut
108  
109 0 ▶sub getMeasures {
Subroutine getMeasures: not called CC=1 SCAR=6.9
Pod documented
110 0 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 4 1;
« OpenCellID/Response/cell/getMeasures.pm ↑ Summary OpenCellID/measure.pm »