Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!a1g2000hsb.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Distance from coast map
Date: Tue, 20 May 2008 03:13:29 -0700 (PDT)
Organization: http://groups.google.com
Lines: 29
Message-ID: <6565add0-03ef-4428-87f4-52f0e838bfd5@a1g2000hsb.googlegroups.com>
References: <1211273718.794911@irys.nyx.net>
NNTP-Posting-Host: 212.17.141.54
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1211278409 29571 127.0.0.1 (20 May 2008 10:13:29 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 20 May 2008 10:13:29 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: a1g2000hsb.googlegroups.com; posting-host=212.17.141.54; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET 
Xref: news.mathworks.com comp.soft-sys.matlab:469431


On 20 Mai, 10:55, Francis Burton <fbur...@nyx.net> wrote:
> Suppose you have a vector of coordinates listing points around
> the coastline of a country - or simply the borders of an inland
> country. If you wanted to make a map (contour or heatmap) showing
> the minimum distance of any point location from the coast/border,
> what would be your approach to solving this problem in MATLAB?
> I can think of a couple of 'obvious' ways: 1) construct a grid
> of points and for each point do a bisection search for the radius
> at which a circle centred on the point intersects the lines that
> define the border, and 2) progressively dilate an image of the
> coastline, assigning a distance measure (which would be mapped
> to colour) at each iteration. The second method would likely be
> much faster, but also less accurate because of truncations to
> 'pixel distance'. Are there better approaches?
>
> I realize this is not a MATLAB-specific question, although I will
> implement the solution in MATLAB. (Also, this is *not* homework!)
>
> Looking forward to any suggestions or discussion.

The border or coastline is presumably represented as an ordered
list of points, or equivalently, a list of edges.

You might want to scan the list for the point or edge which
is closest to the specified point, and maybe refine from there.

You may also want to ask such questions on comp.graphics.algorithms.

Rune