[GIS] Convert area in pixels to acres

convertgeotiff-tiff

I'm writing some software that allows users to draw polygons over the raster from a geotiff file.

I can calculate the area of the polygon in pixels; in fact, this calculation is a byproduct of finding the polygon's centroid (which I also report).

However, I would like to convert area in pixels to acres.

Presumably geotiffs have some metadata linking the raster to real world units. I'm vaguely familiar with the concept that internally geotiffs use a "Model (M)" and "Raster (R)" and that there is metadata relating them.

I'm trying to find exactly what metadata there is, and how to query it (using libgeotiff).

For example, if I had a value correlating pixels to square metres, it should be straight forward math to go from pixels -> metres -> acres.

If it is not possible to get an exact correspondence between pixels and real-world units, a method to calculate a reasonable approximation would suffice.

Best Answer

How big are the pixels on a side? This seems like a simple calculation if you know the number of pixels and their size i.e. A single 30m pixel (on each side) = 900 Square Meters = 0.2223945 acres (1 square meter = 0.000247105 acres). Am I misunderstanding something?

Try using the gdalinfo command to determine cell size and projection information.