Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!c36g2000prc.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: River miles
Date: Tue, 18 Nov 2008 06:09:18 -0800 (PST)
Organization: http://groups.google.com
Lines: 64
Message-ID: <6875d2af-8eb2-443a-a831-d4c1773c1180@c36g2000prc.googlegroups.com>
References: <gfst52$caq$1@fred.mathworks.com> <90f017a9-906d-4c7d-8ac5-7167e15e0d8c@u18g2000pro.googlegroups.com> 
	<gfug1c$356$1@fred.mathworks.com>
NNTP-Posting-Host: 77.17.111.131
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1227017359 22697 127.0.0.1 (18 Nov 2008 14:09:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 18 Nov 2008 14:09:19 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: c36g2000prc.googlegroups.com; posting-host=77.17.111.131; 
	posting-account=VAp5gAkAAAAmkCze5hvZtMeedpZWNthI
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET 
	CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:501416


On 18 Nov, 14:30, "John D'Errico" <woodch...@rochester.rr.com> wrote:
> Rune Allnor <all...@tele.ntnu.no> wrote in message <90f017a9-906d-4c7d-8ac5-7167e15e0...@u18g2000pro.googlegroups.com>...
> > On 18 Nov, 00:01, "Travis" <sinuso...@hotmail.com> wrote:
> > > I have a file with data at lat/longs, and a file with River miles at lat/=
> > longs. =A0How can I interpolate the River mile onto the data. =A0
>
> > What do you try to do? Do you have the lat-longs and
> > distances for the same points? If so it ought to be
> > trivial to interpolate the data.
>
> > Rune
>
> Consider this simple example. I have a "river" that passes
> through the three points:
>
> xy = [0 0;0 1; 1 1]
>
> At each point, I have some other parameter or parameters
> associated, some values of z at those points. Now, I have
> another point, perhaps at the (x,y) coordinates (0.20, 0.75).
> How should I choose to interpolate the z value onto that
> new point?

First, assign a distance d for each of the points (view
table with fixed-width fonts):

       lat long  d
xy = [ 0     0   0;
       0     1   1;
       1     1   2;]

Use some measure to project the position onto the line
(shortest distance, lat-priority, long-priority) and
obtain a distance estimate for the observed point.
Go on from there.

> I'll assume that the "river" meanders around so that it passes
> through this new point, but the interpolation process is surely
> not trivial in general.

If you didn't track the river in sufficient detail you
are basically in over your head anyway.

> You must decide how the river has
> meandered between the existing points, and even decide
> which pair of points this new point lies between.

Nope. That's guesswork, as the measurements are too sparse
to be useful. Use at your own risk. If you really want
to track a meandering river, you need to sample its
positions far denser than the loops in the river.

> Yes, it is surely doable, and nztideman has suggested a
> method that has serious merit. But it is not trivial.

It's basically the same method I suggested. Don't expect
all points to map into the interior of any line segment,
though. For instance, with the track you suggested,
where do you map the point (0.9, 1.1)? And don't expect
the answets to be unique; where do you assign (1.1,0.9)?

The answers depend on what projection rule you select.

Rune