[Gdal-dev] number of GCPs

Andrey Kiselev dron at ak4719.spb.edu
Thu Jan 1 15:06:18 EST 2004


On Wed, Dec 31, 2003 at 04:23:14PM -0500, list67 at netscape.net wrote:
> Hello.  I was wondering if there is a limit to the number of GCPs that
> can be added to a TIFF file.

Yes, such limit exists. We can store 65535 numerical values in the tag,
every point uses 6 values, so we have 65535/6 = 10922 points.

> So, when I run the program with a 10x10 tiff file, gdalinfo outputs
> all the GCPs.  None of the other files seem to work (78x78, 256x256,
> 1200x1200).  I looked into the code and changed int16 to int (in
> frmts/gtiff/geotiff.cpp Line 2291) and u_short to int on Line 989 of
> frmts/gtiff/libtiff/tif_dir.c.  This did not seem to fix anything
> though.

There was a small problem in the GTiff driver: type of the count
variable was signed instead of unsigned. That limits us with the 5461
points. I have fixed the problem.

						Andrey

-- 
Andrey V. Kiselev
Home phone:  +7 812 5274898  ICQ# 26871517



More information about the Gdal-dev mailing list