首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >使用MCC、MNC、LAC和Cell ID查找位置

使用MCC、MNC、LAC和Cell ID查找位置
EN

Stack Overflow用户
提问于 2013-09-08 01:17:35
回答 4查看 60.4K关注 0票数 15

我知道MCC、MNC、LAC和Cell的值,我想用C编写一个程序,以Linux中纬度和经度值的形式计算位置。

FYI:

问题:

  1. 如何将MCC、MNC、LAC、Cell ID转换为linux中的经纬度值?
  2. 为什么每次读取时单元格ID都会变化?
EN

回答 4

Stack Overflow用户

发布于 2014-02-10 16:08:34

回答你的问题:

  1. 您可以从终端或浏览器访问公共数据库,以便将单元ID转换为lat/lon。数据库包括:
代码语言:javascript
运行
复制
- [Unwired Labs API](http://unwiredlabs.com/)
- [OpenCellID](http://opencellid.org/)

  1. 手机ID是你的手机/设备连接到的手机塔的ID。当你移动一点,或者附近的另一座塔的信号比现在的要好的时候,你的手机就会切换到那个塔上,你的手机ID现在反映了那个塔的ID。
票数 4
EN

Stack Overflow用户

发布于 2017-06-24 02:28:36

我编写了一个python脚本,它可以为您完成此任务。您可以从pyc文件中获得二进制文件。

代码语言:javascript
运行
复制
#!/bin/python
"""
Written by Atissonoun - Credits to MFC & HAC
***You need to initialize the script in order to fix the import and the dependency.
This is only a Beta version of the project***
This python file works as the engine for the project.
imports, coordinates, run......
"""

#Importing modules
import requests
#defining a Api_Keys

Google_API_KEY="Your google API Key goes here"
OpenCell_Api_Key ="Your OpenCellID API Key goes here"

def Google(MMC,MNC,LAC,ID,API_KEY=Google_API_KEY):
    url = "https://www.googleapis.com/geolocation/v1/geolocate?key={}".format(API_KEY)
    data={
    "radioType": "gsm",
    "cellTowers":[
        {
        "cellId": ID,
        "locationAreaCode": LAC,
        "mobileCountryCode": MMC,
        "mobileNetworkCode": MNC
        }
    ]
    }
    response = requests.post(url, json=data)
    if response.status_code == 200 :
        lat=response.json()[u'location'][u'lat']
        long = response.json()[u'location'][u'lng']
        d={'LAT':lat,'LONG':long}
        print('Located Cell: {}'.format(ID))
        return d
    else:
        print('Error: {}'.format(response.status_code))
        return None

def Opencell(MMC,MNC,LAC,ID,API_KEY=OpenCell_Api_Key):
    url = "https://us1.unwiredlabs.com/v2/process.php"
    data = {
        "token": API_KEY,
        "radio": "gsm",
        "mcc": MMC,
        "mnc": MNC,
        "cells": [{
            "lac": LAC,
            "cid": ID
        }]
    }
    response = requests.post(url, json=data)
    if response.status_code == 200:
        if response.json()[u'status']== 'error':
            print('Error: {}'.format(response.json()[u'message']))
            return None
        else:
            lat = response.json()[u'lat']
            long = response.json()[u'lon']
            d = {'LAT': lat, 'LONG': long}
            print('Located Cell: {}'.format(ID))
            return d
    else:
        print('Error: {}'.format(response.status_code))
        return None
票数 3
EN

Stack Overflow用户

发布于 2013-10-17 08:54:55

您要么需要数据库OpenCellID (它们为新的单元测量提供API,获取特定单元的位置,等等)

使用“机密”API:"http://www.google.com/glm/mmap“是一个非公共API,用于将cellLocation转换为纬度和经度。

这真是个问题。的答案中给出了许多方法。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18686888

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档