Skip to content

Commit 72b5369

Browse files
committed
Fix bug with creating subunits later
1 parent b8d2fe7 commit 72b5369

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

topojson/bin/process_geodata.mjs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,12 @@ async function createLakesLayer({ name, resolution, source }) {
215215

216216
async function createSubunitsLayer({ name, resolution, source }) {
217217
// Only include USA for 'usa' scope since the UN and NE borders don't match exactly and slivers of Canada creep in
218-
const filter = (name === 'usa' ? ['USA'] : ['AUS', 'BRA', 'CAN', 'USA'])
219-
.map((id) => `adm0_a3 === "${id}"`)
220-
.join(' || ');
218+
const filter = name === 'usa' ? 'adm0_a3 === "USA"' : config.filters.subunits;
221219
const inputFilePath = `${outputDirGeojson}/${getNEFilename({ resolution, source })}.geojson`;
222220
const outputFilePath = `${outputDirGeojson}/${name}_${resolution}m/subunits.geojson`;
223221
const commands = [
224222
inputFilePath,
225-
`-filter "${filter}"`,
223+
`-filter '${filter}'`,
226224
`-clip ${outputDirGeojson}/${name}_${resolution}m/countries.geojson`, // Clip to the continent
227225
`-o ${outputFilePath}`
228226
].join(' ');

0 commit comments

Comments
 (0)