comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Astronomys` Sixth Neighbour Needs Help
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Astronomys` Sixth Neighbour Needs Help [message #36019 is a reply to message #35884] Mon, 11 August 2003 08:28 Go to previous messageGo to previous message
wmconnolley is currently offline  wmconnolley
Messages: 106
Registered: November 2000
Senior Member
I come across this sometimes. The basis of the solution is usually
something like:

> lon1=data.longitude & lon1(i)=-999
> lat1=data.latitude & lat1(i)=-999

> mindist=min(sqrt((lon1-lon1(i))^2+(lat1-lat1(i)^2),j)

That finds you the closest city (j), without using the inner loop, and
so is much faster. OK, it uses distance in lat-lon space: if you care about
the exact coordinates you can use convert_coord to get it in whatever
map projection you are using.

-W.

--
William M Connolley | wmc@bas.ac.uk | http://www.antarctica.ac.uk/met/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
I'm a .signature virus! copy me into your .signature file & help me spread!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HIST_ND
Next Topic: Getting the errors on the fitted parameters using mpfit2dpeak

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:56:25 PDT 2025

Total time taken to generate the page: 0.00490 seconds