Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: 2d grid cells over an aerial map

Hi Sitt,

> Anybody knows how to draw 2d grid cells over an aerial map? My intention
> is to have grid cells to cover just a particular part of the map and
> leave the rest of the map still visible, while the grid cells must be able
> to display in different colors. I've been struggling for quite a while.

If you want to draw grid oputlines try creating a FlatField with
MathType ((x, y) -> (r, g, bi, z)) where you create the domain Set as
a  Gridded2DSet with manifold dimension = 1. See the the Rivers.java
program in visad/examples for an example. Map r, g and b to Red,
Green and Blue (with appropriate calls to the setRange() method
of the ScalarMaps), and z to ZAxis to determine the height of the
grid outlines.

If you want to draw filled grid boxes to obscure, then you might
try a FieldImpl with MathType:

  (index -> (r, g, b, z, Set(x, y)))

Each Set data object of Type Set(x, y) would be a Gridded2DSet
with manifold dimension = 2 and a 2 x 2 grid (just 4 corners).
The domain Set for (index -> ... would just be an Integer1DSet
for the number of filled grid squares you need.

Cheers,
Bill


 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690