add async in build, start to make variance script

Signed-off-by: tykayn <contact@cipherbliss.com>
This commit is contained in:
tykayn 2023-08-07 13:14:36 +02:00
parent 2be4e61a45
commit 0261facca3
3 changed files with 19 additions and 8 deletions

View File

@ -18,17 +18,17 @@ function exec_command(command: string) {
}); });
} }
function build_department_geojson(department: string) { async function build_department_geojson(department: string) {
let command = `ts-node convert_to_osm_tags.ts --department=${department}`; let command = `ts-node convert_to_osm_tags.ts --department=${department}`;
console.log('command', command) console.log('command', command)
exec_command(command) await exec_command(command)
} }
function convert_geojson_to_osm_for_department(department: string) { async function convert_geojson_to_osm_for_department(department: string) {
let command = `geojsontoosm output/my_converted_data_set_filtered_zipcode_${department}.json > osm_output/bornes-irve-filetered-from-etalab-opendata_dep_${department}.osm`; let command = `geojsontoosm output/my_converted_data_set_filtered_zipcode_${department}.json > osm_output/bornes-irve-filetered-from-etalab-opendata_dep_${department}.osm`;
console.log('command', command) console.log('command', command)
exec_command(command) await exec_command(command)
} }
for (let ii = 1; ii <= max_departement; ii++) { for (let ii = 1; ii <= max_departement; ii++) {
@ -48,8 +48,12 @@ let more_departements = ['2A', '2B'
more_departements.forEach((department => { more_departements.forEach((department => {
let departement_string = '' + department let departement_string = '' + department
build_department_geojson(departement_string) build_department_geojson(departement_string).then(r => {
convert_geojson_to_osm_for_department(departement_string) console.log('build_department_geojson', departement_string, r)
})
convert_geojson_to_osm_for_department(departement_string).then(r => {
console.log('convert_geojson_to_osm_for_department', departement_string, r)
})
})) }))

View File

@ -23,9 +23,9 @@ let mini_arguments: any = minimist(process.argv.slice(2))
// let sourceFilePathGeoJson = './etalab_data/small.json' // let sourceFilePathGeoJson = './etalab_data/small.json'
// let sourceFilePathGeoJson = './etalab_data/all.json' let sourceFilePathGeoJson = './etalab_data/all.json'
// let sourceFilePathGeoJson = './output/my_converted_data_set_filtered_zipcode_91.json' // let sourceFilePathGeoJson = './output/my_converted_data_set_filtered_zipcode_91.json'
let sourceFilePathGeoJson = './output/my_converted_data_set_filtered_zipcode_91_small.json' // let sourceFilePathGeoJson = './output/my_converted_data_set_filtered_zipcode_91_small.json'
// wip filter // wip filter
let filterOnBoundingBox = true let filterOnBoundingBox = true

View File

@ -0,0 +1,7 @@
/**
prendre un CSV,
examiner toutes les colonnes et leurs valeurs,
garder en mémoire les valeurs uniques de chaque colonne
faire un nouveau csv qui ne montre que les valeurs uniques pour chacune des colonnes
et qui compte le nombre de valeurs
**/