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.")
|