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),
} catch (IOException ioEx) {

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: