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

Home » Public Forums » archive » Re: Display and Navigate Image in IDL 8.2
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: Display and Navigate Image in IDL 8.2 [message #81306 is a reply to message #81304] Fri, 07 September 2012 08:23 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
alx writes:

>> I can display an image. And I can set up a proper map
>> projection with the Map_Proj_* routines. I just can't
>> use the two together in a graphics window!
>
> Yes, I guess that you can !
> If you got an image from Google which is properly rectified, you do not need for any further map projection, as far as the axis labeling is in meter/kilometer.

OK, I can see how to do this:

limit = [-84.7500, -180.000, 84.7500, 180.000]
mapStruct = Map_Proj_Init('mercator', /gctp, $
ellipsoid='wgs 84', limit=limit)
cm = map_proj_forward(-105.100, 40.600, map=mapStruct)
xcenter = cm[0,0]
ycenter = cm[1,0]
Print, 'XCenter: ', xcenter
Print, 'YCenter: ', ycenter
metersPixel = cgGoogle_MetersPerPixel(12)
Print, 'meters per pixels: ', metersPixel
xrange = [xcenter - (300*metersPixel), xcenter+(300*meterspixel)]
yrange = [ycenter - (300*metersPixel), ycenter+(300*meterspixel)]
Print, 'X Range: ', xrange
print, 'Y Range: ', yrange

s = Size(googleImage, /DIMENSIONS)
xscale = Abs(xrange[1] - xrange[0]) / s[1]
yscale = Abs(yrange[1] - yrange[0]) / s[2]
Print, 'X Scale: ', xscale
Print, 'Y Scale: ', yscale
x = (Findgen(s[1])*xscale) + xrange[0] + (xscale/2)
y = (Findgen(s[2])*yscale) + yrange[0] + (yscale/2)
obj = Image(googleImage, x, y, DIMENSIONS=[700,700], Margin=0.1)

> If now you want axes graduated in longitude/latitude, you only need
for a projection tool in order to manage the scaling which is (slightly
in your case) not linear.

My point is that my image is LINEAR!! It is gridded, as ALL of my
satellite images are, onto a projected meter scale. I wish to fit a
map projection to the image, not fit the image to a map projection.
There is a very big difference here!

> I suppose that 'map_proj_init'/'map_proj_inverse' is what you can use.

Exactly. I can set up the map projection with Map_Proj_Init and I
can use Map_Proj_Inverse to convert lat/lon space to projected
meter space. Now, I can draw symbols, lines, etc. on top of my image.
What I can NOT draw on top of my image are map annotations!!

> Then you can add axes with the proper labeling. This is likely what
MAP_PROJECTION is doing for you in the IMAGE function! Is'nt it ?

Are you suggesting I give up on the Map function and use the Axis
function to create my map annotations?

> Maybe what I say is pure non-sense, because I am not a specialist of mapping.
> I am just a scientist who *needs* for clever and efficient programming tools,
> what IDL still is, I guess, in spite of some irritating and
> uncorrected lack for a serious (i.e. usable) documentation.

It has been my experience that there are scientists in
the world who care more about something "looking" right
than actually "being" right. This is what I meant by suggesting
that maybe the function graphics system is made for this type
of scientist and not for professional programmers. But, having
something that is "almost" right is going to bite someone someday.
And, anyway, IDL has the tools to do this correctly. Why not just
use them? The documentation, such as it is, gives no indication that
this wouldn't be possible.

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
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: Re: Parrallel Matrix Inversion in IDL?
Next Topic: Reading non-standard variable sizes

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

Current Time: Fri Oct 10 10:02:06 PDT 2025

Total time taken to generate the page: 1.52089 seconds