<div class="gmail_quote">On Tue, Jul 6, 2010 at 2:42 PM, Jim Morgan <span dir="ltr"><<a href="mailto:jim@datalude.com">jim@datalude.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Eugene Alvin Villar wrote, On Tuesday, 06 July, 2010 11:57 AM:<br>
<div class="im">> To clarify things, the sawtooth detection script is quite naive. It<br>
> simply detects if there are at three or more series of nodes where each<br>
> pair of adjacent nodes have the same latitude or longitude. This will<br>
> also detect any three linear nodes that all have the same latitude or<br>
> longitude like this: o----o----o<br>
<br>
</div>There are a number of cases where a near-straight line is acceptable. Maybe it would be better -- and I'm not sure if this is possible -- to examine, say, a series of three nodes. It would check if the first two have the same lat or long. If they have the same lat, then the second and third points would need the same long; if they have the same long, then the second and third points would need the same lat. Then you'd be correctly identifying the step-fashion jaggies, rather than straight lines.<br>
<br>
<br>
To increase certainty, you could make this a series of four, or five points. Again I don't know if this is possible or plausible, but it would seem like a better pattern to look for. Not sure if the formatting will come through but ....<br>
<br>
<br>
p1 |_____ p2<br>
|<br>
|<br>
p3 |______ p4<br>
<div class="im"> |<br></div></blockquote><div><br>I intentionally wanted to detect collinear nodes since I wasn't sure if
the original SRTM-based data have those collinear nodes or not.<br>
<br>
In any case, the script detects sawtooth coasts if the latitude or the
longitude is *exactly* the same, right down to the 7th decimal place (which translates to an accuracy of about 1 cm). So if there are a series of coastline nodes that have the same latitude or longitude for each adjacent pair of nodes, then they are most likely generated from raster data, like SRTM. I don't think Mother Nature created coasts that follow latitudes and longitudes. :-)<br>
<br></div></div>