3

I was trying to get the population by country by using GEE. I tried the following code:

// world population 2015
var pop = ee.Image("JRC/GHSL/P2016/POP_GPW_GLOBE_V1/2015");
print(pop);
Map.addLayer(pop,{},'Population');

//world boundaries
var bound = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017");
print(bound);
Map.addLayer(bound,{},'boundaries');

// Getting Pop-2015 By country
var popcountry = pop.reduceRegions({
  collection:bound,
  reducer: ee.Reducer.sum(),
  scale: 250,
  });
print(popcountry);
Map.addLayer(popcountry,{},'PopC');

The issues that I see are the followings:

  1. I only get a global population about 1 billions instead of about 7 bn.;

  2. Many countries are zeros;

  3. I tried to use different boundaries (specifically GADM), but I can't get any results as it appears something like an internal error has ocurred.

1 Answer 1

0

I 'think' you should specifically set a crs in the reduceRegions function. As the calculation will run out of time (reprojection in different projection takes a lot of time), you should export the result to get a proper result.

// Getting Pop-2015 By country
var popcountry = pop.reduceRegions({
  collection:bound,
  reducer: ee.Reducer.sum(),
  scale: 250,
  crs: 'EPSG:4326', // world wide crs which seems to work for me
  });

Export.table.toAsset(popcountry.limit(10), 'worldPopTest', 'worldPopTest')

Note that I tried first setting the original crs (and crsTransform) as projection, but that did not work (I think due to this: link forum, link projections). Therefore I choose the crs EPSG:4326 and results seems to match the real populations.

link code

1
  • Adding this specific crs ('EPSG:4326') overestimate the global population as the total population is reported to be 8.5 billion people instead of about 7.3 billion. Any other suggestions? Thanks.
    – pmj
    Commented Nov 3, 2020 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.