RE: Using RubberBandBoxRendererJ3D results to specify filter for ShapeFileAdapter

Yes I use LatLon-Tuple.  Thanks this code works.  I had to switch the
samples assignments of lat and lon.   It still does not explain why
Rectangle2D uses the LL instead of UL as the start of the box.  Unless the
Rectangle2D help page is wrong.

Can I then apply a map projection to this display.  Though it is declared 3D
it is rendered as 2D.  I define my display as:

    display = new DisplayImplJ3D("Display", new TwoDDisplayRendererJ3D());

Luke

-----Original Message-----
From: Mathias Stümpert [mailto:atzes@xxxxxx]
Sent: Tuesday, June 04, 2002 3:14 AM
To: 'Luke A. Catania (TEC)'; VisAD List
Subject: AW: Using RubberBandBoxRendererJ3D results to specify filter for
ShapeFileAdapter

Hi Luke,

What are your RealTypes passed to RubberBandBoxRendererJ3D? I assume you
use a LatLon-Tuple. Your code is not very transparent and a bit to
complicated for what you want to do. Try this:

double latMin = Math.min(samples[0][0], samples[0][1]);
double latMax = Math.max(samples[0][0], samples[0][1]);
double lonMin = Math.min(samples[1][0], samples[1][1]);
double lonMax = Math.max(samples[1][0], samples[1][1]);
double width = lonMax-lonMin;
double height = latMax-latMin;
latMap.setRange(latMin, latMax);
lonMap.setRange(lonMin, lonMax);
latMap.getAxisScale().createStandardLabels(latMax, latMin, latMin, 15);
lonMap.getAxisScale().createStandardLabels(lonMax, lonMin, lonMin, 15);
try {
  mapBackgroundShapeFile = new ShapefileAdapter(shapeFilename,
    new Rectangle2D.Double(lonMin, latMin, width, height),
    dataCourseness);
} catch (IOException ioEx) {
  ioEx.printStackTrace();
}

That makes your code more tranparent since you don't have to distinguish
between different cases. I did not test the code so be aware of bugs :)
You should try to experiment with latMin, latMax and height, perhaps to
change latMin and latMax in latMap.setRange.

Hope that helps, Mathias


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