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.
Hi Stuart, > Using examples/MapProjectionDisplay as a (very useful!) starting point, I > have finally learnt how to do display side coord systems. Now I can plot > a grid of data and its projection (and thus basemaps, grid lines) on a > display. But... > > if I change the aspect ratio, which I did to show that my grid of model > data is rectangular rather than square, then my display is not right. For > example, the method used in the examples/MapProjectionDisplay to track the > lat/lon, ie, finding the 'ray' from Swing's pixel coords, fails if a > non-square aspect ratio is in place (at least I think it is failing?) Is the failure the behavior you describe in the next paragraph under "Furthermore"? Or is there other behavior that you can describe for us (every bit of evidence helps)? Are you calling setASpect() or setAspectCartesian() to change the aspect ratio? > Furthermore (related?), if I alter the aspect ratio, my 'grid' of data > still fits in the box (my grid is defined by the 'getDefaultMapArea' of > the MapProjection), but the box now contains more/less of the background > map, which is the OUTLUSAM file and is thus lat/lon. It would be useful to know: 1. The MathType of your grid data and map (I assume the map MathType is set(lat, lon)(. 2. The new DisplayRealTypes you are constructing, how they form a DisplayTupleType, and the reference for their CoordinateSystem [I assume this must be (XAxis, YAxis, ZAxis)]. 3. The ScalarMaps you are adding to your DisplayImpl. > PS: is there another way to locate the display values (ie the -1 -> 1 for > Display.XAxis, Display.YAxis) given the mouse coords? I note that the > mouse drag with middle button down produces on the canvas the values for > all scalar mapped types. Is this using the find ray method? This does use the MouseBehavior.findRay() method and some complex logic in DisplayRenderer.setCursorStringVector(). Its been a long time, so my memory is a bit fuzzy. Bill
visad
archives: