Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.

Re: Null values in Linear2DSet?

Hi Andrew,

> I am working with elevation data that can be very nicely held
> in a Linear2DSet, except that sometimes a few of the values
> are missing around the edges so that the rectangular area is
> not completely filled.
> 
> What is the best way of handling this? Can I set a null
> value? Or do I have to go to am Irregular2DSet? What would be
> the performance penalty of doing so?
> 
> Sorry, I did have a look through the email archives and test
> examples but could not find an answer.

You can construct a FlatField with a Linear2DSet for its
domain, and use Float.NaN for the missing values in the
array you pass to its:

  public void setSamples(float[][] range)

In your display the missing values will be invisible, or
just black in the case of texture mapping.

Cheers,
Bill


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