remove wips

This commit is contained in:
Tykayn 2024-10-27 10:14:32 +01:00 committed by tykayn
parent 53075a642f
commit fe05c2c929
10 changed files with 13 additions and 62 deletions

View File

@ -2,7 +2,7 @@
"version": 0.6,
"generator": "Overpass API 0.7.62.1 084b4234",
"osm3s": {
"timestamp_osm_base": "2024-10-26T20:36:18Z",
"timestamp_osm_base": "2024-10-27T08:43:29Z",
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
},
"elements": [

View File

@ -2,8 +2,8 @@
"version": 0.6,
"generator": "Overpass API 0.7.62.1 084b4234",
"osm3s": {
"timestamp_osm_base": "2024-10-26T20:38:25Z",
"timestamp_areas_base": "2024-10-26T17:31:45Z",
"timestamp_osm_base": "2024-10-27T08:47:35Z",
"timestamp_areas_base": "2024-10-27T04:53:30Z",
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
},
"elements": [

View File

@ -20,21 +20,21 @@ extract_from_osm(){
jq '.elements | length' "$export_file.json"
# on garde la version OSM brute des données extraites
cp "$export_file.json" "../osm_output/$export_file.osm.json"
cp "$export_file.json" "../../osm_output/$export_file.osm.json"
# on convertir en geojson
osm2geojson -q -i 2 --reader json "$export_file.json" "$export_file.geojson" -f
echo -e "\n -> fichier converti: $export_file.geojson "
# on déplace dans le dossier osm_output les versions brutes et converties
mv "$export_file.geojson" "../osm_output/$export_file.geojson"
echo " -> fichier placé dans ../osm_output/$export_file.geojson "
mv "$export_file.geojson" "../../osm_output/$export_file.geojson"
echo " -> fichier placé dans ../../osm_output/$export_file.geojson "
# on convertit le geojson en csv
python3 geojson_to_csv.py "../osm_output/$export_file.geojson" -o "../osm_output/$export_file.csv"
python3 geojson_to_csv.py "../../osm_output/$export_file.geojson" -o "../../osm_output/$export_file.csv"
rm "$export_file.json"
echo "nombre de features dans l'export geojson :"
jq '.features | length' "../osm_output/$export_file.geojson"
jq '.features | length' "../../osm_output/$export_file.geojson"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
faire un nouveau csv qui ne montre que les valeurs uniques pour chacune des colonnes
et qui compte le nombre de valeurs
**/
import utils from './mappings/utils'
import utils from '../mappings/utils'
import {parse} from 'csv'
const fs = require('fs')
@ -33,60 +33,19 @@ fs.readFile(inputPath, function (err: any, fileData: any) {
throw new Error(err)
} else {
parse(fileData, {columns: false, trim: true}, function (err: any, rows: any) {
// Your CSV data is in an array of arrays passed to this callback as rows.
if(err){
throw new Error(err)
}
console.log('line ', lines_count)
console.log('rows', rows)
// rows.forEach((row: Array<any>) => {
//
//
// if (lines_count === 0) {
// // console.log('elem', row)
// row.forEach((value: string) => {
// // console.log('value', value)
// columns_headings.push(value)
// data_variance[value] = []
// })
// console.log('columns_headings.length', columns_headings.length)
// lines_count++
// } else {
// // lignes suivantes
//
// let column_index = 0;
//
//
// row.forEach((value: string) => {
// value = value.trim()
// // dans chaque colonne, vérifier que la valeur n'est pas déjà présente dans les index de variance
// // si la valeur est nouvelle, l'ajouter
// if (data_variance[columns_headings[column_index]].indexOf(value) < 0) {
// data_variance[columns_headings[column_index]].push(value)
// if (
// data_variance[columns_headings[column_index]].length > longest_variance_count
// ) {
// longest_variance_count = data_variance[columns_headings[column_index]].length
// }
//
// }
// column_index++
// })
// lines_count++
// }
// })
console.log('longest_variance_count', longest_variance_count)
// utils.writeFile('variance.csv', writeCSVVariance())
})
}
console.log('parsing done')
// console.log('data_variance', data_variance)
})
/**

File diff suppressed because one or more lines are too long

View File

@ -1,3 +0,0 @@
console.log('convert csv to geojson file')
console.log('TODO')

View File

@ -1,2 +0,0 @@
console.log('hello mapper')