【问题标题】:From known coordinates how to determine what kind of area it is on Google Maps?从已知坐标如何确定它在谷歌地图上的区域类型?
【发布时间】:2018-01-17 12:30:00
【问题描述】:

例如,我有坐标(纬度和经度),我想知道这个坐标的位置是在道路、公园或 Google 地图上的建筑物上。谷歌地图有这样的 API 来返回这种数据吗?谢谢。

【问题讨论】:

    标签: google-maps google-maps-api-3 coordinates latitude-longitude


    【解决方案1】:

    您现在拥有的是 Geocoder API [1] ,通过它您可以进行反向地理编码 [2] 或者换句话说,您提出一个带有纬度和经度的请求,您会得到一个格式化的地址(或多个)作为响应,在响应中有一个“类型”字段,为您提供有关地址类型的信息,支持的一些类型:[3]。

    [1]https://developers.google.com/maps/documentation/geocoding/intro

    [2]https://developers.google.com/maps/documentation/geocoding/intro#ReverseGeocoding

    [3]https://developers.google.com/maps/documentation/geocoding/intro#Types

    建议您阅读文档,您可以使用它做更多事情。

    您还可以将 Places API 与地理编码器一起使用,支持更多类型:[4]。

    [4]https://developers.google.com/places/supported_types

    【讨论】:

      猜你喜欢
      • 2016-08-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多