Google Maps distance to sea coast

前端 未结 4 1455
日久生厌
日久生厌 2021-02-04 00:18

Given just one point in Google Maps, is there anyway to know the distance to the nearest point in the coast (that is the minimun distance to the sea), and which point in the coa

4条回答
  •  闹比i
    闹比i (楼主)
    2021-02-04 01:02

    I know this is a 7-year old question, but there is now a Distance to Coast REST API: https://www.kbgeo.com. It returns exactly what the OP requested - distance to the nearest coastal point and what that point is. JSON response:

    {
      "distanceInMiles": 702.4893212372758,
      "targetPoint": {
        "lat": 43.045583,
        "lng": -89.3799951
      },
      "coastlinePoint": {
        "lat": 38.662389,
        "lng": -77.236111
      }
    }
    

    There's a live demo page at http://demo.kbgeo.com.

    Disclosure: I wrote this API and therefore have a vested interest. However, it does exactly match OP's needs. Another API that does the same thing is maprisk.com.

提交回复
热议问题