# What is the meter square value of 1 pixel at a scale 10 in Google Earth Engine?

I am looking at the NDVI of various mangrove forests in the UAE. Using the .gt function I have binarily separated forests into not canopy versus canopy, based on an NDVI-value threshold. Then using ee.Reducer.sum() I managed to get the number of pixels in each mangrove site that are classified as "canopy".

If I wanted to know the size of each of those pixels in order to find out the total canopy size of each site, what should I do? I've tried the ee.Image.pixelArea() function but it doesn't seem to work or maybe I don't fully understand it.

My main train of thought was that just knowing the scale which is set at 10, shouldn't that be enough to find out the square meter coverage of 1 pixel?

(Almost) every map projection, including the one used in the Code Editor's interactive map, has a different scale at different points. Therefore, there is no single number which accurately describes the area of a pixel anywhere on the map.

`ee.Image.pixelArea()` may be used to determine the area of individual pixels so that you can perform accurate area calculations.

Generate an image in which the value of each pixel is the area of that pixel in square meters. The returned image has a single band called "area."

For example, if you add it to the map,

``````Map.addLayer(ee.Image.pixelArea());
``````

then click the “Inspector” tab in the Code Editor and click on the map, then the inspector will report the area of the specific pixel you clicked on. This area depends on the zoom level and where you are.

In order to use `pixelArea()` with a sum or count reducer, the usually correct thing to do is to multiply the input image by `pixelArea()`. Thus, each pixel's value is multiplied (weighted, if you like) by that pixel's area, so the overall answer is a sum over the area rather than the pixels.

To illustrate, I've added a threshold and reduceRegion to Earth Engine's NDVI example:

``````var region = ee.Geometry.Polygon([[[-95.5, 39.5], [-95.5, 38.8], [-94.3, 38.8], [-94.3, 39.5]]], null, false);
Map.setCenter(-94.84497, 39.01918, 8);

var img = ee.Image('MODIS/006/MOD09GA/2012_03_09');
var ndvi = img.normalizedDifference(['sur_refl_b02', 'sur_refl_b01']);

Map.addLayer(ndvi, {min: 0, max: 1}, 'NDVI');
var thresholded = ndvi.gt(0.35);

print('Scale 100 m', thresholded.multiply(ee.Image.pixelArea()).reduceRegion({
reducer: ee.Reducer.sum(),
geometry: region,
scale: 100,
}).get('nd'));
print('Scale 1 km', thresholded.multiply(ee.Image.pixelArea()).reduceRegion({
reducer: ee.Reducer.sum(),
geometry: region,
scale: 1000,
}).get('nd'));
``````

Since `thresholded` has a value of either 0 or 1, multiplying it by the area, `thresholded.multiply(ee.Image.pixelArea())`, produces that pixel's contribution to the total area: either nothing or the area of the pixel.
• I have found one error, however, for one of my sites. When I reduce the binary of that site using `var CanSum = canopy.reduceRegions({ reducer: ee.Reducer.sum(), collection: ROIEdit, scale: 10}); print('CanSum', CanSum); ` It says that in that site, there are 27.2 pixels with an NDVI higher than 0.3 thus classified as "1". However, when I use the ee.Image.pixelArea() and reudce it by the sum with a scale of 100, it prints out "0" do you know why that might be? Feb 23, 2021 at 12:18
{"ft_lang_label":"__label__en","ft_lang_prob":0.78281254,"math_prob":0.9057727,"size":2584,"snap":"2022-27-2022-33","text_gpt3_token_len":664,"char_repetition_ratio":0.13178295,"word_repetition_ratio":0.011267605,"special_character_ratio":0.27979878,"punctuation_ratio":0.23636363,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98760927,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-07-03T10:59:45Z\",\"WARC-Record-ID\":\"<urn:uuid:7895d9c9-0e0e-4020-b74c-7514adcda17b>\",\"Content-Length\":\"229265\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:48772d7d-3087-4ada-824d-54d4d54d4584>\",\"WARC-Concurrent-To\":\"<urn:uuid:da2db1c3-f4dd-4d75-a010-d43e4aac132f>\",\"WARC-IP-Address\":\"151.101.193.69\",\"WARC-Target-URI\":\"https://gis.stackexchange.com/questions/387934/what-is-the-meter-square-value-of-1-pixel-at-a-scale-10-in-google-earth-engine\",\"WARC-Payload-Digest\":\"sha1:EHP7ILEL4GKV2LRILMYIOQJK5V5DMEVM\",\"WARC-Block-Digest\":\"sha1:MQJE4C32PCQX33GITRKKS2QVQCN2KIU4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656104240553.67_warc_CC-MAIN-20220703104037-20220703134037-00644.warc.gz\"}"}