Re: Preserving coordinate transformation [message #50817 is a reply to message #50814] |
Tue, 17 October 2006 05:53   |
Sverre Solberg
Messages: 18 Registered: February 2005
|
Junior Member |
|
|
Hm, well, that's just what I tried, still it is unclear to me how to
actually use the !x, !y and !map. I cant simply reset, like !x = <saved
!x> etc, as I guess I also need the !D which is a read-only
variable(?). Furthermore, I havent been able to dig out how/where idl
do the conversion from device to map coordinates. The documentation for
convert_coord is only describing transformation between data, device
and normal, but doesnt mention the situation when there's a map
involved. Trying to hardcode the transformation formulas described in
the manual for convert_coord (after first saving the values stored in
!x, !y and !d) doesnt seem to give the correct answer. Am I missing
some important point here?
Sverre
Wox wrote:
> Save the !x, !y and !map after making the plot and restore them before
> you use convert_coord.
>
>
> On 17 Oct 2006 03:47:17 -0700, "Sverre Solberg" <sso@nilu.no> wrote:
>
>> I plot a map (by the MAP_SET etc routines) inside a widget_draw area
>> using "/button_events". When the user is clicking on the map the
>> program use the event (x and y) and the "convert_coord" to compute the
>> geographical coordinates of the position. However, when making other
>> plots in between, opening other draw widgets, the built-in coordinate
>> transformations (device->data) changes and destroys the conversion to
>> geo. coord. next time this window is clicked on. How could I store the
>> coordinate transformation? If it was a simple 2D plot, without the map,
>> I could just save the !x and !y variables and compute the conversion
>> myself, but that dont work when there's a map projection. I then need
>> to know how idl converts from device coordinates (returned by widget
>> draw) to map coordinates (lat/long) and I havent been able to find out
>> that. Any hints?
>>
>> Sverre
|
|
|