Skip to main content
Tweeted twitter.com/StackGIS/status/1219771805277310980
edited title; edited title
Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Problem in getting Getting population by country using GEEGoogle Earth Engine

deleted 5 characters in body
Source Link
Kadir Şahbaz
  • 78k
  • 57
  • 257
  • 404

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. 

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.

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. 

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.

Source Link
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.