api地理编码

Motivation

动机

In my second semester of my Master’s degree, I was working on a dataset which had all the records of the road accident in Victoria, Australia (2013-19). I was very curious to know, which national highways are the most dangerous in Victoria, and need attention to improve safety. The dataset did have the longitude and latitude coordinates where the accidents occurred, but it did not have other supporting and useful information like the name of roads where the accident took place, or the suburb, LGA etc. So I thought there must be a way to retrieve that information and analyse it, since its all geographic information which should be linked to the location coordinates. The answer was extracting the information through the process of reverse-geocoding.

在攻读硕士学位的第二学期,我正在研究一个数据集,其中包含澳大利亚维多利亚州(2013-19年)道路交通事故的所有记录。 我很好奇,维多利亚州哪些国道最危险,需要注意以提高安全性。 该数据集确实具有发生事故的经度纬度坐标,但是它没有其他支持和有用的信息,例如发生事故的道路名称,郊区,LGA等。因此,我认为必须有一种方法检索并分析该信息,因为应该将所有地理信息链接到位置坐标。 答案是通过反向地理编码来提取信息

What does Geocoding/Reverse-geocoding mean?

地理编码/反向地理编码是什么意思?

Geocoding is the process of converting addresses (like “1600 Amphitheatre Parkway, Mountain View, CA”) into geographic coordinates (like latitude 37.423021 and longitude -122.083739). This might be very useful if your planning to visualise the concentration of your data points in a map. Reverse geocoding is the process of converting geographic coordinates into a human-readable address. If you have good wrangling skills, you can extract other useful information like the nearby street/highway, district area or a landmark.

地理编码是将地址(如“ 1600 Amphitheatre Parkway,Mountain View,CA”)转换为地理坐标(如纬度37.423021和经度-122.083739)的过程。 如果您计划可视化地图中数据点的集中度,这可能非常有用。 反向地理编码是将地理坐标转换为人类可读地址的过程。 如果您有良好的摔跤技巧,则可以提取其他有用的信息,例如附近的街道/高速公路,地区或地标。

My aim was to use reverse-geocoding to extract the name of the highways on which those accidents occurred. There are many platforms available for geocoding, but I used the Google Maps Platform. It is one of the best platforms available which gives you accurate and detailed information. It also offers free services for up to 100,000 requests.

我的目的是使用反向地理编码来提取发生这些事故的高速公路的名称。 有许多可用于地理编码的平台,但是我使用了Google Maps Platform。 它是可为您提供准确和详细信息的最佳平台之一。 它还为多达100,000个请求提供免费服务。

Implementation for Reverse-Geocoding

反向地理编码的实现

I have used python here to implement reverse-geocoding.

我在这里使用python来实现反向地理编码。

Step 1: — Get your Google API Key and enable Geocoding API service. You can refer to this YouTube link to help you set it up.

步骤1:—获取您的Google API密钥并启用地址解析API服务。 您可以参考此YouTube 链接来帮助您进行设置。

Step 2: — Use the reverse_geocode function which converts the location coordinates and receives API output.

步骤2:—使用reverse_geocode函数转换位置坐标并接收API输出。

Remember you have to the input the location coordinates as a tuple. I have provided a screenshot of my implementation which converts 10 location coordinates and retrieves information in JSON format about the region via the API.

记住,您必须以元组的形式输入位置坐标。 我提供了实现的屏幕截图,该屏幕截图可转换10个位置坐标,并通过API以JSON格式检索有关该区域的信息。

Fig 2 Code Snippet
图2代码段

Note: For geocoding you have to use the ‘geocode(<address>)’ method. The result should be stored in a list of size 2.

注意:对于地理编码,您必须使用'geocode(<address>)'方法。 结果应存储在大小为2的列表中。

Step3: — Extracting the information in the API output to get the required information.

步骤3:—在API输出中提取信息以获取所需的信息。

This is perhaps the trickiest part of the implementation especially in reverse geocoding. There is a lot of information retrieved and you might need to wrangle the data you want before any analysis. Here’s how the output of one set of location coordinates i.e. (-37.81125,144.93391) in the above data frame looks like: -

这可能是实现过程中最棘手的部分,尤其是在反向地理编码中。 检索到很多信息,您可能需要在进行任何分析之前先整理所需的数据。 这是上述数据框中的一组位置坐标即(-37.81125,144.93391)的输出如下所示:-

Fig 3 JSON output
图3 JSON输出

As you can clearly see in the output, the accident occurred on the ‘City Link’ Highway in Victoria.

从输出中可以清楚地看到,事故发生在维多利亚州的“ City Link”高速公路上。

The problem I faced here was that the API output from all the accident records was not always in the same format as above. Many of them had different information put in different places. Hence I had to use my wrangling skills to extract the required information from each response.

我在这里遇到的问题是,所有事故记录的API输出并不总是与上述格式相同。 他们中许多人在不同的地方放置了不同的信息。 因此,我不得不使用自己的争吵技巧从每个响应中提取所需的信息。

So, I came up with the idea of extracting the route number of the highway instead of the name on which the accidents occurred. The highways in Victoria are numbered in the pattern starting with ‘M’ and a number. For example, M2 here is the ‘City Link Highway’ or also known as the Western Link. This format was very easy to extract using ‘re’ package of python since it followed a definite pattern. After the extraction, I was easily able to convert these codes to their respective Highway names. I have provided an illustration of that code as well.

因此,我想到了提取高速公路的路线号而不是事故发生的名称的想法。 维多利亚州的高速公路以“ M”和一个数字开头。 例如,这里的M2是“城市链接高速公路”或也称为“西方链接”。 这种格式很容易使用python的“ re”包提取,因为它遵循确定的模式。 提取后,我可以轻松地将这些代码转换为各自的公路名称。 我也提供了该代码的说明。

Note: You can also access the data through the JSON hierarchy, but then again it might not be the same always.

注意:您也可以通过JSON层次结构访问数据,但是同样,它也不一定总是相同的

Fig 4 Code Snippet
图4代码段

Mission Accomplished!

任务完成!

I personally really enjoyed the process of getting more information to support my analysis of the data set. It gave me deeper insights and understanding of the frequency of road accidents taking place in Victoria. Many times the information is not as detailed as you would expect and you will have to merge other data sets to get more value out of your main data set. If the above explanations are not clear, do reach out to me via Linkedin & I will be happy to assist you. Thank You!

我个人真的很喜欢获得更多信息以支持我对数据集进行分析的过程。 它使我对维多利亚州发生道路交通事故的频率有了更深刻的了解和理解。 很多时候,信息没有您期望的那么详细,您将不得不合并其他数据集以从主数据集中获得更多价值。 如果以上解释不清楚,请通过Linkedin与我联系,我们很乐意为您提供帮助。 谢谢!

翻译自: https://medium.com/swlh/making-more-sense-of-your-data-through-geocoding-api-3bcbc609c993

api地理编码


http://www.taodudu.cc/news/show-995233.html

相关文章:

  • 分布分析和分组分析_如何通过群组分析对用户进行分组并获得可行的见解
  • 数据科学家 数据工程师_数据科学家应该对数据进行版本控制的4个理由
  • 数据可视化 信息可视化_可视化数据以帮助清理数据
  • 使用python pandas dataframe学习数据分析
  • 前端绘制绘制图表_绘制我的文学风景
  • 回归分析检验_回归分析
  • 数据科学与大数据技术的案例_主数据科学案例研究,招聘经理的观点
  • cad2016珊瑚_预测有马的硬珊瑚覆盖率
  • 用python进行营销分析_用python进行covid 19分析
  • 请不要更多的基本情节
  • 机器学习解决什么问题_机器学习帮助解决水危机
  • 网络浏览器如何工作
  • 案例与案例之间的非常规排版
  • 隐私策略_隐私图标
  • figma 安装插件_彩色滤光片Figma插件,用于色盲
  • 设计师的10种范式转变
  • 实验心得_大肠杆菌原核表达实验心得(上篇)
  • googleearthpro打开没有地球_嫦娥五号成功着陆地球!为何嫦娥五号返回时会燃烧,升空却不会?...
  • python实训英文_GitHub - MiracleYoung/You-are-Pythonista: 汇聚【Python应用】【Python实训】【Python技术分享】等等...
  • 工作失职的处理决定_工作失职的处理决定
  • vue图片压缩不失真_图片压缩会失真?快试试这几个无损压缩神器。
  • 更换mysql_Docker搭建MySQL主从复制
  • advanced installer更换程序id_好程序员web前端培训分享kbone高级-事件系统
  • 3d制作中需要注意的问题_浅谈线路板制作时需要注意的问题
  • cnn图像二分类 python_人工智能Keras图像分类器(CNN卷积神经网络的图片识别篇)...
  • crc16的c语言函数 计算ccitt_C语言为何如此重要
  • python 商城api编写_Python实现简单的API接口
  • excel表格行列显示十字定位_WPS表格:Excel表格打印时,如何每页都显示标题行?...
  • oem是代工还是贴牌_代加工和贴牌加工的区别是什么
  • redis将散裂中某个值自增_这些Redis命令你都掌握了没?

api地理编码_通过地理编码API使您的数据更有意义相关推荐

  1. [转载] api地理编码_通过地理编码API使您的数据更有意义

    参考链接: Python | 反向地理编码以使用地理坐标获取地图上的位置 api地理编码 Motivation 动机 In my second semester of my Master's degr ...

  2. r语言处理数据集编码_在强调编码语言或工具之前,请学习这3个基本数据概念

    r语言处理数据集编码 重点 (Top highlight) I got an Instagram DM the other day that really got me thinking. This ...

  3. 算法训练营 重编码_我在编码训练营中的经验(以及是否适合您)

    算法训练营 重编码 by Florian Mueller 通过弗洛里安·穆勒(Florian Mueller) 我在编码训练营中的经验(以及是否适合您) (My experience with a c ...

  4. api接口优化_使用电池状态API优化开发

    api接口优化 Imagine if you could program your app to adapt to the end user's device - such as turning of ...

  5. python 分类变量编码_深度学习编码分类变量的3种方法——AIU人工智能学院

    :数据科学.人工智能从业者的在线大学. 数据科学(Python/R/Julia) 作者 | CDA数据分析师 像Keras中的机器学习和深度学习模型一样,要求所有输入和输出变量均为数字. 这意味着,如 ...

  6. 曼彻斯特编码_两种编码方式以及两种帧结构

    一.不归零制编码(Non-Return to Zero) 对于不归零制编码是最简单的一种编码方式,正电平代表1,负电平代表0.如下图: 其实在不归零制编码中有一个很明显的缺陷,那就是它不是自同步码. ...

  7. mysql 数据库编码怎么看,查看数据库编码_查看mysql编码方式 mysql数据库编码查看方法...

    摘要 腾兴网为您分享:查看mysql编码方式 mysql数据库编码查看方法,桌面日历,智能互联,政务易,优美图等软件知识,以及pptv版,广东省app,京东钱包app,星露谷物语补丁,51管家,翡翠出 ...

  8. loinc编码_通用检验编码系统(Universal Laboratory Test Code System)于香港电子健康纪录计划的应用...

    原标题:通用检验编码系统(Universal Laboratory Test Code System)于香港电子健康纪录计划的应用 通用检验编码系统(Universal Laboratory Test ...

  9. 创建表 编码_创建没有编码的专业商业网站

    创建表 编码 Do you have a great idea for an online business, but lack the technical skills to build a web ...

最新文章

  1. symfony2项目访问app_dev.php不显示debug工具栏的问题
  2. 第37篇 Asp.Net源码解析(二)--详解HttpApplication
  3. 设置 Confluence 6 日志
  4. Divan and a New Project 贪心,模拟(1000)
  5. 算法学习之路|最小生成树—kruskal
  6. 将url参数字符串转成数组
  7. Java高并发编程详解系列-Future设计模式
  8. UVA 11198 Dancing Digits
  9. 自己动手写Docker系列 -- 5.7实现通过容器制作镜像
  10. xml property标签注入一个类变量_java开发两年,连Spring的依赖注入的方式都搞不清楚,你工作可能有点悬!...
  11. c++builder 代码格式化工具 AStyle
  12. EFM32片内外设--TFT 汉字字库
  13. 目前国内最热门的四款远程桌面控制软件
  14. 无盘服务器秒卡 锐起0359,锐起无盘系统问题汇集
  15. 信息系统运行管理员有必要考吗?现在备考还来得及吗?
  16. 博世BMI160六轴传感器I2C通信配置
  17. vs html复选框,组合框和复选框
  18. 全方位了解8.0系统下的Handler
  19. 【收藏】前端开发必备:前端开发不得不收藏的网站,提高200%开发效率!
  20. 微服务API网关框架详解

热门文章

  1. BZOJ-2005能量采集-数论函数
  2. netstat 相关命令解析
  3. Leetcode1512. 好数对的数目 抽出本质原型 利用范围条件
  4. 1061 判断题 (15 分)
  5. Java面试题及答案,mysql类型
  6. web开发项目,web前端CSS全局样式,面试必问
  7. Kettle7.1在window启动报错
  8. 感想3-对于业务逻辑复用、模板复用的一些思考(未完)
  9. 移动前端框架重构几个关键问题
  10. 在UITouch事件中画圆圈-iOS8 Swift基础教程