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

Home » Public Forums » archive » Re: map_proj_inverse question
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: map_proj_inverse question [message #74386 is a reply to message #74385] Wed, 12 January 2011 10:15 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
nata writes:

> I'm setting a projection using MAP_SET (IDL 7.1), after that I want to
> retrieve the lat/lon values of the mouse position.
> What I'm doing is the following :
>
> 1) I retrieve the mouse position, using event.X and event.Y
> 2) After that, I normalize the X,Y position, taking in account the
> UV_BOX of the map structure
>
> uv_box_lenght=[!map.UV_BOX[2]-!map.UV_BOX[0],!map.UV_BOX[3]- !
> map.UV_BOX[1]]
>
> X=event.X/dim[0]*uv_box_lenght[0] + uv_box_lenght[0]
> Y=event.Y/dim[1]*uv_box_lenght[1] + uv_box_lenght[1]
>
> 3) And I calculate the lat/lon values using map_proj_inverse
>
> PRINT, MAP_PROJ_INVERSE(X,Y,MAP_STRUCTURE=!map)
>
> Mmmmh !!!! Something is not working well because the values I obtain
> are incorrect.
> What am I missing ?

If you have a map coordinate system set up, just
use Convert_Coord to convert your device coordinates
to data coordinates. If these are in projected meters
(I hope so!), then just use Map_Proj_Inverse to convert
these to lat/lon.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Extracting cluster indices from a dendrogram
Next Topic: Re: FFT of gaussian

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

Current Time: Sun Oct 12 01:12:36 PDT 2025

Total time taken to generate the page: 0.01061 seconds