Path: news.mathworks.com!not-for-mail
From: "Travis" <sinusoid2@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: River miles
Date: Tue, 18 Nov 2008 15:13:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 67
Message-ID: <gfum1t$h12$1@fred.mathworks.com>
References: <gfst52$caq$1@fred.mathworks.com> <90f017a9-906d-4c7d-8ac5-7167e15e0d8c@u18g2000pro.googlegroups.com> <6875d2af-8eb2-443a-a831-d4c1773c1180@c36g2000prc.googlegroups.com>
Reply-To: "Travis" <sinusoid2@hotmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227021181 17442 172.30.248.35 (18 Nov 2008 15:13:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 18 Nov 2008 15:13:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1257700
Xref: news.mathworks.com comp.soft-sys.matlab:501443


Rune Allnor <allnor@tele.ntnu.no> wrote in message <6875d2af-8eb2-443a-a831-d4c1773c1180@c36g2000prc.googlegroups.com>...
> 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

Wolfgang, that is a correct assumption.  Rune the river was mapped using a GPS that recorded time, posiion, and heading each time the heading changed.  It was then interpolated so that data taken between heading chages have unique lat/long values.  Are you suggesting that I break the river up into segments that do not double back on themselves and use interp1 on each segment?  I have a 60 mile stretch of river to do this for.