LibGrid

Tools

GridFiles | | Programming API

Command Line Tools

The libGrid package also contains command line tools to query, copy and manipulate terrain data. For example, general geospatial information about tif or db files can be extracted analogue to the gdalinfo tool with the gridinfo tool. In order to print information about the Manana Island detail texture for example we use the command line.

grid/tools/gridinfo data/imag/Oahu-Islands/MananaIsland.tif

yielding the output

grid_layer:
 valid=yes
 size_x=3082
 size_y=4917
 channels=3
 layout=cell-centered
 repo=“ ”
 loadable=yes
 path=“data/imag/Oahu-Islands/MananaIsland.tif”
grid_extent:
 leftbottom=[ (637785,2.35537e+06,0) t=0 crs=UTM zone=4 datum=NAD83 ]
 rightbottom=[ (640404,2.35537e+06,0) t=0 crs=UTM zone=4 datum=NAD83 ]
 lefttop=[ (637785,2.35955e+06,0) t=0 crs=UTM zone=4 datum=NAD83 ]
 righttop=[ (640404,2.35955e+06,0) t=0 crs=UTM zone=4 datum=NAD83 ]
grid_properties:
 type=“byte”
 nodata=0
 scale=1
 bias=0
 spacing=0.850115(0.850173/0.850058)
 range=[0.0562092..0.956863]

Another handy tool is the gridcopy tool, which allows to copy and modify grid data. The most common usage is to read an uncompressed image and compress it either with LZW or the JPG-in-TIF option. The latter uses the YCbCr color space, which leads to a very reasonable compression ratio at a high image quality using just a regular JPEG compression embedded into a GeoTiff file. LZW is the recommended format for losslessly compressed data, whereas JPG-in-TIF is the recommended format for lossy compressions. Do not forget to keep the original uncompressed data around to prevent quality degradation from multiple lossy compressions. See the usage message of the gridcopy tool for further details on the available options.

GridFiles | | Programming API

Options: