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

使用MCC,MNC,LAC和Cell ID查找位置,第1张

概述使用MCC,MNC,LAC和Cell ID查找位置

我知道MCC,MNC,LAC和Cell ID的值是多less。 我想在C写一个程序来计算在linux中的纬度和经度值的位置

供参考:

MCC – 移动国家代码

MNC – 移动networking代码

LAC – 位置区号; 一个16位数字,从而允许一个GSM PLMN中的65536个位置区域

更多信息可在维基百科上find, 位置区域标识

题:

如何将MCC,MNC,LAC,Cell ID转换为linux中的纬度和经度值?

为什么每次尝试阅读时Cell ID都会变化?

我想在命令行上获得我的linux设备的精确纬度经度。 像HTML5中的地理位置一样。 我没有访问浏览器

系统设备位置不工作

指向相对于平板电脑位置的特定位置的windows 8应用程序

在Python脚本中使用windows GPS定位服务

地理定位如何在有线宽带连接的windows PC上工作?

Apache Cordova Geolocation不提供数据

Python ssl.SSLError:证书valIDation失败(_ssl.c:748)

回答你的问题:

您可以从终端或浏览器访问公共数据库,将单元ID转换为纬度/经度。 数据库包括:

无线实验室API

OpenCellID

小区ID是您的手机/设备连接到的手机塔的ID。 当你移动一下,或者附近的另一个塔的信号比当前的更好时,你的电话将切换到该塔,而你的小区ID现在反映了该塔的ID。

你需要一个数据库OpenCellID (它们提供了新的单元格测量的API,获取特定单元格的位置等)

要么

使用“秘密”API:“ http://www.Google.com/glm/mmap ”是将cellLocation转换为经度和纬度的非公开API。

在这个SO问题的答案中给出了很多方法。

您可以使用这个简单但高效的网站,不需要任何登录:

http://www.cell2gps.com/

而您可以访问MCC和MNC等运营商信息进入wiki页面:

http://en.wikipedia.org/wiki/Mobile_country_code#I

结果是通过谷歌地图的GPS位置,

我写了一个python脚本,可以为你做这个。 你可以从pyc文件中得到一个二进制文件。

#!/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,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

总结

以上是内存溢出为你收集整理的使用MCC,MNC,LAC和Cell ID查找位置全部内容,希望文章能够帮你解决使用MCC,MNC,LAC和Cell ID查找位置所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1291504.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-10
下一篇 2022-06-10

发表评论

登录后才能评论

评论列表(0条)

保存