From Open Foris Wiki

Jump to: navigation, search

oft-bb - a bounding box calculator

oft-bb studies every pixel of the input file and reports minimum and maximum pixels coordinates of pixels having the given value. The minimum coordinates are 1,1.

Usage: oft-bb [-um maskfile] <inputfile> <value>


  • <inputfile> is an image file
  • <value> is the value you want to query
  • -um use mask file. It will consider only pixels which have mask value > 0


cd /home/.../OFGT-data
  • Find the bounding box of the Forest tree cover file with value "33"
oft-bb images/forestc.tif 33 
  • It should provide the following result :
Band 1 BB (xmin,ymin,xmax,ymax) is 1408 1740 1713 1964
  • You can visualize the result by subsetting the image to these extents using gdal_translate
gdal_translate -srcwin 1408 1740 305 224 images/forestc.tif results/bb_33.tif

The parameters for the size of the box are calculated as xmax-xmin and ymax-ymin

Visualize the results

qgis images/forestc.tif results/bb_33.tif


Back to Open Foris Toolkit Main Page

Back to Tools & Exercises

Personal tools