Re: Display and Navigate Image in IDL 8.2 [message #84698 is a reply to message #81439] |
Thu, 13 September 2012 00:20  |
lecacheux.alain
Messages: 325 Registered: January 2008
|
Senior Member |
|
|
Le mercredi 12 septembre 2012 23:24:05 UTC+2, David Fanning a écrit :
> 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.")
For those who might be interested, my equation:
res = ((m.a + 135)*2*!dpi)/256/2^zoom
|
|
|