countiesGeoArea = countiesGeo.features
.map(f => {
const area_sqkm = landAreaByFips.get(f.id).area / 1000000;
const pop = countiesPopulation.get(f.id);
const pop_density = pop && area_sqkm ? pop / area_sqkm : undefined;
return {
...f,
properties: {
...f.properties,
pop,
area_sqkm,
pop_density
}
};
})
.filter(d => d.properties.pop_density !== undefined)