[vtkusers] DEM and gtopo30 - topography

Jean M. Favre jfavre at cscs.ch
Mon Sep 15 03:56:04 EDT 2003


Lucas Peetz Dulley wrote: 
> I want to load the .DEM files from
> http://edcdaac.usgs.gov/gtopo30/gtopo30.html

> OBS:
> the vtkDEMReader seems to read ascii files, where the DEMs I got are
> binary??? weird... the dem file in $VTKDATAROOT/Data/ is in ascii :(

It is quite easy to get started. Just create an ASCII header to use as
prefix to your data.

The README file from the web site says "the 27 tiles that individually
cover 50 degrees of latitude and 40 degrees of longitude each have 6,000
rows and 4,800 columns)"

Just use the following 10 lines as your header:

# vtk DataFile Version 3.0
DEM file
BINARY
DATASET STRUCTURED_POINTS
DIMENSIONS 4800 6000 1
ORIGIN 0 0 0
SPACING 1 1 1
POINT_DATA 28800000
SCALARS elevation short 1
LOOKUP_TABLE default

append to it the file *.DEM. E.g

cat header.vtk file.DEM > DEMfile.vtk

The VTK file is perfectly valid for reading with vtkDataSetReader. Byte
order is specified in the header file as "BYTEORDER, byte order in which
image pixel values are stored &nbspM = Motorola byte order (most
significant byte first)".

If you have a different endian-ness, I recommend you use the newer
XML-based file format. I also strongly suggest to use Data Streaming
because this mesh is quite large for a desktop.


-- 
Dr. Jean M. Favre,                            email:favre at cscs.ch
http://www.cscs.ch/people/Favre.html
CSCS, Swiss Center for Scientific Computing | Tel:  +41 (91) 610.82.40
Via Cantonale, 6928 Manno, Switzerland      | Fax:  +41 (91) 610.82.82



More information about the vtkusers mailing list