Re: Over-PLOT() on MAP()? [message #73919] |
Sat, 11 December 2010 18:22  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paulo Penteado writes:
> The problem in this case (and in imap) is that the projection can be
> changed (by the property map_projection), and the things put there by
> the plot do not get updated to the new position. One would have to get
> the new map structure, call map_proj_forward again, and update the
> plot data.
Yes, I agree the whole map projection thing has not
been well thought out in the map function.
I do note, however, that it will be hard to convince
me to use anything but the map projection tools of
the Catalyst Library. MapCoord just seems to work
so simply and easily. Set up a map coordinate space,
and then just draw on it, in either lat/lon or projected
XY. All you have to do it tell it which you prefer.
It couldn't be any easier. :-)
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.")
|
|
|
|
Re: Over-PLOT() on MAP()? [message #73921 is a reply to message #73920] |
Sat, 11 December 2010 16:55   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paulo Penteado writes:
> plot() seems to have inherited the same limitation as iplot with
> respect to overplotting on maps:
>
> ttp://groups.google.com/group/comp.lang.idl-pvwave/browse_th read/thread/7dad5b4234801dea
>
> You need to use its map projection to convert the coordinates to
> Cartesian:
>
> m=map('sinusoidal')
> lats=[60.,30.,0.,-60.,-45.,60.]
> lons=[-60.,0.,120.,30.,-60.,-60.]
> xy=map_proj_forward(lons,lats,map_structure=m.map_structure)
> p=plot(xy,/over,color='red')
I'm not sure this is a "limitation" so much as just
a poorly documented feature. I think it is absolutely
correct that the "data space" of a map projection should
be in projected XY coordinates, rather than in lat/lon
space. It is just about the only thing about the new
graphics that actually makes a lot of sense to me. :-)
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.")
|
|
|
Re: Over-PLOT() on MAP()? [message #73922 is a reply to message #73921] |
Sat, 11 December 2010 13:56   |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Dec 11, 4:58 pm, Matt Haffner <matt.haff...@gmail.com> wrote:
> I hope I'm missing something obvious, but I can't seem to get this to
> do anything but put symbols at the center of the projection:
>
> IDL> m = map('Hammer')
> IDL> p = plot([190, 230], [25, 35], /over, symbol='o', /sym_filled,
> sym_size=2, /data, sym_color="blue")
>
> Annotations and text go in the right place:
>
> t = text(80, 25, 'Hello', /data)
>
> But PLOT() isn't using the coordinate system at all. Even if the
> projection range is changed via LIMIT, all symbols end up in the
> middle of the new projection.
plot() seems to have inherited the same limitation as iplot with
respect to overplotting on maps:
ttp://groups.google.com/group/comp.lang.idl-pvwave/browse_th read/thread/7dad5b4234801dea
You need to use its map projection to convert the coordinates to
Cartesian:
m=map('sinusoidal')
lats=[60.,30.,0.,-60.,-45.,60.]
lons=[-60.,0.,120.,30.,-60.,-60.]
xy=map_proj_forward(lons,lats,map_structure=m.map_structure)
p=plot(xy,/over,color='red')
Doing that I noticed a bug where my grid lines have a tendency for
disappearing when the map is selected, or something is overplotted, if
the labels are inside the grid (if label_position is larger than 0 and
smaller than 1). Sending the labels to the outside (0 or 1) makes the
problem go away, but in projections like that, also makes for an ugly
plot.
So plot() should be made map-aware like image() and contour() are.
While at it, it should give the option to connect the points with
great circles instead of straight lines.
|
|
|
Re: Over-PLOT() on MAP()? [message #74003 is a reply to message #73920] |
Mon, 13 December 2010 11:23  |
Matt Haffner
Messages: 34 Registered: October 2000
|
Member |
|
|
On Dec 11, 8:01 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Dec 11, 10:55 pm, David Fanning <n...@dfanning.com> wrote:
>
>> I'm not sure this is a "limitation" so much as just
>> a poorly documented feature. I think it is absolutely
>> correct that the "data space" of a map projection should
>> be in projected XY coordinates, rather than in lat/lon
>> space. It is just about the only thing about the new
>> graphics that actually makes a lot of sense to me. :-)
>
> The problem in this case (and in imap) is that the projection can be
> changed (by the property map_projection), and the things put there by
> the plot do not get updated to the new position. One would have to get
> the new map structure, call map_proj_forward again, and update the
> plot data.
Yes, that is a serious limitation. I was hoping I was overlooking
something--thanks for the workaround. I resorted to using ELLIPSE for
now to get something going, but it's pretty slow (and probably has way
too much overhead) for a serious number of data points, even when
turning off .Refresh.
mh
|
|
|