Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>These are 2 different ways, you may try:</p> <ul> <li><p>You can use <a href="http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding">Google Maps Reverse Geocoding</a> . In result set you can determine whether it is water by checking <code>types</code>. In waters case the type is <code>natural_feature</code>. See more at this link <a href="http://code.google.com/apis/maps/documentation/geocoding/#Types">http://code.google.com/apis/maps/documentation/geocoding/#Types</a>.</p> <p>Also you need to check the names of features, if they contain <code>Sea, Lake, Ocean</code> and some other words related to waters for more accuracy. For example the deserts also are <code>natural_feature</code>s.</p> <p><strong>Prons</strong> - All detection process will be done on client's machine.No need of creating own server side service.</p> <p><strong>Cons</strong> - Very inaccurate and the chances you will get "none" at waters is very high.</p></li> <li><p>You can detect waters/lands by pixels, by using <a href="http://code.google.com/apis/maps/documentation/staticmaps/index.html">Google Static Maps</a>. But for this purpose you need to create http service. </p> <p>These are steps your service must perform:</p> <ol> <li>Receive <code>latitude</code>,<code>longitude</code> and <code>current zoom</code> from client.</li> <li>Send <code>http://maps.googleapis.com/maps/api/staticmap?center={</code>latitude<code>,</code>longitude<code>}&amp;zoom={</code>current zoom`}&amp;size=1x1&amp;maptype=roadmap&amp;sensor=false request to Google Static Map service.</li> <li>Detect pixel's color of 1x1 static image.</li> <li>Respond an information about detection.</li> </ol> <p>You can't detect pixel's color in client side. Yes , you can load static image on client's machine and draw image on <code>canvas</code> element. But you can't use <code>getImageData</code> of canvas's context for getting pixel's color. This is restricted by cross domain policy. </p> <p><strong>Prons</strong> - Highly accurate detection</p> <p><strong>Cons</strong> - Use of own server resources for detection</p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload