Google Earth is a virtual globe, map, and geographical information program. It maps the Earth by the superimposition of images obtained from satellite imagery, aerial photography, and GIS 3D globe. It is available under two different licenses: Google Earth, a free version with limited function and Google Earth Pro ($399 per year), which is intended for commercial use.
Although Google Earth cannot access NASA HDF/HDF-EOS data directly, there are other ways to access and visualize NASA HDF/HDF-EOS data through data conversion such as Keyhole Markup Language (KML), Web Map Service (WMS), and GeoTIFF. This example will cover all three data access methods.
Google Earth is supported on many platforms including mobile platforms. Please click one of the following links based on your platform to download the application.
If you want to import GeoTIFF file, you need to download the Google Earth Pro. Google Earth Pro is supported only on desktop environment.
Once you download the setup programs, installation is quite straightforward with minimal user's involvement.
Google Earth is able to show all kinds of images such as (JPEG, PNG, GIF) overlaid on the surface of the earth but Google Earth supports managing three-dimensional Geo-spatial data through Keyhole Markup Language (KML).
There are several ways to create KML from NASA HDF/HDF-EOS data. We'll go over Panoply, IDV, NCL, IDL, and MATLAB.
In our Panoply example page, you can learn how to access and visualize HDF data via OPeNDAP service. Once you succeed in visualizing data, you can export it as KMZ as shown in Figure 1. by selecting File > Export KMZ menu in Panoply. A KMZ file is a zipped KML file.
Panoply will show a new dialog box that asks two options, and you can simply press OK button in the dialog box. Now you are ready to open the saved KMZ file with Google Earth. Use File > Open menu in Google Earth to load the saved KMZ file. You can download our sample KMZ file here. Google Earth will visualize the KMZ file as shown in Figure 2.
In our IDV example page, you can also learn how to access and visualize HDF data via OPeNDAP service. Once you succeed in visualizing data, you can export it as KMZ as shown in Figure 3. by selecting View > Capture > Image menu in the Map View window of IDV.
IDV will show a Save dialog box that asks Files of Type at the bottom. Select Google Earth File (*.kml, *.kmz) and provide your own file name. Press Save button in the dialog box at the end. Now you are ready to open the saved KMZ file with Google Earth. Use File > Open menu in Google Earth to load the saved KMZ file. You can download our sample KMZ file here. Google Earth will visualize the KMZ file as shown in the following figure.
NCL can access HDF data both locally and remotely. We also provide many product-specific examples of NCL. You can reuse our NCL examples and create KML files out of them easily by following the steps below.
NCL, by default, doesn't support KML. Thus, you need to download and install kmlncl package first. The kmlncl relies on the convert program in ImageMagick package. Therefore, installing ImageMagick is a prerequisite.
The kmlncl uses the image overlay tag in KML, which means that kmlncl will convert NCL plot in PostScript into a PNG file. Since the kmlncl needs to geo-reference the converted PNG file, you need to prepare the PostScript plot in NCL carefully. This requires a few modification from our original sample comprehensive example as highlighted in Figure 5.
The complete NCL code for converting HDF-EOS5 to KMZ is here. You can visualize the converted KMZ file with Google Earth as shown in Figure 6.
Like NCL, IDL can also access HDF data both locally and remotely. We also provide many product-specific examples of IDL. You can reuse our IDL examples and create KML files out of them easily by following the steps below.
The most recent IDL, version 8.2.3, by default, supports writing a KML from an image. The IDL's KML will contain an overlay tag with a PNG file. Thus, we need to create a source image file in JPEG that can be geo-referenced easily. This requires a slight modification from our original sample comprehensive example as highlighted in Figure 7.
The complete IDL code for converting HDF-EOS5 to KMZ is here. You can visualize the converted KMZ file with Google Earth as shown in Figure 8.
Like NCL and IDL, MATLAB can also access HDF data both locally and remotely. We also provide many product-specific examples of MATLAB. You can reuse our MATLAB examples and create KML files out of them easily by following the steps below.
MATLAB provides a built-in function called kmlwrite
for creating a KML file using points and lines only, so the built-in function cannot overlay a contoured plot JPEG image that our examples generate. Therefore, we will use the KML Toolbox available from MATLAB CENTRAL File Exchange for our example. Please download the toolbox and decompress it first to follow our example.
The following code in Figure 9. highlights the required modification to use the KML Toolbox overlay
function on our sample comprehensive example. The code for accessing and plotting data is same. The key difference is to create a transparent image that can be overlaid properly on Google Earth by adjusting the figure size and by removing the title, the colorbar, and the extra border space around the figure.
The complete MATLAB code for converting HDF-EOS5 to KMZ is here. You can visualize the converted KMZ file with Google Earth as shown in Figure 10.
A Web Map Service (WMS) is a standard protocol for serving geo-referenced map images over the Internet. Some NASA data centers already provide WMS for HDF/HDF-EOS products. For example, GES DISC provides WMS for AIRS, TRMM, and OMI data products. LANCE Global Imagery Browse Service (GIBS) provides WMS for MODIS, VIIRS, MLS, OMI, and AIRS products. LANCE also provides WMS for MODIS fire product.
To visualize images provided by WMS, select Add > Image Overlay menu item or click the icon. Google Earth will pop up a new dialog box like Figure 11 below. Click the Refresh tab in the middle and you will see the WMS Parameters button on the right bottom corner as shown in Figure 11.
Press the WMS Parameters button. Google Earth will show a new window for entering WMS parameters as shown in Figure 12.
Press the Add button from the above window and enter the following sample URL that we copied from the link text WMS GetCapabilities in the GES DISC WMS service webpage.
Then, press OK. Google Earth will contact the WMS server and list the layers available from the server as shown in Figure 13.
Click one or more layers from the Transparent Layers list box on the left and press the Add-> button. In our example, we picked the TRMM_3A12_MONTHLY_surfaceRain layer as shown in Figure 14. The selected layer(s) will appear on the right list box.
Finally, press OK button for the WMS Parameters Window first and for the Add Layer Window next. The main Google Earth window will visualize the TRMM data as shown in Figure 15.
Unlike KML, Google Earth fetches only the WMS image that covers the region of the current view over the Internet. Therefore, if you move around or zoom in/out the globe with your mouse, Google Earth will make a new request to the map server and fetch a new image, which may delay in visualizing data.
If your NASA HDF data products of interest are not available via WMS by NASA data centers, you may want to set up your own WMS using THREDDS or ncWMS by converting HDF/HDF-EOS into NetCDF via OPeNDAP HDF4 handler & HDF5 handler or H4CF conversion toolkit first and editing the converted file with NcML.
Google Earth Pro can import GeoTIFF directly. Please read this tutorial for importing and visualizing GeoTIFF data on Google Earth Pro.
There are several ways to create GeoTIFF from NASA HDF/HDF-EOS data. You can use HEG, ArcGIS, and GDAL. However, not all NASA HDF/HDF-EOS data products can be converted to GeoTIFF and each software has its own limitation.