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

Home » Public Forums » archive » Map Projection Clarification
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Map Projection Clarification [message #87612] Tue, 18 February 2014 12:42 Go to next message
morganlsilverman is currently offline  morganlsilverman
Messages: 46
Registered: February 2013
Member
Hello,

I'm trying to set up a map projection using
mapCoord = Obj_New('cgMap', 'Lambert Conformal Conic', Ellipsoid='WGS 84', /GCTP, limit=limit, $
position=plotPosition, center_latitude=38.5, center_longitude=-77.5, STANDARD_PAR1=40, STANDARD_PAR2=-39). I honestly am just following examples I've seen but don't understand what each piece means and can't for the life of me find answers anywhere. At the moment I'm just getting a white screen when using mapCoord compared to cgMap_set. I'm creating a filled contour plot of lat/lon data.

Is there a list of different ellipsoid options to use? I see people use 24, 19, etc but I can't find what those correspond to. I know I need to use the same ellipsoid as what the data I have was created with, but I don't know how to relate that to options in IDL. Also, is there a list somewhere of GCTP map projections use in IDL? Lastly, what are standard_par2 and standard_par2. I know they're some sort of defined parallels but I don't know how to choose what those are? Could someone please explain those settings to me.

Thank you,

Sincerely,
Morgan
Re: Map Projection Clarification [message #87613 is a reply to message #87612] Tue, 18 February 2014 13:06 Go to previous messageGo to next message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
Hi Morgan-

On Tuesday, February 18, 2014 2:42:25 PM UTC-6, Morgan Silverman wrote:

> I'm trying to set up a map projection using
>
> mapCoord = Obj_New('cgMap', 'Lambert Conformal Conic', Ellipsoid='WGS 84', /GCTP, limit=limit, $
>
> position=plotPosition, center_latitude=38.5, center_longitude=-77.5, STANDARD_PAR1=40, STANDARD_PAR2=-39). I honestly am just following examples I've seen but don't understand what each piece means and can't for the life of me find answers anywhere. At the moment I'm just getting a white screen when using mapCoord compared to cgMap_set.

Well, since you're using objects, you have to get into a slightly different mindset. The OBJ_NEW() command simply _initializes_ the object. You still have to draw it:

mapCoord->Draw

This invokes the Draw method of the object.

> Is there a list of different ellipsoid options to use?

According to the documentation for cgMap (https://www.idlcoyote.com/idldoc/maps/cgmap__define.html), it is basically a wrapper for MAP_PROJ_INIT : http://exelisvis.com/docs/MAP_PROJ_INIT.html
Re: Map Projection Clarification [message #87614 is a reply to message #87613] Tue, 18 February 2014 13:25 Go to previous messageGo to next message
morganlsilverman is currently offline  morganlsilverman
Messages: 46
Registered: February 2013
Member
On Tuesday, February 18, 2014 4:06:07 PM UTC-5, Phillip Bitzer wrote:
> Hi Morgan-
>
>
>
> On Tuesday, February 18, 2014 2:42:25 PM UTC-6, Morgan Silverman wrote:
>
>
>
>> I'm trying to set up a map projection using
>
>>
>
>> mapCoord = Obj_New('cgMap', 'Lambert Conformal Conic', Ellipsoid='WGS 84', /GCTP, limit=limit, $
>
>>
>
>> position=plotPosition, center_latitude=38.5, center_longitude=-77.5, STANDARD_PAR1=40, STANDARD_PAR2=-39). I honestly am just following examples I've seen but don't understand what each piece means and can't for the life of me find answers anywhere. At the moment I'm just getting a white screen when using mapCoord compared to cgMap_set.
>
>
>
> Well, since you're using objects, you have to get into a slightly different mindset. The OBJ_NEW() command simply _initializes_ the object. You still have to draw it:
>
>
>
> mapCoord->Draw
>
>
>
> This invokes the Draw method of the object.
>
>
>
>> Is there a list of different ellipsoid options to use?
>
>
>
> According to the documentation for cgMap (https://www.idlcoyote.com/idldoc/maps/cgmap__define.html), it is basically a wrapper for MAP_PROJ_INIT : http://exelisvis.com/docs/MAP_PROJ_INIT.html

Thank you for responding. Oops forgot the Draw command. Well that certainly helps things. After reading more online I think I understand that the parallels are dependent on what type of map projection you use and how large an area you're viewing. Makes a little more sense I think. I'll have to keep reading about them to fully understand how to choose them correctly.
Re: Map Projection Clarification [message #87616 is a reply to message #87612] Tue, 18 February 2014 13:31 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Morgan Silverman writes:

> I'm trying to set up a map projection using
> mapCoord = Obj_New('cgMap', 'Lambert Conformal Conic', Ellipsoid='WGS 84', /GCTP, limit=limit, $
> position=plotPosition, center_latitude=38.5, center_longitude=-77.5, STANDARD_PAR1=40, STANDARD_PAR2=-39). I honestly am just following examples I've seen but don't understand what each piece means and can't for the life of me find answers anywhere. At the moment I'm just getting a white screen when using mapCoord compared to cgMap_set. I'm creating a filled contour plot of lat/lon data.
>
> Is there a list of different ellipsoid options to use? I see people use 24, 19, etc but I can't find what those correspond to. I know I need to use the same ellipsoid as what the data I have was created with, but I don't know how to relate that to options in IDL. Also, is there a list somewhere of GCTP map projections use in IDL? Lastly, what are standard_par2 and standard_par2. I know they're some sort of defined parallels but I don't know how to choose what those are?
Could someone please explain those settings to me.

The IDL documentation doesn't give you much help when it comes to
actually using map projections, which is why most people just starting
out in this field do things incorrectly, I suppose. My recommendation is
to go get a job with the National Snow and Ice Data Center and start
taking the two or three people there you *really* understand map
projections to lunch. You should buy, by the way. :-)

The fact that you are seeing a white screen when you create this map
coordinate object is good. That is what you are suppose to see! A blank
screen set up with map coordinates (projected XY meters, if you have to
know) on which you can draw map "things" to your heart's content.

You probably know that a map projection takes a 3D sphere or spheroid
and projects or maps it onto a 2D surface. It is a mathematical
construct and the job it does is generally agreed to be lousy. Some are
worse than others, and some work reasonably well, depending on what it
is you are doing with them. But, all of them fail is some way because,
well, it ain't possible to do it perfectly.

You try, as much as possible, to pick a map projection that shows what
you hope to show with as little distortion as possible. This will vary
depending where your data is located on the Earth, etc. For example, you
don't pick a cylindrical projection if your data is located near a pole,
because cylindrical projections greatly distort the area near the plot.
A Mercator projection, for example, just throws up its hands and admits
defeat near a pole. The parallels that you ask about are chosen to avoid
too much distortion in a particular area of the map (ie., between these
parallels). Some map projections will use them, others will have other
ways handling their inevitable distortions.

To create a map coordinate system, you need a couple of things. You need
an ellipsoid. This is the thing that you hope looks like the shape of
the Earth you wish to use. Some people just say screw it and use a
sphere. It keeps the math simple, a *big* advantage. (This is the
Ellipsoid=19 value you have seen used.) The ellipsoid is going to be
used to locate a particular latitude and longitude value. The same
physical point on the Earth, say, your house, will have different
latitude and longitude values, depending upon which ellipsoid you use to
assign these values. This is why you have to match the ellipsoid of your
map projection with the ellipsoid used to create the lat/lon value you
are trying to plot on your map projection. Get a mismatch and you are
now pointing at your ex-wife's house, not your house!

The other thing you need is the map projection, which, as I say, is
simply a mathematical model that does a lousy job of converting 3D
things to 2D things. The ellipsoid and the map projection together can
create a map coordinate system that can be used to display map data.

You can find out which map projections IDL supports (and which
ellipsoids it can use) by looking at the documentation for
Map_Proj_Init. cgMap supports the same projections and ellipsoids,
although it does it in a way that avoids some problems.

I use cgMap to set up the map coordinate system. Then I pass this map
coordinate object to other routines (cgPlot, cgContour, cgImage, etc.)
that need to draw something in this coordinate system. It almost always
works. ;-)

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.")
Re: Map Projection Clarification [message #87619 is a reply to message #87612] Tue, 18 February 2014 16:25 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Morgan Silverman writes:

> Could someone please explain those settings to me.

The clearest book I've ever found on map projections and datums is
Datums and Projections for Remote Sensing, GIS and Surveying, 2nd
Edition, by Jonathan Iliffe and Roger Lott. It is small, but packed with
great information. I really didn't understand map projections at all
until I read this book. :-)

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.")
Re: Map Projection Clarification [message #87620 is a reply to message #87619] Tue, 18 February 2014 16:34 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>
> Morgan Silverman writes:
>
>> Could someone please explain those settings to me.
>
> The clearest book I've ever found on map projections and datums is
> Datums and Projections for Remote Sensing, GIS and Surveying, 2nd
> Edition, by Jonathan Iliffe and Roger Lott. It is small, but packed with
> great information. I really didn't understand map projections at all
> until I read this book. :-)

Whoops! Should be "Datums and Map Projections..."

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.")
Re: Map Projection Clarification [message #87621 is a reply to message #87620] Tue, 18 February 2014 16:39 Go to previous message
morganlsilverman is currently offline  morganlsilverman
Messages: 46
Registered: February 2013
Member
On Tuesday, February 18, 2014 7:34:36 PM UTC-5, David Fanning wrote:
> David Fanning writes:
>
>
>
>>
>
>> Morgan Silverman writes:
>
>>
>
>>> Could someone please explain those settings to me.
>
>>
>
>> The clearest book I've ever found on map projections and datums is
>
>> Datums and Projections for Remote Sensing, GIS and Surveying, 2nd
>
>> Edition, by Jonathan Iliffe and Roger Lott. It is small, but packed with
>
>> great information. I really didn't understand map projections at all
>
>> until I read this book. :-)
>
>
>
> Whoops! Should be "Datums and Map Projections..."
>
>
>
> 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.")

This is great. Thank you so much. I'll definitely check the book out.

Sincerely,
Morgan
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Function Graphics Questions
Next Topic: gridding XYZ to surface: how to blank no data?

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

Current Time: Wed Oct 08 15:13:34 PDT 2025

Total time taken to generate the page: 0.00780 seconds