From Open Foris Wiki

Jump to: navigation, search

This script generates a grid of points over an image text file, with user-defined spacing in x and y directions. Output is a text file with the coordinates of the points.

Usage: oft-gengrid.bash <input_img> <DX> <DY> <output>

<input_img> is a georeferenced input image
<DX> distance between the points in X direction
<DY> distance between the points in Y direction


cd /home/.../OFGT-data
  • Run the command line for generating the grid of 1000 x 1000 m distance over the image
oft-gengrid.bash images/landsat_t1.tif 1000 1000 results/grid_points.txt
  • Look at the first lines of your result:
head  results/grid_points.txt
  • This is how they look like:

1 730785 -2456134

2 730785 -2455134

3 730785 -2454134


  • Load the data in QGIS using 'Add Delimited Text Layer' and see how it overlays on your Landsat image.
Zoom of the result overlayed on the original Landsat image in QGIS

Back to Open Foris Toolkit Main Page

Back to Tools & Exercises

Personal tools