Programming with JViews Maps > Introducing the Main Classes > Readers and Writers > The DEM/GTOPO30 Reader

GTOPO30 is a global digital elevation model (DEM) with a horizontal grid spacing of 30 arc seconds (approximately 1 kilometer). It covers the full extent of latitude from 90 degrees south to 90 degrees north, and the full extent of longitude from 180 degrees west to 180 degrees east. The vertical units represent elevation in meters above mean sea level. In the DEM, ocean areas have been masked as "no data" and have been assigned a value of -9999.

A full sample of a GTOPO30 database can be downloaded from: http://edcdaac.usgs.gov/gtopo30/gtopo30.asp.

This section describes the classes that allow you to read GTOPO30 files.

The source code for the Map Builder demonstration, which contains all of the code described in this section, can be found at <installdir>/jviews-maps81/samples/mapbuilder/index.html

The IlvGTopo30Reader Class

The IlvGTopo30Reader class is a file reader that creates reprojectable, stylable and pixel-on-demand images that can provide altitude data.

Using the IlvGTopo30Reader Class to Create Images

You need first to create an image reader, and then add the image file you want to be read:

IlvGTopo30Reader imageReader = new IlvGTopo30Reader();
imageReader.addMap(gtopoFile);
Creating a Data Source

Once you have created the reader, you need to create a data source, which should be linked with the manager properties by inserting it into the data source tree:

IlvMapDataSource imageDataSource = IlvRasterDataSourceFactory.
   buildTiledImageDataSource(manager,imageReader,true,true,null);
IlvMapDataSourceModel dataSourceModel =
   IlvMapDataSourceProperty.GetMapDataSourceModel(manager);
dataSourceModel.insert(imageDataSource);
Reading the Data

You can then start reading your data:

dataSourceModel.start();

Starting the data source creates the necessary tiled layers, tile managers and IlvRasterIcon instances to manage the pixel-on-demand feature and the progressive display of the geo-referenced image.

This icon associates altitude properties that can be used as altitude data sources, see Altitude Provider Property Uses.