I'm trying to make a building-density map for Africa. Currently, I have polygons representing each building.
var t = ee.FeatureCollection('GOOGLE/Research/open-buildings/v1/polygons');
// t represents buildings
Is there a way, on Google Earth Engine, to count the number of buildings (or 'centres of buildings') in each square km?
I can currently count the buildings in a specific area, but am not sure how to loop that over each square km in Africa and display it.
Current code is:
var onebyone = ee.Geometry.Polygon(
[[[27.267432336497937, -26.34118164739369],
[27.267432336497937, -26.606706603577045],
[27.564063195872937, -26.606706603577045],
[27.564063195872937, -26.34118164739369]]], null, false);
// Filter buildings by area
var t = ee.FeatureCollection('GOOGLE/Research/open-buildings/v1/polygons');
var buildingdens = t.filterBounds(onebyone)
print('Count:', buildingdens.size());