如何使用Google地图API查找海洋 [英] How to find the ocean using Google Maps API

查看:214
本文介绍了如何使用Google地图API查找海洋的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出海洋在任意Google地图视图中的位置。



实际上我有一个纬度(一个点的范围,形成海岸线)的海岸线。但是,我怎么知道这条线的哪一边是海岸线呢?

一种可能的解决方案是查找最近的服务或城镇或企业或某物的纬度,然后海洋明显在另一边(给定一个足够小的包围多边形)。



有没有更好的方法?

解决方案

谷歌地图API会告诉你,如果任意一点在陆地或海上。

您不需要就近的服务,城镇或商业作为起点。我认为,您可以构建一种启发式方法,将一小撮反向地理编码海岸线一侧的任意点,并检查G_GEO_UNKNOWN_ADDRESS结果。陆地上的某些位置将是未知的,但如果您将地理编码反转一些,则应该能够得出有用的结果。

有几个现有的StackOverflow问题可能会有用:


I am trying to figure out where the ocean is in an arbitrary Google Maps view.

I actually have the lat lon (a range of points, when joined together form the coastline) of the coastline. But how do I tell which side of this line is the coastline?

One possible solution would be to find the latlon of the nearest service or town or business or something, and then the ocean is obviously on the other side (given a small enough enclosing polygon).

Is there a better way?

解决方案

There is nothing in the Google Maps API that will tell you if an arbitrary point is on land or sea.

You wouldn't need the nearest service, town or business as a starting point. I think you could build a heuristic that reverse geocoded a handful of arbitrary points on one side of you coast line and check for the G_GEO_UNKNOWN_ADDRESS result. Some locations on land will be unknown, but if you reverse geocode a few, you should be able to come up with a useful result.

There are a couple of existing StackOverflow questions that might be useful:

这篇关于如何使用Google地图API查找海洋的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆