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

Michael Jackson mike.jackson at bluequartz.net
Mon Oct 13 09:46:53 EDT 2008


You should be able to read this file with the vtkImageReader2 class by  
setting the appropriate values:

Here are my guesses.


vtkImageReader2* reader =vtkImageReader2::New();
reader->SetFileName("Path/To/File.hgt");
reader->SetDataScalarTypeToShort();
reader->SetDataExtent ( 0, 1200, 0, 1200, 0, 0);
reader->SetFileDimensionality(2);
reader->SetDataByteOrderToBigEndian ();
reader->FileLowerLeftOn();
reader->Update();

None of that was actually tried..


_________________________________________________________
Mike Jackson                  mike.jackson at bluequartz.net
             www.bluequartz.net



On Oct 13, 2008, at 9:36 AM, Elvis Dowson wrote:

> Hi Mathieu,
>                       Now that I know the size of the file and that  
> the computation is 1201x1201x2, what should I do next? :-)
>
> Best regards,
>
> Elvis Dowson
>
> On Oct 13, 2008, at 5:29 PM, Elvis Dowson wrote:
>
>> Hi Mathieu,
>>                     So, if the size of the file is 2884802, then  
>> this implies that the sizeof(int) is 2 (which I'm assuming is the  
>> total number of bytes used to represent a signed integer. Since  
>> 1201x1201 = 1442401.
>>
>> Best regards,
>>
>> Elvis Dowson
>>
>> elvis-dowsons-macbook-pro:~ elvis$ ls -al "/Users/elvis/Repository/ 
>> Data/NASASRTM/version2/SRTM3/Eurasia/N25E070.hgt"
>> -rw-r--r--@ 1 elvis  staff  2884802 May 27  2005 /Users/elvis/ 
>> Repository/Data/NASASRTM/version2/SRTM3/Eurasia/N25E070.hgt
>>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list