0

I am using GDAL. in command prompt, i am doing

$ gdalinfo (my file location)

It works but because it is a huge file the command gives a lot of information. I am only interested in seeing what's near the beginning. The command prompt only allows scrolling up to the last 1000 or so lines of info (it must give about 100,000 lines or so). How can I do this?

JJD
  • 50,076
  • 60
  • 203
  • 339
mark
  • 1
  • 2

2 Answers2

3

This will depend on the OS and utilities it provides. I am assuming you are using a POSIX OS which support pipes and provides utilities such as less/more. The command in this case would be:

$ gdalinfo file.tif | less

If less is unavailable, you may have the more command installed. You can also save the output from gdalinfo into a file and look at the file later.

$gdalinfo tile.tif > output.txt 

n


[Appended]

On Windows, I get a truncated response like this:

C:\Users\elijah>gdalinfo "C:\xData\GreeneCountyMo\ortho_1-1_1n_s_mo077_2010_1.sid" | more

(Use ENTER/RETURN to advance to the next line, and CTRL+C to "escape" when you're finished.)

Or I can do the outfile as well:

C:\Users\elijah>gdalinfo "C:\xData\ortho_1-1_1n_s_mo077_2010_1.sid" > "C:\xData\gdalinfo.txt"
elrobis
  • 1,512
  • 2
  • 16
  • 22
nayden
  • 131
  • 3
0

If you are on a windows machine... What type of file are you using? Perhaps it contains a lot of ground control points, which you can skip using the -nogcp flag, or skip the metadata using the -nomd flag (see http://www.gdal.org/gdalinfo.html). Also, see --help-general; you might have the --debug flag set to on?

Benjamin
  • 11,560
  • 13
  • 70
  • 119