Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: River miles
Date: Tue, 18 Nov 2008 09:20:19 +0000 (UTC)
Organization: Universit&#228;t Basel
Lines: 21
Message-ID: <gfu1cj$rs$1@fred.mathworks.com>
References: <gfst52$caq$1@fred.mathworks.com> <4521b8d9-2021-4ff0-b430-08822a0ce2bc@s9g2000prm.googlegroups.com> <gftkl5$6b$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227000019 892 172.30.248.38 (18 Nov 2008 09:20:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 18 Nov 2008 09:20:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 870595
Xref: news.mathworks.com comp.soft-sys.matlab:501368


I think you need to better specify what your data looks like. I assume you have a 3xn array with x and y coordinates and river length and a 2xn array with vertex coordinates of the river course. Am I right to assume so?




"Travis" <sinusoid2@hotmail.com> wrote in message <gftkl5$6b$1@fred.mathworks.com>...
> NZTideMan <mulgor@gmail.com> wrote in message <4521b8d9-2021-4ff0-b430-08822a0ce2bc@s9g2000prm.googlegroups.com>...
> > On Nov 18, 12:01 pm, "Travis" <sinuso...@hotmail.com> wrote:
> > > I have a file with data at lat/longs, and a file with River miles at lat/longs.  How can I interpolate the River mile onto the data.  I have tried using interp2, but that has been hugely unsuccessful. Please keep in mind that the river meanders and frequently doubles back on itself in both latitude and longitude.
> > 
> > Lets say you have s(x,y) river miles, where x and y are the long and
> > lat respectively, and you want to find s for a particular xp, yp.
> > You need to split your problem into two parts:
> > 1. Find the segment in x,y where xp,yp lies by firstly finding the
> > segments where the normal from xp,yp is inside the segment and
> > secondly by minimising the distance of the normal to each of those
> > segments.
> > 2. Interpolate on s within the optimal segment.
> 
> 
> I have tried seperating the lat and long and using interp 1, but since it double back on itself, the values are not distinct, and it doesn't work.