[vtkusers] How to import NASA SRTM DEM data into VTK

Elvis Dowson elvis.dowson at mac.com
Mon Oct 13 10:03:06 EDT 2008


Okay, this is exciting stuff!! :-)  I think I needed to set the scalar  
data type to short.

vtkImageReader2 reader
   reader SetFileName "/Users/elvis/Repository/Data/NASASRTM/version2/ 
SRTM3/Eurasia/N25E070.hgt"
   reader SetHeaderSize 0
   reader SetDataByteOrderToBigEndian
   reader FileLowerLeftOn
   reader SetDataScalarTypeToShort
   reader SetFileDimensionality 2
   reader SetDataExtent 0 1200 0 1200 -32767 32767

This resulted in the entire image being read in and generating the  
following raster image:



It doesn't appear to any recognizable type of terrain relief, but I  
think it's probably be cause it's positioned at the wrong area? Maybe  
if I try to get the exact lat long or St. Helens or Mt. Everest, I  
could check to see if the relief looks like some sort of mountain.

Wooo, this is exciting stuff. If it hadn't been for Mike and Mathieu,  
I wouldn't have even made it this far!! :-) Thanks Guys!! :-)

Best regards,

Elvis Dowson


On Oct 13, 2008, at 5:54 PM, Elvis Dowson wrote:

> Same error and image when I set the data extent to
>
> reader SetDataExtent 0 1200 0 1200 -32767 32767
>
> elvis-dowsons-macbook-pro:~ elvis$ wish
> % Generic Warning: In /Users/elvis/Tool/vtk-5.x/src/VTK/IO/ 
> vtkImageReader2.cxx, line 775
> File operation failed. row = 600, Read = 4804, FilePos = -1
>
> Best regards,
>
> Elvis Dowson
>
> On Oct 13, 2008, at 5:51 PM, Elvis Dowson wrote:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081013/789b1919/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SRTM Data Import 2.png
Type: image/png
Size: 29402 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081013/789b1919/attachment.png>


More information about the vtkusers mailing list