Using NASA's World Wind Component in Your Java Technology Applications

   
By Dana Nourie, July 2007  

Articles Index

World Wind is open-source software, developed by the National Aeronautics and Space Administration (NASA) that allows you to zoom from satellite altitude into any place on earth. Leveraging Landsat satellite imagery and Shuttle Radar Topography Mission (SRTM) data, World Wind lets you experience any part of earth's terrain in visually rich 3D form, just as if you were really there. For instance, you can use World Wind to zoom in on the Himalayas or Mount Saint Helens, as shown in Figure 1. The combination of Landsat 7 imagery with SRTM data allows World Wind to display dramatic views of the earth at eye level. Users can literally fly across the world in any direction.

 

As fun as World Wind is to play with, that is not its purpose. Instead, World Wind is a Java technology component that you can integrate into your applications to incorporate 3D earth modeling. World Wind does all the hard work for you, such as dynamic image selection and retrieval for images of the earth's topography.

In addition, because the software is open source and written in the Java programming language, you can build into the NASA World Wind Java 3D visualization technology. You are also free to extend or embed the component architecture for business, research, or education. The possibilities for portable, high-performance 3D graphics rendering are wide open.

What World Wind Is and Is Not

NASA World Wind visualization technology is not just cool software. Instead, it is a component that can be included in any application or applet that needs access to NASA's world data and imagery. In addition, NASA has partnered with several organizations that also provide valuable data that you can use. World Wind has tremendous potential in science applications, educational software, and business and government use.

World Wind is not a copy of Google Earth, nor is it in competition with that software. Both NASA World Wind and Google Earth are sophisticated programs with amazing feature sets, and each has features that the other would benefit from. Despite how similar the programs seem, they differ significantly in focus, development history, and philosophy. Many people use both programs, depending on what they wish to accomplish. Google Earth is great for looking up any location on earth, and viewing earth data in different ways. But with World Wind, you can incorporate the component into your application to bring together your own data with data from other companies, or to use NASA data in new and innovative ways. For instance, World Wind can be use to create flight simulators, using earth or other planets, or it can be used to view data on specific diseases worldwide.

In addition, World Wind is not limited to information about the earth. In fact, you can use this component and modules to view the moon and other planets, or to look out into the universe, as shown in Figure 2. Because it was written to be extensible and replaceable, you can conform World Wind to whatever your needs are, and it will deal with complex and difficult image manipulation and handling.

 

World Wind also includes a myriad of advanced functions and capabilities. In addition, World Wind benefits from diverse input from the open-source user community, which has the power to shape its development. This has led to a proliferation of add-ons and plug-ins.

NASA has released World Wind, written in the Java programming language, to improve its quality through peer review, maximize public awareness and the impact of NASA research, and increase dissemination of World Wind.

World Wind as Application or Applet

You can deploy World Wind within an application with Java Web Start software, or you can deploy it as an applet through the browser. World Wind has eight packages, and more will be available in the future:

  • gov.nasa.worldwind -- The top-level world wind package.
  • gov.nasa.worldwind.awt -- Classes specific to use with Abstract Window Toolkit (AWT).
  • gov.nasa.worldwind.formats.gpx and gov.nasa.worldwind.formats.nmea -- Both are classes specific to GPS track formats.
  • gov.nasa.worldwind.geom -- Geometry and math classes.
  • gov.nasa.worldwind.globes -- Globes with earth, Mars, and so forth.
  • gov.nasa.worldwind.layers -- Imagery and other data to display on globes.
  • gov.nasa.worldwind.layers.Earth -- Layers specific to earth.
 
Creation of a World Wind Component in an Application
 

To create a World Wind component, simply create a frame and a window canvas, then listen for events.

  1. Add a WorldWindowGLCanvas object to a JFrame object:
  2.  
    Class MyWorldWindFrame extends Jframe
    {
            WorldWindowGLCanvas wwc = new WorldWindowGLCanvas();
            this.getConentPane().add(wwc, BorderLayout.CENTER);
    }
    
     
  3. Listen for World Wind events:
  4.  
    wwc.addSelectListener(new SelectListener()
    {
            public void selected(SelectEvent event) {...}
    
    });
    
     

Starting the World Wind brings up the component as a single application as shown in Figure 3.

 
The WorldWindow and View Interfaces

Following is the WorldWindow interface:

  • set/getModel(Model)
  • set/getView(View)
  • getSceneController(...)
  • pick(java.awt.Point)
  • set/getInputHandler(...)

To add or remove listeners, use the following:

  • PositionListener
  • SelectListener
  • RenderingListener
  • repaint()

Following is the View interface:

  • Fields
  • Position, direction, field of view, altitude, heading, pitch, roll, and so forth.
  • Actions
    • apply()
    • goto(lat/lon/elev/altitude)
    • project(Point 3Dpoint)
  • Compute
    • horizon()
    • positionFromScreenPoint(...)
    • rayFromScreenPoint(...)
Use of World Wind Within an Applet

To create an applet, you use the Java APIs for OpenGL (JOGL) Applet Launcher. The new JOGL Applet Launcher enables the creation and deployment of applets using 3D graphics through OpenGL without requiring the applet to be signed or performing any manual installation of software on the user's computer. It works on any combination of operating system and CPU supported by JOGL, with a Java Runtime Environment (JRE) version 1.4.2 or later installed into the browser.

The following code snippet is typical of what you would use on the applet page to launch the World Wind component within an applet.

<applet code="com.sun.opengl.util.JOGLAppletLauncher"
     width=400
     height=260
     codebase="http://www.tomgaskins.net/applet"
     archive="jogl.jar,gluegen-rt.jar,jogl-demos.jar">
  <param name="subapplet.classname"
     VALUE="worldwinddemo.Applet1Up">
  <param name="subapplet.displayname"
      VALUE="WorldWind Applet Demo">

  <param name="progressbar" value="true">

  <param name="cache_archive"
      VALUE="jogl.jar,gluegen-rt.jar,Applet1Up.jar">
  <param name="cache_archive_ex"
  VALUE="jogl.jar;preload,gluegen-rt.jar;
  preload,Applet1Up;preload">
</applet>
 

Note that the Applet1Up.jar file, which contains the WorldWindApplet class, does not need to be signed. Sun Microsystems, Inc., signs the jogl.jar and gluegen-rt.jar file, which contain the JOGL Applet Launcher and supporting classes. This is the only Java code that needs to be signed to deploy applets using JOGL, and it is the only certificate the end user must accept.

Architecture and API

NASA's extraordinary wealth of data, which can be measured in terabytes, comes from sources such as satellites orbiting earth and telescopes peering into deep space. NASA World Wind visualization technology can readily deliver geospatial data in the most compelling and accessible manner possible. Figure 4 is a simplification of how World Wind interacts with data systems.

 

World Wind is a collection of components that interactively display 3D geographic information within applications using Swing, Abstract Window Toolkit (AWT), Standard Widget Toolkit (SWT), or other user interface toolkits. Figure 5 shows World Wind's small number of replaceable components.

 

The World Wind API is defined primarily by interfaces, so you can selectively replace components with alternative components.

The application interface at the highest level is WorldWindow. Toolkit-specific implementations of the interface are provided for Swing/AWT.

In addition to WorldWindow, there are five major World Wind interfaces:

  • The Globe interface represents a planet's shape and terrain.
  • The Layer interface applies imagery or information to a Globe.
  • The Model interface aggregates a Globe and the Layers to apply to it. The application typically interacts with the model to create a globe of the earth, or Mars, or whatever the model needs to be. It can even be the universe.
  • The SceneController interface controls the rendering of a Model. It is also responsible for giving the scene update, timing, and events, as well as for mapping user actions.
  • The View interactively controls the user's view of the model.

In typical usage, applications associate a Globe object and several Layer objects with a Model object. Then they pass that model to a SceneController object, which displays the globe and its layers in a WorldWindow. The scene controller subsequently manages the display of the globe and its layers in conjunction with an interactive View interface that defines the user's view of the planet.

The objects implementing these interfaces may be those provided by World Wind or those created by application developers. Objects implementing a particular interface may be used wherever that interface is called for. World Wind provides several Globe objects representing the earth, Mars, and the earth's moon. And World Wind provides basic implementations of the Model, SceneController, and View interfaces.

The FrameController interface enables applications to control the integration of World Wind Java programming rendering into the application's rendering.

All data is persisted to or drawn from the local computer by the file cache. The file cache manages multiple disk storage locations and unifies access to them. The file cache is a singleton, accessible through the WorldWind singleton.

Progress and the Future

More data is becoming available all the time on the planets, moons, stars, weather, satellites, and time series. Soon more data formats will be natively supported. The useful components coming are a layer manager, animation player, drag-and-drop functionality, and user interface (UI) helpers. Additionally, World Wind will include RSS feed support and APIs for scripting extensions. Lastly, future versions of World Wind will include Eclipse and NetBeans IDE integration.

For More Information

World Wind
World Wind Forums
JOGL Applet Launcher Test Page
JOGLAppletLauncher Class
Introduction to JOGL
Java Web Start Technology

Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments:
Your email address (no reply is possible without an address):
Sun Privacy Policy

Note: We are not able to respond to all submitted comments.