NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Greetings I'd really appreciate some help with my lack of understanding of the visad model. I'm trying to display the postions (lat, long, alt) of some weather stations as a learning exercise. I'm getting the error "RealType Longitude occurs more than once: ShadowType.testIndices" when the Java 3D viewer comes up, and nothing else. I assume that my logic is at fault (it was a strain just getting it to compile). {If I get this to work I next want to show the period of operation (span) of the stations as a bar in the Z axis, rather than station altitude.} Here is the relevant bit of code I think: __________________________________________________ RealTupleType stationSpan = new RealTupleType(RealType.Latitude, RealType.Longitude, RealType.Altitude); int nstations=testquery.stations.size(); // the number of stations to display float span[][]=new float[3][nstations]; for (int i=0;i<nstations;i++){ WeatherStation current=(WeatherStation) testquery.stations.elementAt(i); span[0][i]=(float) current.latitude; span[1][i]=(float) current.longitude; span[2][i]=(float) current.altitude; } final DataReference stations_ref = new DataReferenceImpl("stations"); stations_ref.setData(new Gridded3DSet(stationSpan,span,nstations)); DisplayImpl display = new DisplayImplJ3D("image display"); // map earth coordinates to display coordinates display.addMap(new ScalarMap(RealType.Latitude, Display.XAxis)); display.addMap(new ScalarMap(RealType.Longitude, Display.YAxis)); display.addMap(new ScalarMap(RealType.Altitude, Display.ZAxis)); display.addReference(stations_ref); ______________________________________________ Thanks for any advice -- Matthew Laurenson National Agriculture Research Center Ministry of Agriculture, Forestry and Fisheries 3-1-1 Kannondai Tsukuba Ibaraki 305-8666 JAPAN ph +81-298-38-7025 fax +81-298-38-8551
visad
archives: