[vtkusers] vtk data file format question

Kevin Wright krw at viz-solutions.com
Wed Oct 2 13:42:45 EDT 2002


At 10:21 AM 10/2/2002 -0700, you wrote:
>Hi everybody,
>
>I have a set of data in an ASCII text file. It's an airplane's flight 
>track, so I have lat/long and altitude info and also some onboard 
>instrument data. The coords and altitude map nicely into the xyz point 
>coordinates. I would like the instrument data to be the scalars for the 
>polydata line that gets created. But I have two sets of data and the vtk 
>data file format (.vtk) only seems to allow one set of plain scalars, 
>can't have scalars with more than one component. I guess I could add the 
>second set by hand, but I would like to know if there is anything I can do 
>to just put all the data into one vtk datafile, so I can just use 
>vtkPolyDataReader to read it all and assemble it correctly.

You can enter as many scalar/vector fields as you want using the FIELD tag 
in the polydata file:

FIELD <name> <num arrays>
<array name> <num components> <num tuples> <data type>
<data...>
<array name 2> ....

for example, a single scalar field of 300 floating point numbers might look 
like:
FIELD extraScalar 1
InstrReading 1 300 float
1.2 1.4 1.2 1.7 .....





More information about the vtkusers mailing list