Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My suggestion:</p> <p>Solve it whitout <em>DEM</em>.<br></p> <p>1) You have given a location loc with latidude and longitude in decimal degrees WGS84.<br> 2) You have given the coats line polygon in WGS84, to.</p> <p>Now to find the East West Distance from loc to polygon:<br> You want to find the crossing of the latitude value of loc with the border poly (east of current position):<br></p> <p>Start at the beginning of border poly point 0: Find the line where <code>border[i].lat&lt;= loc.lat and border[i+1] &gt; loc.lat AND border[i].longitude &gt;= loc.longitude</code>. If you found the line, make a linear interpolation between (i, and i+1) to find the exact (lat/long) intersection.<br></p> <p>Now you have the intersection to the ocean: Calculate the distance loc -> intersection with <code>haversine</code> formula.</p> <p>(Once this works you can later decide if you want to speed up with a binary search)</p> <p>Same you do for the other 3 direction, with exchange lat/long and greater/smaller</p> <p><strong>For NW and others:</strong> Run along the ocean border points and calculate the bearing from loc to border point(search for aviation formulas or greater circle bearing calculations)</p> <p>store the line /or two points where bearing steps over the 315 degrees. This line then intersects the 315°, Theretically ther ecould be more than one such line store all such lines, and take the one whoch is closest to location (</p> <p>Now interpolate both points to get exact cut with 315.</p> <p>Update: <a href="http://www.movable-type.co.uk/scripts/latlong.html" rel="nofollow">Bearing formula</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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