After running raster layer unique value report I have got pixel number and area in degree.
How can I turn it in square kilometres (km2)?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityAfter running raster layer unique value report I have got pixel number and area in degree.
How can I turn it in square kilometres (km2)?
You can not.
Think in the Earth as a sphere. One degree of latitude represents always the same length, and only depends of the radius of the sphere. But one degree of longitude represents different lengths depending of (the radius of the sphere and) the latitude in which that degree of longitude difference was measured. The ratio is trigonometric in the sphere, so that at the equator, a difference of one degree in longitude only depends on the radius of the sphere, and at the poles a difference of one degree of longitude equals zero meters length.
Even being able to convert differences of longitudes and latitudes into distances, knowing in which part of the Earth those differences took place, a degree^2 can't be converted to km^2. Because 1 degree^2 can be 1 degree of longitude difference by 1 degree of latitude difference, or 2 degrees of longitude difference by 0.5 degrees of latitude difference, or any of the other endless possibilities, returning all of them a different result.
Therefore, what corresponds is to project the raster to an appropriate coordinate system that allows it to ensure that each pixel of the image encompasses the same terrestrial surface, and then perform spatial analyzes over those pixels.
Jon's suggestion is correct. Generally, the steps are as follow:-
1) Choose a suitable map projection for the area of interest ("AOI"), including the values for the (map) projection parameters. This part of the answer can be more specific if you hint the bounding latitudes and longitudes for the AOI.
2) Work with the projected result whose UOM is now in metric meter.
3) Avoid whole-world projections esp the Web Mercator (EPSG 3857), unless:-
a) Your AOI is relatively small, or
b) You are within 3~5% lat of the Equator, or
c) You are not concern about grid directions, or
d) You can accept relatively large margin of error.