[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20040922: IDV - Topography and terrain




Dave,


Thanks for the quick response.  I was trying to use 3D data and would never
have thought of using 2D data.  I also did not realize that the display
items changed after you had a topographic map.  It would be nice to be able
to put 3D over the topo and maintain the vertical scale.

I don't understand. Are your displays changing when you add in a topography based display?




I have attached a couple of images of what we are doing with maps on Vis5D
and are trying to replicate on IDV.   It is very important to relate weather
to a location name such as a city.
First, the IDV does not support volume rendering like vis5d does.

You can add a map background to the idv from an image. The primary problem
is that the IDV needs to have some  geolocation information about the image.
To do this you can do the following (somewhat convoluted) steps.
Add the following jython to your jython library (form the Edit->Formulas->Jython menu)

def navImage (d,ulLat,ulLon,lrLat,lrLon):
   from ucar.unidata.data.grid.GridUtil import *
   from visad import Linear2DSet
   from visad import RealTupleType
   ulLat=float(ulLat)
   ulLon=float(ulLon)
   lrLat=float(lrLat)
   lrLon=float(lrLon)
   domain = d.getDomainSet()
newDomain = Linear2DSet(RealTupleType.SpatialEarth2DTuple,ulLon,lrLon,domain.getX().getLength(),ulLat,lrLat,domain.getY().getLength())
   return setSpatialDomain(d, newDomain)

This takes a visad data object (d) which is the data from an image and the lat/lon corners of the image. It adds
a new domain to the data.

Next, create a formula that calls the above routine:
Call it, e.g., navigatedImage. The formula is:
navImage(image,user_ulLat,user_ulLon,user_lrLat,user_lrLon)

The user_... parameters are user input values.
Now load in the topo image. You should get a field that is labeled:
((Image element, Image line) --> (Red, Green, Blue).

Now go and select your navigatedImage formula and choose the "3 Color RGB image display" Create the display. You should be prompted for the lat/lon bounding box information. After entering it you will be prompted for the image data. Select the image you just loaded in.
If all goes right you should be able to see the image in the main display.

Currently, there is some bug with draping the image over topography.


Once this is all done you can always save off this state as a bundle so as to not have to go through these steps again.


If all you want to do is to place the names of cities and locations it is easy to add in new location lists to the idv and display them. Also, if you have shape files of roads, etc., you can also display them in the IDV.



I have also found that if you have a data source from a local file and bring
in a data source from the web that the data source box expands vertically to
a very large area that you have to scroll through to find you data.  Most of
the area is blank.

Yes that is a problem with long named data sets. We have addressed this in the past but, clearly, need to address it again.

-Jeff