Does the Bing API contain a distance to coast service from an address? All we need to do is calculate the distance to a major coastline (Atlantic or Gulf of Mexico).
4 Answers
I know this is an old question, but there is now a Distance to Coast REST API: http://www.kbgeo.com. Given a latitude and longitude it returns the 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 match OP's needs. Another API that does the same thing is maprisk.com.
If you have a geocoded address near the coast you can route (therefore calculate distance) from a location to the *coast (a know location, address, point)
http://msdn.microsoft.com/en-us/library/ff701718.aspx
*Find location by point
http://msdn.microsoft.com/en-us/library/ff701710.aspx
**you will need a Bing Maps API Key.
-
-
tinyurl.com/Atlantic2Gulf - Gulf if geocoded but your expecting coast to coast - your not going to get it.– Mapperz ♦Commented Mar 23, 2011 at 16:31
-
Bing Maps EXPLORE has an app 'Distance Calculator' - straight line distance bing.com/maps/explore/#/93w4qlzopbc45x56 is an example– Mapperz ♦Commented Mar 23, 2011 at 16:38
You can do the following:
- Get boundaries of all land, or of nearby countries. This can be done in several ways, there are several open data sources, also the Bing Maps GeoData API. The higher the resolution the data, the more accurate the calculations, but the slower the calculations will be.
- Calculate the closest edge on the boundary to the point.
- If you only want straight line distance, use a standard distance calculation. This will work for any point.
- If you want driving distance, try calculating a route between the two points using the Bing Maps routing API. This will only work if both points are within about 150 meters of a road.
Here is a code sample that does this using the Bing Maps V8 web control: http://bingmapsv8samples.azurewebsites.net/#Distance%20to%20nearest%20coast
Note that since this is using JavaScript it will be a bit slow. A database solution would provide the fastest calculation.
No, it does not, but you can use this website: https://www.distancetocoast.com/?search=Coconut+Grove%2C+Miami%2C+FL%2C+USA to calculate this distance to coast. For more info read https://www.distancetocoast.com/about