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

Home » Public Forums » archive » Re: Function Graphics Map Projection Woes
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: Function Graphics Map Projection Woes [message #77752 is a reply to message #77663] Tue, 20 September 2011 08:49 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> The spacing of the latitude and longitude lines in my
> map grid are too close together. I read the documentation
> and I see the keywords GRID_LONGITUDE and GRID_LATITUDE
> are to be used to set the "grid spacing in degrees."
>
> So, OK, I define my grid like this:
>
> grid = Mapgrid(Color='gray', Grid_Longitude=60, Grid_Latitude=30)
>
> And *nothing* about the grid changes at all. :-(
>
> Am I reading the documentation wrong, or am I still
> on this incredible one in a million losing streak?

Since no one is helping me here, I've had to resort
to my own (limited) research abilities. :-(

It turns out that this is NOT the way to add a map
grid to an image that is displayed in a map projection.
In direct graphics we think of creating a map projection
on an image, and then "annotating" the map projection with
continental outlines, grids, etc.

This apparently is not the way in function graphics.
At least not for grids. (And maybe not for continental
outlines either. I don't know. The documentation is
really, really bad, as you know. I'm struggling along.)

In any case, I've discovered that to change the spacing
of my latitude and longitude grid lines, I need to
fetch the map projection and grid objects from the image
object, and change THOSE values and give up on creating
the grid object the way I described yesterday. Yesterday,
in fact, I had TWO grid objects, overlaid on one another.
(Although why I didn't see that and/or why those two
keyword didn't do anything that I could see is still a
mystery to me.)

The code should look like this:

w = Window(Dimension=[775, 425])
imgObj = Image(scaledData, lon, Reverse(lat), $
limit=[-90,0,90, 356.25], grid_units=2, $
map_projection='Equirectangular', $
Position=[0.05,0.05,0.95, 0.80], $
RGB_TABLE=rgb, /Current)
map = imgObj.MapProjection
grid = map.mapgrid
grid.grid_latitude = 30
grid.grid_longitude = 60

I'm working on an article that will explain what I know
about this topic now. It should be available later today.

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
Previous Topic: IDL 8.1 Graphics Window Rearrange Content
Next Topic: Good IDL 8 guide?

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

Current Time: Sat Oct 11 12:53:52 PDT 2025

Total time taken to generate the page: 0.63719 seconds