MATLAB Answers

0

How to calculate the area of each grid cell?

Asked by Mikhail Latonin on 2 Mar 2019
Latest activity Commented on by Chad Greene
on 28 May 2019 at 21:23
I have gridded data of air temperature with the spatial resolution 1.25 x 1.25 degrees (lon-lat). The data covers the Northern Hemisphere, and the first latitude is 90 degrees.
I need to calculate the area of each grid cell, and my approach is to do that from the latitude bands.
An alternative could be to read in the area of each grid cell directly from the netCDF file. Is that possible in MATLAB?
Here is my code I have tried; I am not sure if that is correct.
i=1:72;
j=2:73;
R=6371; % Earth's radius in km^2
deltalon=1.25;
area=(pi/180)*R^2*((sind(latitude(i)) - sind(latitude(j)))*deltalon); % Area of each grid cell in km^2

  0 Comments

Sign in to comment.

1 Answer

Answer by Chad Greene
on 6 Mar 2019
 Accepted Answer

The easiest way is to use the cdtarea function in the Climate Data Toolbox for Matlab. For gridded coordinates Lat,Lon, syntax is just
A = cdtarea(Lat,Lon);
for area in square meters, or
A = cdtarea(Lat,Lon,'km2');
for area in square kilometers.

  2 Comments

Thank you, Chad! And thanks for CDT!
I met the same problem, and tried this toolbox. I also compared the calculated area with that estimated in ArcGIS, after reprojecting from geographic projection to an equal area projected one. The area calculated in Matlab with this tool was 26239000 km2, while that estimated in ArcGIS was 26567500 km2. It's acceptable. Good!
Fantastic; thanks for the feedback, Lei!

Sign in to comment.