Skip to content

Commit

Permalink
directs non-geo logiclayer queries to 5-year estimate
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Mar 22, 2019
1 parent d51ca77 commit 2485994
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion canon.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
.map(d => d.id instanceof Array ? d.id : [d.id]));

const poverty = cubes.find(cube => cube.name.includes("acs_ygpsar_poverty_by_gender_age_race"));
const bigGeos = poverty ? ids.every(g => g === "01000US") : ids.every(g => pops[g] && pops[g] >= 250000);
const bigGeos = poverty ? ids.every(g => g === "01000US") : ids.length ? ids.every(g => pops[g] && pops[g] >= 250000) : false;
const tracts = query.dimensions.filter(d => (d.relation || "").includes("Tract")).length;

return cubes.filter(cube => cube.name.match(bigGeos && !tracts ? /_1$/g : /_5$/g));
Expand Down

0 comments on commit 2485994

Please sign in to comment.