Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!uunet!dca.uu.net!ash.uu.net!spool.news.uu.net!not-for-mail
Newsgroups: comp.soft-sys.matlab
Subject: Distance from coast map
From: Francis Burton <fburton@nyx.net>
User-Agent: nn/6.6.5
Organization: Nyx Net, The Spirit of the Night
Message-ID: <1211273718.794911@irys.nyx.net>
Cache-Post-Path: irys.nyx.net!1319@nyx3.nyx.net
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
Date: 20 May 2008 08:55:19 GMT
Lines: 20
NNTP-Posting-Host: 206.124.29.6
X-Trace: 1211273719  3410 206.124.29.6
Xref: news.mathworks.com comp.soft-sys.matlab:469422


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.

Francis