How to find the ocean using the Google Maps API

I’m trying to figure out where the ocean is in Google Maps arbitrary view.

Actually I have a lat-lon (range of points when they connect together with the coastline) of the coastline. But how can I determine which side of this line is the coastline?

One possible solution would be to find the latton of the nearest service or city or business, or something else, and then the ocean, obviously, is on the other side (given the rather small closed polygon).

Is there a better way?

+4
source share
2 answers

There is nothing in the Google Maps API that tells you whether there will be an arbitrary point on land or at sea.

You do not need the nearest service, city or business as a starting point. I think you could build a heuristic to reverse the geocoding of several arbitrary points on one side of your coastline and check the result of G_GEO_UNKNOWN_ADDRESS. Some locations on land will not be known, but if you change the geocode a little, you can come up with a useful result.

There are several existing StackOverflow questions that may be helpful:

+1
source

What about the Google Maps Elevation API ?

Beware of the Netherlands , it is below sea level, as I am sure that there are many other places.

0
source

Source: https://habr.com/ru/post/1304972/


All Articles