Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!nx01.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!k1g2000prb.googlegroups.com!not-for-mail
From: NZTideMan <mulgor@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Distance from coast map
Date: Tue, 20 May 2008 03:26:45 -0700 (PDT)
Organization: http://groups.google.com
Lines: 42
Message-ID: <9147ac20-f5b1-49a5-9e0e-ea4ecef9f612@k1g2000prb.googlegroups.com>
References: <1211273718.794911@irys.nyx.net> <6565add0-03ef-4428-87f4-52f0e838bfd5@a1g2000hsb.googlegroups.com>
NNTP-Posting-Host: 202.78.152.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1211279206 31986 127.0.0.1 (20 May 2008 10:26:46 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 20 May 2008 10:26:46 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: k1g2000prb.googlegroups.com; posting-host=202.78.152.105; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Maxthon; 
X-HTTP-Via: 1.1 nc1 (NetCache NetApp/6.0.5P1)
Xref: news.mathworks.com comp.soft-sys.matlab:469432


On May 20, 10:13=A0pm, Rune Allnor <all...@tele.ntnu.no> wrote:
> 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- Hide quoted text -
>
> - Show quoted text -

If it's a country, unless it's a pretty small country, you'll need to
use a map projection to get the right answer.  Gnomonic projection is
a good one for this.  It transforms curves on the Great Circle to
lines on a (distorted) map.