Re: How to plot a rectangle on a map

Hi again, Andrew...

I see I sent you a draft...sorry, let me try again:

The simplest way in Java is probably to use a Gridded2DSet (or 3DSet)
with a manifold dimension of one -- just put your x,y (and probably z if
you are using 3D and want to display it above your background) values in
as the samples.  This Set would then be your 'data' with which to make a
DataReference, which then gets added to your display.  The MathType
would be a RealTupleType of the RealTypes for each of your domain
coordinates.

In Jython, you might just use:

    subs.drawLine(display, points, color=, ... )

where 'points' is a list/tuple of your coordinates, defined in
terms of the types mapped to the x,y,z axes, respectively...like:
( (x0, x1, x2,x3,x4),(y0, y1, y2, y3,y4),(z0, z1, z2, z3,z4) )

If it was a cube/box and you didn't need to rotate it, you could could
use the built-in 'cube' or 'box' of subs.py's Shapes.addShape().  Or you
can specify a VisADGeometryArray where you can define your own shape,
but it's a bit more complicated (see the examples in subs.py, though, if
you're working in Python)

tom

--
Tom Whittaker
University of Wisconsin-Madison
Space Science and Engineering Center
Cooperative Institute for Meteorological Satellite Studies
Telephone/VoiceMail:  608.262.2759


  • 2002 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: