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

Home » Public Forums » archive » Map Projection
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 [message #86267] Tue, 22 October 2013 07:47 Go to next message
morganlsilverman is currently offline  morganlsilverman
Messages: 46
Registered: February 2013
Member
Hello,

I'm trying to create a basic plot with a map of the US and trajectory data plotting on top. I'm trying to follow the map projection method using mapCoord = Obj_New('cgmap', 'Lambert Azimuthal', Limit=limit).

I keep coming across an ellipsoid statement in most of the examples I've found but I can't find any explanation as to what it is. Different examples have use ellipsoid=24, ellipsoid=19, ellipsoid=WGS84, etc...I don't know if I need this or how to set it if I do.

Can someone please explain what the ellipsoid statement is? And, is mapCoord=Obj_New('cgmap', ....) the best way to go about plotting a map of the United States? Thank you.

Sincerely,
Morgan
Re: Map Projection [message #86269 is a reply to message #86267] Tue, 22 October 2013 08:08 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 create a basic plot with a map of the US and trajectory data plotting on top. I'm trying to follow the map projection method using mapCoord = Obj_New('cgmap', 'Lambert Azimuthal', Limit=limit).
>
> I keep coming across an ellipsoid statement in most of the examples I've found but I can't find any explanation as to what it is. Different examples have use ellipsoid=24, ellipsoid=19, ellipsoid=WGS84, etc...I don't know if I need this or how to set it if I do.
>
> Can someone please explain what the ellipsoid statement is?

When most people come to maps for the first time they believe what they
learned in grade school: that every point on the Earth can be described
with a latitude and longitude value. Which is true. But what they
*don't* tell you is that no point on the Earth has a *unique* latitude
and longitude value. What you are calling *this* latitude and *this*
longitude depend on what reference standard you are using. This is
called a "datum", or in your case, the "ellipsoid".

If you use a GPS device to find your location on the Earth, it is
probably being calculated with a WGS84 ellipsoid, the standard ellipsoid
for most satellite data. If you plot that point on a map projection
using a spherical ellipsoid (the default ellipsoid for many map
projections) then the point you place on the map projection to
illustrate your position will NOT be the point on the Earth where you
are standing! You can be many, many meters off, simply because you are
using different reference ellipsoids to calculate latitude and
longitude.

> And, is mapCoord=Obj_New('cgmap', ....) the best way to go about
plotting a map of the United States?

It has pretty much always worked for me. :-)

The nice thing about cgMap is that is *doesn't* work in lat/lon space,
where people coming to map projections for the first time think you are
suppose to be working. It works in projected meter space, which is a
MUCH better place to be in if you are working with rectangular map
projected images.

If you are trying to put data on top of a coordinate system set up with
cgMap, you are going to have to pass the coordinate system object to
whatever routine (cgContour, cgPlotS, etc.) you are using, so it knows
how to convert the lat/lon values you are trying to plot into the
projected meter values of the coordinate system.

If this seems beyond your abilities, then I would simply use cgMap_Set
to set up the map and keep working in lat/lon. It's not ideal. But, it
often works well enough for the purpose.

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 [message #86271 is a reply to message #86267] Tue, 22 October 2013 08:12 Go to previous messageGo to next message
suicidaleggroll is currently offline  suicidaleggroll
Messages: 14
Registered: September 2013
Junior Member
On Tuesday, October 22, 2013 8:47:26 AM UTC-6, Morgan Silverman wrote:
> Hello,
>
>
>
> I'm trying to create a basic plot with a map of the US and trajectory data plotting on top. I'm trying to follow the map projection method using mapCoord = Obj_New('cgmap', 'Lambert Azimuthal', Limit=limit).
>
>
>
> I keep coming across an ellipsoid statement in most of the examples I've found but I can't find any explanation as to what it is. Different examples have use ellipsoid=24, ellipsoid=19, ellipsoid=WGS84, etc...I don't know if I need this or how to set it if I do.
>
>
>
> Can someone please explain what the ellipsoid statement is? And, is mapCoord=Obj_New('cgmap', ....) the best way to go about plotting a map of the United States? Thank you.
>
>
>
> Sincerely,
>
> Morgan

You could always use the regular map_set and map_continents procedures:

map_set, 0, 0, /cyl, /iso, /noborder, limit=[25,-125,50,-67]
map_continents, /hires
map_continents, /hires, /usa
plots, lons, lats, psym=2
Re: Map Projection [message #86276 is a reply to message #86269] Tue, 22 October 2013 10:25 Go to previous messageGo to next message
morganlsilverman is currently offline  morganlsilverman
Messages: 46
Registered: February 2013
Member
On Tuesday, October 22, 2013 11:08:04 AM UTC-4, David Fanning wrote:
> Morgan Silverman writes:
>
>
>
>> I'm trying to create a basic plot with a map of the US and trajectory data plotting on top. I'm trying to follow the map projection method using mapCoord = Obj_New('cgmap', 'Lambert Azimuthal', Limit=limit).
>
>>
>
>> I keep coming across an ellipsoid statement in most of the examples I've found but I can't find any explanation as to what it is. Different examples have use ellipsoid=24, ellipsoid=19, ellipsoid=WGS84, etc...I don't know if I need this or how to set it if I do.
>
>>
>
>> Can someone please explain what the ellipsoid statement is?
>
>
>
> When most people come to maps for the first time they believe what they
>
> learned in grade school: that every point on the Earth can be described
>
> with a latitude and longitude value. Which is true. But what they
>
> *don't* tell you is that no point on the Earth has a *unique* latitude
>
> and longitude value. What you are calling *this* latitude and *this*
>
> longitude depend on what reference standard you are using. This is
>
> called a "datum", or in your case, the "ellipsoid".
>
>
>
> If you use a GPS device to find your location on the Earth, it is
>
> probably being calculated with a WGS84 ellipsoid, the standard ellipsoid
>
> for most satellite data. If you plot that point on a map projection
>
> using a spherical ellipsoid (the default ellipsoid for many map
>
> projections) then the point you place on the map projection to
>
> illustrate your position will NOT be the point on the Earth where you
>
> are standing! You can be many, many meters off, simply because you are
>
> using different reference ellipsoids to calculate latitude and
>
> longitude.
>
>
>
>> And, is mapCoord=Obj_New('cgmap', ....) the best way to go about
>
> plotting a map of the United States?
>
>
>
> It has pretty much always worked for me. :-)
>
>
>
> The nice thing about cgMap is that is *doesn't* work in lat/lon space,
>
> where people coming to map projections for the first time think you are
>
> suppose to be working. It works in projected meter space, which is a
>
> MUCH better place to be in if you are working with rectangular map
>
> projected images.
>
>
>
> If you are trying to put data on top of a coordinate system set up with
>
> cgMap, you are going to have to pass the coordinate system object to
>
> whatever routine (cgContour, cgPlotS, etc.) you are using, so it knows
>
> how to convert the lat/lon values you are trying to plot into the
>
> projected meter values of the coordinate system.
>
>
>
> If this seems beyond your abilities, then I would simply use cgMap_Set
>
> to set up the map and keep working in lat/lon. It's not ideal. But, it
>
> often works well enough for the purpose.
>
>
>
> 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.")

Thank you for the explanation. I'm still not sure how to determine what the ellipsoid should be though. I used 19 in my code based on one of your gallery examples but I don't know if that would be correct. I'm plotting model back-trajectories over the map.

mapCoord = Obj_New('cgmap', 'Equirectangular', Ellipsoid=19, Limit=limit, $
xrange=xrange, yrange=yrange, /latlon_ranges, center_lon=centerlon, position=pp)
mapCoord -> Draw
cgMap_Grid, map=mapCoord, /box
cgMap_Continents, map=mapCoord, /continents, /countries, /usa
cgplots, lon_1500(index), lat_1500(index), map=mapCoord

Thanks.
-Morgan
Re: Map Projection [message #86277 is a reply to message #86276] Tue, 22 October 2013 10:45 Go to previous messageGo to next message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
I'd echo the previous suggestion of regular map_set and map_continents above as a simple(r) way to draw a map, unless you're trying to do something fancy.

Andy

On Tuesday, October 22, 2013 1:25:03 PM UTC-4, Morgan Silverman wrote:
> On Tuesday, October 22, 2013 11:08:04 AM UTC-4, David Fanning wrote:
>
>> Morgan Silverman writes:
>
>>
>
>>
>
>>
>
>>> I'm trying to create a basic plot with a map of the US and trajectory data plotting on top. I'm trying to follow the map projection method using mapCoord = Obj_New('cgmap', 'Lambert Azimuthal', Limit=limit).
>
>>
>
>>>
>
>>
>
>>> I keep coming across an ellipsoid statement in most of the examples I've found but I can't find any explanation as to what it is. Different examples have use ellipsoid=24, ellipsoid=19, ellipsoid=WGS84, etc...I don't know if I need this or how to set it if I do.
>
>>
>
>>>
>
>>
>
>>> Can someone please explain what the ellipsoid statement is?
>
>>
>
>>
>
>>
>
>> When most people come to maps for the first time they believe what they
>
>>
>
>> learned in grade school: that every point on the Earth can be described
>
>>
>
>> with a latitude and longitude value. Which is true. But what they
>
>>
>
>> *don't* tell you is that no point on the Earth has a *unique* latitude
>
>>
>
>> and longitude value. What you are calling *this* latitude and *this*
>
>>
>
>> longitude depend on what reference standard you are using. This is
>
>>
>
>> called a "datum", or in your case, the "ellipsoid".
>
>>
>
>>
>
>>
>
>> If you use a GPS device to find your location on the Earth, it is
>
>>
>
>> probably being calculated with a WGS84 ellipsoid, the standard ellipsoid
>
>>
>
>> for most satellite data. If you plot that point on a map projection
>
>>
>
>> using a spherical ellipsoid (the default ellipsoid for many map
>
>>
>
>> projections) then the point you place on the map projection to
>
>>
>
>> illustrate your position will NOT be the point on the Earth where you
>
>>
>
>> are standing! You can be many, many meters off, simply because you are
>
>>
>
>> using different reference ellipsoids to calculate latitude and
>
>>
>
>> longitude.
>
>>
>
>>
>
>>
>
>>> And, is mapCoord=Obj_New('cgmap', ....) the best way to go about
>
>>
>
>> plotting a map of the United States?
>
>>
>
>>
>
>>
>
>> It has pretty much always worked for me. :-)
>
>>
>
>>
>
>>
>
>> The nice thing about cgMap is that is *doesn't* work in lat/lon space,
>
>>
>
>> where people coming to map projections for the first time think you are
>
>>
>
>> suppose to be working. It works in projected meter space, which is a
>
>>
>
>> MUCH better place to be in if you are working with rectangular map
>
>>
>
>> projected images.
>
>>
>
>>
>
>>
>
>> If you are trying to put data on top of a coordinate system set up with
>
>>
>
>> cgMap, you are going to have to pass the coordinate system object to
>
>>
>
>> whatever routine (cgContour, cgPlotS, etc.) you are using, so it knows
>
>>
>
>> how to convert the lat/lon values you are trying to plot into the
>
>>
>
>> projected meter values of the coordinate system.
>
>>
>
>>
>
>>
>
>> If this seems beyond your abilities, then I would simply use cgMap_Set
>
>>
>
>> to set up the map and keep working in lat/lon. It's not ideal. But, it
>
>>
>
>> often works well enough for the purpose.
>
>>
>
>>
>
>>
>
>> 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.")
>
>
>
> Thank you for the explanation. I'm still not sure how to determine what the ellipsoid should be though. I used 19 in my code based on one of your gallery examples but I don't know if that would be correct. I'm plotting model back-trajectories over the map.
>
>
>
> mapCoord = Obj_New('cgmap', 'Equirectangular', Ellipsoid=19, Limit=limit, $
>
> xrange=xrange, yrange=yrange, /latlon_ranges, center_lon=centerlon, position=pp)
>
> mapCoord -> Draw
>
> cgMap_Grid, map=mapCoord, /box
>
> cgMap_Continents, map=mapCoord, /continents, /countries, /usa
>
> cgplots, lon_1500(index), lat_1500(index), map=mapCoord
>
>
>
> Thanks.
>
> -Morgan
Re: Map Projection [message #86279 is a reply to message #86276] Tue, 22 October 2013 11:15 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Morgan Silverman writes:

> Thank you for the explanation. I'm still not sure how to determine what the ellipsoid should be though. I used 19 in my code based on one of your gallery examples but I don't know if that would be correct. I'm plotting model back-trajectories over the map.
>
> mapCoord = Obj_New('cgmap', 'Equirectangular', Ellipsoid=19, Limit=limit, $
> xrange=xrange, yrange=yrange, /latlon_ranges, center_lon=centerlon, position=pp)
> mapCoord -> Draw
> cgMap_Grid, map=mapCoord, /box
> cgMap_Continents, map=mapCoord, /continents, /countries, /usa
> cgplots, lon_1500(index), lat_1500(index), map=mapCoord

The ellipsoid you choose should be the same ellipsoid that was used to
determine the latitude and longitude values data you are working with.
If you don't know and/or can't find out, then you have to default to
something "sensible". This is typically WGS84 for any data collected by
satellites in the past, say, 20 years, and Spherical if you really don't
have the foggiest idea. Some map projections only allow spherical
datums. Others allow whatever datum you choose to use.

I've never seen the ellipsoid set by anyone using Map_Set, which makes
it extremely easy to use. The downside, of course, (aside from using
extremely old map software) is that the results aren't all that
accurate. If you are working with global maps, or even maps the size of
the United States, clamoring for accurate results can be used as an
accurate prediction of an anal personality. Some people just like
scientific work to be RIGHT. Other people ascribe to the "close enough"
rule. It's really whatever works for you. :-)

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 [message #86346 is a reply to message #86267] Tue, 29 October 2013 17:23 Go to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
Hi Morgan-

Maybe a little late, but here's a little tutorial I've been working on that might help:

https://www.dropbox.com/s/kp426ff6xy0af46/mapping.pdf

The rest of this chapter gets heavy into what David is talking about (and using objects!), but it sounds to me your problem is little simpler than that. But, you should definitely try to wrap your head around the difference between plotting in lat/lon and "plane" space. In short, the projection and ellipsoid you choose helps define that coordinate transformation. Basically, if your data is in lat/lon space, you can choose whatever projection/ellipsoid you see fit.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Better (updated) political boundaries on maps?
Next Topic: timegen

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

Current Time: Wed Oct 08 11:41:17 PDT 2025

Total time taken to generate the page: 0.00499 seconds