1

I am trying to calculate the population in a country as follows:

//Population per square km:
var pop_count = ee.ImageCollection("CIESIN/GPWv411/GPW_Population_Count").filter(ee.Filter.date('2020-01-01', '2020-12-31')).mean();
//Country specified:
var country = ee.FeatureCollection("FAO/GAUL_SIMPLIFIED_500m/2015/level0").filter(ee.Filter.eq('ADM0_NAME', 'South Africa'))

//Population in entire country
var pop_country = pop_count.reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: country.geometry(),
  //scale: ???
})

I get an error if I don't specify scale, but I want one number (population) for the entire country. What scale should I specify?

1
  • That would depend on the country
    – Vince
    Commented Aug 28, 2021 at 18:20

1 Answer 1

1

You can take the native scale of the data you are using:

var scale = ee.ImageCollection("CIESIN/GPWv411/GPW_Population_Count")
                .first().projection().nominalScale())
print(scale)

Or look at the data catalog entry of the data and take the scale from there. (Unfortunately for GPWv411 the scale is 30 arc seconds which you then would have to convert to meters. So the first solution requires a bit less effort).

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.