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

Home » Public Forums » archive » Geometric mismatch using cgImage and cgDrawShapes
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: Geometric mismatch using cgImage and cgDrawShapes [message #92043 is a reply to message #92042] Fri, 02 October 2015 14:47 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jonas Ardo writes:

> I have shape file (covering Senegal) in Sinusoidal projection I like to overlay on an image with the same projection.
> Plotting the shape file only using cgDrawShapes works fine (http://postimg.org/image/8ax6pgm3x/) but when first using
> cgImage to draw an image with the shape file on top, the data sets don't line up correctly and there is a geometric
> mismatch ( http://postimg.org/image/s796ijbjj/).
> The image and the shape file fit perfectly when displayed using ENVI.
>
> What have I missed in order to get a good geometric match between the shape file and the image?

A couple of things, I think. First, it doesn't look to me like your
image and your map have the same aspect ratio. So, because you keep the
aspect ratio of your image, it doesn't fit properly into the map
projection. Second (and possibly related to the first), you use the
POSITION keyword on your map, but neglect to use it for your image. I
would remove the KEEP_ASPECT keyword and use the POSITION keyword
itself. Or, more likely, I would create a window with the aspect ratio
of the image, since you say it has been created with a map projection.

Also, don't do this:

Color=cgColor('blue')

on Coyote Graphics commands. Just do this:

Color='blue'

Only use cgColor if you are trying to get "normal" IDL commands to
behave properly. This will avoid problems for people who are still using
the indexed color model.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Coloring labelled regions (or states)
Next Topic: Temperature records

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

Current Time: Fri Oct 10 15:16:39 PDT 2025

Total time taken to generate the page: 0.09746 seconds