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

Home » Public Forums » archive » Map Projection Bug
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Map Projection Bug [message #64750] Wed, 14 January 2009 15:39
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Folks,

Does anyone have a discount coupon for MatLab? I've nearly
had it with IDL, and it's only Wednesday. I may not make
it to Friday.

I spent the better part of the day absolutely confused
about map projections. That in itself is not unusual,
map projections are pretty hard, but I've been thinking
recently that I've been getting my head around the darn
things pretty well.

But then I started working on a new project today and I
kept seeing something that looked like some kind of
spooky action at a distance, and I got totally freaked out.
*Finally* I remembered that I had seen this once before,
and I tracked it down to a May 2007 article in this
newsgroup.

It turns out MAP_PROJ_INIT is a one-way street. You can
use it to create a map structure, and you can use that
map structure to do things with maps. But when you make
a *second* map structure, you lose all ability to do anything
useful with the first map structure. You can't go home again.

Here is a short program that demonstrates the problem.

PRO MapProjInit_Bug

; Here is the map projection I want to set up.
Window, XSIZE=350, YSIZE=350, XPOS=0, YPOS=0, TITLE='What I expect'
mapStruct = Map_Proj_Init(111, /GCTP, DATUM=8, CENTER_LATITUDE=90, $
CENTER_LONGITUDE=0, LIMIT=[0, -180, 90, 180])
plot, mapStruct.uv_box[[0,2]], $
mapStruct.uv_box[[1,3]], $
/NoData, XSTYLE=5, YSTYLE=5
Map_Continents, MAP_STRUCTURE=mapStruct, /FILL


; I create another map projection. Rotated in this case.
; But I don't even save the map structure! I map the continents
; again and it uses the 2nd map projection. Huh!?
Print, Ptr_New(Map_Proj_Init(111, /GCTP, DATUM=8, CENTER_LATITUDE=90, $
CENTER_LONGITUDE=135, LIMIT=[0, -180, 90, 180]))
window, 1, XSIZE=350, YSIZE=350, XPOS=375, YPOS=0, $
TITLE='What happened!!'
Map_Continents, MAP_STRUCTURE=mapStruct, /FILL

END

Guess I'll write this up. I can't afford to waste 5 hours every
time I try to do something useful with map projections. :-(

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Previous Topic: Transparency in object_graphics
Next Topic: Re: idl workbench on linux does not support 64 bits

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

Current Time: Fri Oct 10 08:07:36 PDT 2025

Total time taken to generate the page: 0.55903 seconds