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

Home » Public Forums » archive » map projections webinar
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: map projections webinar [message #78032 is a reply to message #77920] Thu, 20 October 2011 12:57 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> It doesn't work in that I can't appear to "position"
> a map object in the graphics window. In other words,
> this code appears to ignore the POSITION keyword:
>
> m = MAP('Albers Equal Area', $
> ELLIPSOID='WGS 84', $ ; WGS84
> CENTER_LATITUDE=geotag.PROJNATORIGINLATGEOKEY, $
> CENTER_LONGITUDE=geotag.PROJNATORIGINLONGGEOKEY, $
> STANDARD_PAR1=geotag.PROJSTDPARALLEL1GEOKEY, $
> STANDARD_PAR2=geotag.PROJSTDPARALLEL2GEOKEY, $
> XRANGE=xrange, YRANGE=yrange, $
> POSITION=[0.025, 0.025, 0.975, 0.85])
>
> Well, it ignores the XRANGE and YRANGE keywords, too,
> but this is an error I know about. I fix that error
> by doing this:
>
> m.xrange = xrange
> m.yrange = yrange
>
> But, when I try the same technique with the ignored
> POSITION keyword:
>
> m.position =[0.025, 0.025, 0.975, 0.85]
>
> I am given this error:
>
> % MAPPROJECTION: Unknown property: POSITION
>
> There are other problems as well, but if I could solve
> this one I would be moving forward.

I discovered the work-around for the broken POSITION
keyword by listening to Mark Piper's map projection
webinar this afternoon.

Apparently, you can use the Scale and Translate methods
for the MAP function to effect a rudimentary positioning
of the map projection in the graphics window. It's an
iterative process, because there is no rational explanation
for what values you should use (as least that I can see),
but I did get the map to move enough for me to fit a title
above it.

My code looks like this now:

m = MAP('Albers Equal Area', $
ELLIPSOID='WGS 84', $ ; WGS84
CENTER_LATITUDE=geotag.PROJNATORIGINLATGEOKEY, $
CENTER_LONGITUDE=geotag.PROJNATORIGINLONGGEOKEY, $
STANDARD_PAR1=geotag.PROJSTDPARALLEL1GEOKEY, $
STANDARD_PAR2=geotag.PROJSTDPARALLEL2GEOKEY, $
XRANGE=xrange, YRANGE=yrange, $
POSITION=[0.025, 0.025, 0.975, 0.85])

; The range doesn't get set in the call to Map. Have to
; set the range manually.
m.xrange = xrange
m.yrange = yrange

; A similar "correction" for ignored POSITION keyword tells me
; POSITION is an unknown property for MAPPROJECTION. Use SCALE
; and TRANSLATE methods to compensate.
; m.position = [0.025, 0.025, 0.975, 0.85]
m.scale, 0.8, 0.8, 1.0
m.translate, 0, -0.075, 0, /Normal

I've moved the code over to a more permanent location, because
I want to use this in an article I am writing.

http://www.idlcoyote.com/map_tips/cg_map_projections_webinar .zip

I still don't see how to set the limit of the map projection,
so that I just see the portion of it that I want to see.
It is difficult to move forward because so many keywords just
seem to be broken. (At least they appear to be ignored. I presume
they are broken.)

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
Previous Topic: Re: Cursor in IDL 8 on Lion
Next Topic: Re: get lat/lon from modis SIN grid

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

Current Time: Wed Oct 08 19:18:13 PDT 2025

Total time taken to generate the page: 0.00447 seconds