Re: How to plot a rectangle on a map

Hi Andrew:

On Wed, 24 Jul 2002, Wilson, Andrew, J wrote:

> I'm embarrassed to ask this but...

Don't be...

>
> I want to plot a rectangle on an (x,y) map.
>
> It's just a simple rectangular outline. Not an image, or an
> x->y function, or a colour shaded terrain map or anything
> clever.

The simplest way in Java is probably to use a Gridded2DSet (or 3D) with
a manifold dimension of one -- just put your x,y (and probably z if you
are using 3D and want to put it above your background).  This would be
your 'data' use use 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),(y0, y1, y2, y3),(z0, z1, z2, z3) )

Hope that helps,

tom

>
> I need to be able to specify its size and rotation from
> vertical but that's it.
>
> It seems to be an incredibly simple task and I'm sure there
> must be a simple way to do it but looking through the
> tutorials and documentation I just can't find one.
>
> Would be indebted if someone can show me the 2 line solution.
>
> Andrew
>
> ______________________________________________________________________
> BG Energy Holdings Limited (a member of BG Group)
> Registered in England No: 3763515
> Registered Address:
>                       100 Thames Valley Park Drive
>                       Reading
>                       Berkshire   RG6 1PT   UK
> Telephone:            +44 (0) 118 935 3222
> Website:              http://www.BG-Group.com
>
> This e-mail is intended only for the addressee named above.  As this
> e-mail may contain confidential or privileged information, please
> advise us immediately if you are not the named addressee or the person
> responsible for delivering the message to the named addressee.  The
> contents should not be disclosed to any other person nor copies taken.
> ______________________________________________________________________
>
>

--
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: