Area calculation


I am working with Landsat 5 TM L2 product, I want to calculate the area in Km2 of a particular ROI where I have the number of pixels that cover this ROI. How can I do it? Is there any example?
Thank you!

F -

Hi @fer_rb ,

The easiest way to measure areas is using an GIS application, e.g. QGIS. You can find how to do it with their documentation.

Hi Fernando,

In addition to @chung.horng’s answer, you could also calculate the area quite easily in your current workflow. Are you requesting the data over your ROI at the original resolution of Landsat 5: 30 meters? If so, you can obtain your area in km² by multiplying your number of pixels by 0,0009 (0.03*0.03).

Hi Chung and Maxim:

Thanks for your responses! I understand that Landsat 5 have a resolution of 30 meters (pixel size= 30mx30m) but actually I am not sure that I am requesting the data over my ROI at the original resolution.

  • How can I check or configure this variable?

At this moment I have traced a polygon over a lake of approximately 6500 Km2, then I detect water using NDWI idex and try to count the number of pixels of NDWI > 0.5 using an histogram. Then the area calculated dont represent the actual area when I multiply: q_px * 0.03 * 0.03

  • Is there any example similar to this maybe? It has any relation with the ResX and ResY in CRS units? If so, How can I know the correct values to fill this fields according to the resolution of Landsat5 and the ROI coordinates? I am not sure if this is correct…

Thanks for the support!

Hi Fernando,

To check the pixels’ resolution of your file, you can either use gdalinfo or open it with a GIS application and check its properties. You can find the resolution under the Pixel size attribute. After having the resolution of your imagery, the way you calculate the area (q_px * pixel_size_x * pixel_size_y) should represent the actual area of the lake.

If you are interested in requesting data with a specific resolution, you can replace the height/width parameters by resx/resy: please note that in this case the resolution is in the same units as the bounding box / polygon coordinates specified (e.g. if you are using EPSG:4326, the units are in degrees), so you may want to specify your inputs in UTM or a similar reference system. Our API reference describes the inputs in more detail, or if you are using Python, you can refer to the package documentation.

1 Like