Kdtquery

From Gerris

Jump to: navigation, search

The kdtquery command can be used to manually query the content of a KDT terrain database (typically created using the xyz2kdt command).

The syntax is

kdtquery DATABASE < FILE

where DATABASE is the path/basename of the database to use and FILE contains a list of coordinates of bounding boxes of the points to select. The output will be a list of space-separated x, y and z coordinates of the points contained within the bounding boxes.

Example

To select all the points of the etopo2 database contained within 0 and 0.1 degree of longitude and 2 and 2.1 degree of latitude one could do

echo "0 2 0.1 2.1" | kdtquery etopo2

which will return

0.01666667 2.01666665 -4811
0.01666667 2.04999995 -4807
0.01666667 2.08333325 -4807
0.05000000 2.01666665 -4813
0.05000000 2.04999995 -4809
0.05000000 2.08333325 -4807
0.08333333 2.01666665 -4813
0.08333333 2.04999995 -4811
0.08333333 2.08333325 -4807
9

Note that the points coordinates are returned on standard output, while the total number of points selected (9 here) is returned on standard error.

Personal tools
communication