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

Home » Public Forums » archive » Re: how to use map_set in object graphics programming
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
Re: how to use map_set in object graphics programming [message #45767] Wed, 05 October 2005 09:29 Go to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
shengbaojun wrote:

> Could you please tell me Where can I find IMap tool?

iMap is one of the iTools that shipped with IDL 6.1. If you have IDL
6.1 or newer there is information regarding it in the documentation.


> I hope I can use map_set to draw a background map in
> IDLWidgetContro when IDLWidgetControl's Graphics_Level is set to 2.
> But I can not sucess.

As Mark mentioned you can not use MAP_SET and object graphics. Either
you develop your application using the direct graphics system
(GRAPHICS_LEVEL=1) and use MAP_SET *or* you use the object graphics
system (GRAPHICS_LEVEL=2) and the MAP_PROJ_* functions.


> IF the above idea is not fillfull,It means I must use Map_proj* and
> IDLgr* to draw map,Could you please give me something advice.

Again, as Mark said, the MAP_PROJ_* functions operate at a lower level
and require you to do more coding to get your map on the screen. Check
out the IDL documentation for MAP_PROJ_FORWARD for some example code.

The basic steps will be:

You will read in your coastline data.

use MAP_PROJ_INIT to set up your projection

use MAP_PROJ_FORWARD to convert your coastline data from lat/lon to
cartesian coordinates X,Y.

At the very least pass X,Y to IDLgrPolyline and plot as a collection of
points. If you want to plot the coastline as lines, you may need to
generate the connectivity which tells IDLgrPolyline how to connect your
vertices X,Y into lines. Read the documentation on IDLgrPolyline.

add your IDLgrPolyline object to an IDLgrModel

use XOBJVIEW to view the IDLgrModel to verify that things worked as
expected.


Once you have done this then you can work on doing it using the ActiveX
control.


As I mentioned, you will still have one other issue to contend with.
I'm guessing that your are contouring with a 2d array of Z values. When
you try to overlay your coastline on your contour it will most likely
not line up correctly (in fact you will probably not even see it). You
will need to use the [XYZ]COORD_CONV keywords of IDLgrContour and
IDLgrPolyline to plot your data in the same place in the object graphics
coordinate system.


-Rick
Re: how to use map_set in object graphics programming [message #45770 is a reply to message #45767] Wed, 05 October 2005 07:25 Go to previous messageGo to next message
shengbaojun is currently offline  shengbaojun
Messages: 8
Registered: October 2005
Junior Member
Dear Mr.Mark Hadfield ,
Thank you for your apply.
Could you please tell me Where can I find IMap tool?
Thank you

shengbaojun
Re: how to use map_set in object graphics programming [message #45777 is a reply to message #45770] Tue, 04 October 2005 13:29 Go to previous messageGo to next message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
shengbaojun wrote:
>> I hope I can use map_set to draw a background map in
> IDLWidgetContro when IDLWidgetControl's Graphics_Level is set to 2.

A GRAPHICS_LEVEL of 2 implies an Object Graphics draw widget, so you
cannot use MAP_SET, which is a Direct Graphics command.

For examples of creating projected maps in Object Graphics, see the
documentation for the MAP_PROJ_FORWARD function. Unfortunately it's a
bit more verbose and complicated than the Direct Graphcis mapping functions.

The Imap tool uses Object Graphics & map projections.


--
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
Re: how to use map_set in object graphics programming [message #45782 is a reply to message #45777] Tue, 04 October 2005 07:00 Go to previous messageGo to next message
shengbaojun is currently offline  shengbaojun
Messages: 8
Registered: October 2005
Junior Member
> From your advice,I get the idea,that is to say ,To construct a
background map in IDL's object programming,I must use Map_proj* and
IDLgr* to draw them step by step rather than using map_set draw them
directly in direct graphic programming.
I want to konw the possibility of using map_set in IDLWidgetControl.I
use the Microsoft Visual C# plus IDLWidgetControl 3.0 to contruct an
application.I hope I can use map_set to draw a background map in
IDLWidgetContro when IDLWidgetControl's Graphics_Level is set to 2.But
I can not sucess.
IF the above idea is not fillfull,It means I must use Map_proj* and
IDLgr* to draw map,Could you please give me something advice.
Thank a lot!
Re: how to use map_set in object graphics programming [message #45790 is a reply to message #45782] Mon, 03 October 2005 09:12 Go to previous messageGo to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
Check out the MAP_PROJ_* functions which will transform your coordinates
back and forth between cartesian and lat/lon. You'll then (depending on
your map data) pass your transformed map vertices to IDLgrPolyline or
IDLgrPolygon which can be added to a model then then the view which
contains your contour.

The trick will be aligning the map and contour objects on the same space
in your coordinate system. Look into the *COORD_CONV keywords to your
IDLgr* objects.

-Rick

shengbaojun wrote:
> I develop a meteorology program useing IDL6.0 plus VS.net.I want to use
> Object graphics program method in IDL AxtiveX program ,but when I add
> 'map_set' procedure to my procedure,it always open another window,I
> wish the map and contour display in the same window.
> please help me!
> thank you!
>
Re: how to use map_set in object graphics programming [message #45896 is a reply to message #45767] Fri, 07 October 2005 17:18 Go to previous message
shengbaojun is currently offline  shengbaojun
Messages: 8
Registered: October 2005
Junior Member
Thanks a lot to Mr.Mark Hadfield and Mr.Rick Towler
Re: how to use map_set in object graphics programming [message #45897 is a reply to message #45767] Fri, 07 October 2005 17:17 Go to previous message
shengbaojun is currently offline  shengbaojun
Messages: 8
Registered: October 2005
Junior Member
Thank a lot to Mr.Mark Hadfield and Rick Towler.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Easy question?
Next Topic: idl6.2 and if statemente

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

Current Time: Wed Oct 08 13:53:36 PDT 2025

Total time taken to generate the page: 0.00521 seconds