Getting an intersection with Google Places/Geocoding API

后端 未结 7 1427
野性不改
野性不改 2020-12-29 10:58

I\'m trying to find the two closest streets to a point with the Google Places API (basically to indicate the closest intersection). However, any result will only ever return

7条回答
  •  心在旅途
    2020-12-29 11:43

    GeoNames provides a Geocoding API for nearest intersection from latitude/longitude coordinates.

    http://www.geonames.org/maps/us-reverse-geocoder.html#findNearestIntersection

    The JSON response looks like this:

    {"intersection":
     {"adminName2":"San Mateo",
      "street2":"Curtis St",
      "postalcode":"94025",
      "street1":"Roble Ave",
      "adminCode1":"CA",
      "distance":"0.08",
      "countryCode":"US",
      "lng":"-122.180842",
      "placename":"Menlo Park",
      "lat":"37.450649",
      "adminName1":"California"
     },
     "credits":"1.0"
    }
    

    street1 and street2 are the cross streets.

提交回复
热议问题