| 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.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<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 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 | <?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 | sub get { | ||
| 75 | 0 | ▶ | my $self=shift; |
|
Subroutine
get: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 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 | sub getMeasures { | ||
| 110 | 0 | ▶ | my $self=shift; |
|
Subroutine
getMeasures: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 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 | 4 | 1; | |