国外经纬度计算GPS 计算 google地图计算 必应地图 和mapbox 地图
来源:互联网 发布:xbox360手柄 mac 编辑:程序博客网 时间:2024/05/22 00:17
自从google 退出中国之后,很多的不方便.
地图勉强能用
网上有些api都是要收费的,而且收费比较多.
原来一直用必应地图提供的接口
GeocodeRequest geocodeRequest = new GeocodeRequest();
报错 the service method is not found
看了官方的列子也是这样的.
google地图没有http接口更新.网页的对请求限制100次/天
我们系统每天更新经纬度数据比较多,每天得更新好几万的数据.
下面是google地图计算经纬度接口js版本的,需要通过ajax 单条调用.
function GetGpsGoogle(address,obj) { $.ajax({ type: "get", dataType: "json", async: false, url: "http://maps.google.cn/maps/api/geocode/json?address=" + address + "", success: function (data) { if (data.status == 'OK') { var lat = data.results[0].geometry.location.lat; var lng = data.results[0].geometry.location.lng; //更新业务数据 } } });}
必应地图的接口
private void MakeGeocodeRequest() { string Results = ""; try { // Set a Bing Maps key before making a request string key = "9hOiCZ9CeqcrrtLulix6~vW9_U20gmnMkdIBj-HwxGw~AuMx8W3CzxTLBhR6Evg9le2-p2sPZJcjZA1taqoQSjHjx1v2TXpdUyfE1pcA9sUP"; GeocodeRequest geocodeRequest = new GeocodeRequest(); // Set the credentials using a valid Bing Maps Key geocodeRequest.Credentials = new Credentials(); geocodeRequest.Credentials.ApplicationId = key; // Set the full address query geocodeRequest.Query = "1 Microsoft Way, Redmond, WA"; // Set the options to only return high confidence results ConfidenceFilter[] filters = new ConfidenceFilter[1]; filters[0] = new ConfidenceFilter(); filters[0].MinimumConfidence = Confidence.High; GeocodeOptions geocodeOptions = new GeocodeOptions(); geocodeOptions.Filters = filters; geocodeRequest.Options = geocodeOptions; // Make the geocode request GeocodeServiceClient geocodeService = new GeocodeServiceClient("BasicHttpBinding_IGeocodeService"); GeocodeResponse geocodeResponse = geocodeService.Geocode(geocodeRequest); Results = geocodeResponse.Results[0].DisplayName; } catch (Exception ex) { Results = "An exception occurred: " + ex.Message; } }
现在报错,不知道谁有解决方案吗,这个接口一个秘钥能更新10万次.就是不能访问了.
最后有找了一个接口就是mapbox地图.
每分钟更新600次.这个量算好了.就是接口响应速度有点慢.
string GetPost = string.Format("https://api.mapbox.com/geocoding/v5/mapbox.places/{0}.json?access_token='你的秘钥'", address); getStr = Command.HttpHelper.Get_Http(GetPost); VO.BoxMap.BoxMapGpsVO model = Command.JsonHelper.ParseFormJson<VO.BoxMap.BoxMapGpsVO>(getStr); if (model != null) { if (model.features != null && model.features.Length>0) { latitude = model.features[0].center[0].ToString(); longitude = model.features[0].center[1].ToString(); } }
走的是httpget请求,得到结果最后反序列化,key就不公开了,需要的可以联系我,或者找到原文来源.
这是计算国外地图经纬度的几种方式,现在mapbox最好用,google地图最精准.
文章来源:http://www.zhruanjian.com/
阅读全文
0 0
- 国外经纬度计算GPS 计算 google地图计算 必应地图 和mapbox 地图
- 由经纬度计算Google卫星地图的URL
- GOOGLE卫星地图 计算方式
- Android地图 获取经纬度计算距离介绍
- SQL SERVER 和Javascript根据地图经纬度计算距离函数
- 根据圆心经纬度和半径计算地图zoom level
- 必应地图显示点击事件经纬度
- Google卫星地图的URL计算
- Mysql 计算google 地图的距离
- 地图比例尺的计算
- 百度地图计算距离
- 由经纬度计算Google卫星地图中瓦片Tile的地址
- [转]由经纬度计算Google卫星地图中瓦片Tile的地址
- Google地图百度地图GPS经纬度偏移转换(JAVA)
- Google地图百度地图GPS经纬度偏移转换(JAVA)
- Google地图百度地图GPS经纬度偏移转换(JAVA)
- Google地图百度地图GPS经纬度偏移转换(JAVA)
- Android中百度地图计算MapView任意位置的经纬度
- 小白学tkinter(事件之(Event对象))
- Python入门基础
- 51Nod-1006-最长公共子序列Lcs
- json字符串转js对象取值
- 逻辑回归LR的特征为什么要先离散化
- 国外经纬度计算GPS 计算 google地图计算 必应地图 和mapbox 地图
- Crossword Answers UVA
- js -- 设置输入框光标位置(在模拟微信表情输入的时候遇到的)
- 有关人工神经网做回归的实验发现的问题
- LINUX对硬盘进行挂载操作
- TensorFlow-Bitcoin-Robot:Tensorflow 比特币交易机器人
- list的add方法 ,foreach循环添加map---List.add(map)(通过一个java爬虫案例说明)
- 学生问题(三)
- 极乐技术周报(第二十二期)