Re: Display and Navigate Image in IDL 8.2 [message #81439 is a reply to message #81350] |
Wed, 12 September 2012 14:23   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Chris Torrence writes:
> Does this help?
>
> googleImage = Read_Image('googleimg.png')
>
> XRange = [-11711131d, -11688226d] ; (meters)
> YRange = [4914254d, 4937159.5d] ; (meters)
>
> im = IMAGE(googleImage, /BOX_AXES, GRID_UNITS='meters', $
> IMAGE_LOCATION=[xrange[0],yrange[0]], $
> IMAGE_DIMENSIONS=[xrange[1]-xrange[0],yrange[1]-yrange[0]], $
> MAP_PROJECTION='Mercator', ELLIPSOID='WGS84')
> m = im.mapprojection
> lonlat = m.MapInverse(im.xrange, im.yrange)
> m.limit = [lonlat[[1,0,3,2]]]
>
> At least with IDL 8.2.1, I'm getting an image in "meters", with a box grid. When I click on the image, and then move the mouse, it reports lat/lon position.
Well, the last step has the effect of blurring the image, I think
because it causes the image to be warped into the map projection
space. To avoid blurring, you have to separate the display of
the image from the map projection. Basically, you want to lay
the map projection down "on top" of the image.
See the end of this article for a further explanation:
http://www.idlcoyote.com/ng_tips/mapnogrid.php
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.")
|
|
|