Using Topography in Paraview

Paraview uses a Cartesian coordinate system, and requires the connectivity between points in order to color the spaces in between. Thus, the topography data must be converted e.g. to the VTK polydata format, which can be done with the following script: xyz2vtkpoly.pl

Examples:

./xyz2vtkpoly.pl input.xyz > output.vtk
zcat input.xyz.gz | ./xyz2vtkpoly.pl > output.vtk

The script assumes that the data are sorted. It tries to determine whether latitude and longitude count northward/southward or eastward/westward, respectively.

The following changes can be required in the script:

  • If the input data does not describe a sphere, but only a small section, i.e. the points with the highest longitude values shall not be connected with the ones with the lowest longitude, set the variable $is_sphere to 0.
  • If the input data is already Cartesian, i.e. not lon/lat, but e.g. UTM x/y, then set $polar2cart to 0. Then the conversion from polar to Cartesian coordinates is omitted.
  • There is an option that allows exaggeration of topography; set $exaggerate to a nonzero value.