Maybe this would give a “better image” of the reallity…
Get a complete high definition photos of the world at night by 9PM from Nasa or else…
run it to a scanner
Get a software able to define how many source of light you find within a square mile.
Define how many square miles makes a town, a village or a city,etc.. according to each country those poor and those richer…
Code your software to count how many of your Grouped Sq.M. you find.
and voila…at least it should work for all places where electricity gets…:)