(geojsonPath, outputPath)
| 32 | } |
| 33 | |
| 34 | function createCountriesList(geojsonPath, outputPath) { |
| 35 | const geojson = getJsonFile(geojsonPath); |
| 36 | if (!geojson.features) return; |
| 37 | |
| 38 | const countryData = geojson.features |
| 39 | .map((feature) => { |
| 40 | const { iso3cd, nam_en } = feature.properties; |
| 41 | return { iso3cd, name: nam_en }; |
| 42 | }) |
| 43 | .sort((a, b) => a.name.localeCompare(b.name)); |
| 44 | |
| 45 | fs.writeFileSync(outputPath, JSON.stringify(countryData)); |
| 46 | } |
| 47 | |
| 48 | function addCentroidsToGeojson(geojsonPath) { |
| 49 | const geojson = getJsonFile(geojsonPath); |
no test coverage detected
searching dependent graphs…