Determine if a point is in the sea

852 views
Skip to first unread message

sgiddings

unread,
Jul 22, 2011, 4:05:09 AM7/22/11
to Google Maps JavaScript API v3
Within my site, I give the user the ability to click on the map to
place a marker.
When this is done, I then go and do a reverse geocode to get the
address of the location.

However, if the user clicks in the sea, the reverse geocode will
return the nearest land address without any indication that the lat/
lng is in reality in the sea.

Is there a way to determine if a given lat/lng is in the sea ?

Rossko

unread,
Jul 22, 2011, 5:29:53 AM7/22/11
to Google Maps JavaScript API v3
> Is there a way to determine if a given lat/lng is in the sea ?

Search in the v2 group, where it has cropped up a few times. The
Elevation service has become available since many of the discussions.
http://groups.google.com/group/google-maps-api/search?group=google-maps-api&q=test+water
http://groups.google.com/group/google-maps-api/search?group=google-maps-api&q=find+ocean

sgiddings

unread,
Jul 22, 2011, 10:03:52 AM7/22/11
to Google Maps JavaScript API v3
Thanks for this Rossko.
Sounds like a "work-around" really.
Would it not be more reasonable to have the reverse geocode result
indicate that the requested lat/lng is in fact over the sea ?

On Jul 22, 11:29 am, Rossko <ros...@culzean.clara.co.uk> wrote:
> > Is there a way to determine if a given lat/lng is in the sea ?
>
> Search in the v2 group, where it has cropped up a few times.  The
> Elevation service has become available since many of the discussions.http://groups.google.com/group/google-maps-api/search?group=google-ma...http://groups.google.com/group/google-maps-api/search?group=google-ma...

geoco...@gmail.com

unread,
Jul 22, 2011, 10:12:41 AM7/22/11
to Google Maps JavaScript API v3
On Jul 22, 10:03 am, sgiddings <mr.s.giddi...@gmail.com> wrote:
> Thanks for this Rossko.
> Sounds like a "work-around" really.
> Would it not be more reasonable to have the reverse geocode result
> indicate that the requested lat/lng is in fact over the sea ?

It would be if that is what the reverse geocoder did.

from the documentation:
http://code.google.com/apis/maps/documentation/javascript/services.html#ReverseGeocoding
+ Reverse Geocoding (Address Lookup)
+ The term geocoding generally refers to translating a human-readable
address into a location on a map. The process of doing
+ the converse, translating a location on the map into a human-
readable address, is known as reverse geocoding.

I don't think "Atlantic Ocean" (pick you favorite "sea") is a (postal)
address (not that all the geocoding database knows about is
addresses).

This might be a good enhancement request.

-- Larry

>
> On Jul 22, 11:29 am, Rossko <ros...@culzean.clara.co.uk> wrote:
>
>
>
>
>
>
>
> > > Is there a way to determine if a given lat/lng is in the sea ?
>
> > Search in the v2 group, where it has cropped up a few times.  The
> > Elevation service has become available since many of the discussions.http://groups.google.com/group/google-maps-api/search?group=google-ma......

Rossko

unread,
Jul 22, 2011, 10:17:02 AM7/22/11
to Google Maps JavaScript API v3
> Sounds like a "work-around" really.

It is. Some landmass is below sea level, some folk would include e.g.
the Great Lakes as "sea" and some wouldn't, etc. etc.

It's up to you engineer something different if you want it. Example,
maintain a database of polygons of world landmass and point-in-poly
test each place you're interested in.

> Would it not be more reasonable to have the reverse geocode result
> indicate that the requested lat/lng is in fact over the sea ?

Why? Reverse geocoding provides a service to supply the nearest
address to a point. It's not purposed for your requirement.

Rossko

unread,
Jul 22, 2011, 10:27:58 AM7/22/11
to Google Maps JavaScript API v3
I don't mean to discourage you from making an enhancement request, but
a) it might not be as easy as you think since I doubt the geocoder
database even holds the necessary information at present
b) definition of "sea" needs careful thought and won't suit everybody.
e.g. inland seas and lakes, rivers, iced-over ocean, international or
territorial waters, etc etc
Reply all
Reply to author
Forward
0 new messages