Skip to main content
1 of 3
pmj
  • 81
  • 6

Problem in getting population by country using GEE

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: i) I only get a global population about 1 billions instead of about 7 bn.; ii) many countries are zeros; iii) 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'.

I would greatly appreciated any advice. With many thanks in advance. PM. 
pmj
  • 81
  • 6