Giter VIP home page Giter VIP logo

celltower-radar's Introduction

A set of tools to get all Cell Tower information to use with the Google Geolocation API

Cellmapper Example

Data sources

First things first, why did I make this? The answer is simple and it's the lack of documentation on how to use the Geolocation API in python and actually get it to work. In theory all the information required can be found in the official documentation, another problem comes up however, where do you find all the data necessary for instance for the Cell Tower Object. I will thoroughly describe how to use the tools within repository (comments aside), and what is the purpose of each file here.

The Mozilla Location Service (will be referred to as MLS)

MLS is an open service, which lets devices determine their location based on network infrastructure like Bluetooth beacons, cell towers and WiFi access points. This network based location service complements satellite based navigation systems like A-GPS.

MLS offers us a huge dataset containing data for around 50 million unique cells which we can use, in combination with MCC and providers data (will discuss below), to make proper requests to the API and receive an accurate response. The mls_handler will make the request, download, save, reformat and process the file, so you shouldn't worry about that.

Mobile Country Codes (MCC) are used in wireless telephone networks (GSM, CDMA, UMTS, etc.) in order to identify the country which a mobile subscriber belongs to.

MCCS is offering a extensive dataset containing all providers, mcc and mnc for every country in the world. Here it is needed to know how each MCC and country correspond to each other and further identify the MNC, etc.

Cellmapper is a very nice and interactive tool to visualize and get data for cell towers around you, but it is lacking on data like LAC and cell coordinates. However, it has a good and clean selector list of providers in each country which will be useful in a later version of this repository, so there's that.

Description of functionality

Main

main.py is intended to run all modules of this repository to generate the dataset and return the list of cell towers closest to your IP based location in ascending order by proximity in km.

Execute py main.py to run the entire process as intended. Take into consideration that the dataset has around 50 million cells recorded, so computing through them will take a while (on my machine it takes around 15 minutes).

Resources

mls_handler.py contains the MLS oject, which is meant to run through all MLS procedures to generate the complete dataset.

scrape_mccs.py will scrape the mcc codes used to complete the MLS dataset.

scrape_providers.py scrapes the providers of each country from cellmapper but is not currently used.

utils.py has some utilities which are not used currently.

ipinfo.py houses the ipinfo object which extracts your location based on ip address and finds the corresponding MCC.

# generate the MLS object
from res.mls_handler import MLS
mls = MLS()
mls.csv

from iploc.loc_tools import ipinfo
ip = ipinfo()

Example

This is basically just a copy of main.py

from iploc.loc_tools import ipinfo
from res.mls_handler import MLS

if __name__ == '__main__':
    print("Running MLS checks")
    mls = MLS()
    print("Getting IP information")
    ip = ipinfo()
    mcc_dataset = mls.get_mcc(ip.mcc)
    print("Sorting dataset")
    sorted_dataset = mls.sort_data(mcc_dataset, ip.initial_coords)

ip.initial_coords gets your coordinates based on your ip address, but it is recommended to supply your own coordinates if they are sure to be more accurate.

sorted_dataset has each tower sorted by proximity to your location which means, by index:

sorted_dataset[0] is the closest cell tower

sorted_dataset[1] is the next and so on

I hope you'll find this repository useful and don't hesitate to contact me if you have any questions, suggestions, etc. Contributions are warmly welcomed!

celltower-radar's People

Contributors

markmelnic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.