up csv irve
This commit is contained in:
parent
1f6c0a4598
commit
f448f40c92
1
data_other/.~lock.irve_osm_2023-08-30.csv#
Normal file
1
data_other/.~lock.irve_osm_2023-08-30.csv#
Normal file
@ -0,0 +1 @@
|
||||
,tykayn,spaceship,31.08.2023 23:15,file:///home/tykayn/.config/libreoffice/4;
|
File diff suppressed because it is too large
Load Diff
375565
data_other/irve_osm_2023-08-30.geojson
Normal file
375565
data_other/irve_osm_2023-08-30.geojson
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
;variance de ./etalab_data/toilettes/small.csv;généré le:;Fri Aug 18 2023 13:39:11 GMT+0200 (heure d’été d’Europe centrale);lignes du csv original:;10;fait avec make_variance_from_csv.ts de Tykayn
|
||||
;variance de ./etalab_data/toilettes/small.csv;généré le:;Thu Aug 31 2023 23:08:07 GMT+0200 (heure d’été d’Europe centrale);lignes du csv original:;10;fait avec make_variance_from_csv.ts de Tykayn
|
||||
;TYPE;STATUT;ADRESSE;ARRONDISSEMENT;HORAIRE;ACCES_PMR;RELAIS_BEBE;URL_FICHE_EQUIPEMENT;geo_shape_1;geo_shape_2;geo_point_2d_1;geo_point_2d_2
|
||||
;3;1;9;7;4;2;3;7;9;9;9;9
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ let mini_arguments: any = minimist(process.argv.slice(2))
|
||||
// }
|
||||
|
||||
let csv_content = 'variance de dataset\n';
|
||||
let separator = ',';
|
||||
let separator = '\t';
|
||||
let separator_fallback = ';';
|
||||
let data_variance: any = {};
|
||||
|
||||
@ -28,6 +28,11 @@ let fileNameOutput = `variance_${inputFile}`;
|
||||
let inputPath = `./etalab_data/${folder}/${inputFile}`
|
||||
// let inputPath = './etalab_data/toilettes/small_datas.csv'
|
||||
let outputPath = `etalab_data/${folder}`
|
||||
|
||||
console.log('mini_arguments', mini_arguments)
|
||||
if (mini_arguments['inputFile']) {
|
||||
inputFile = `${mini_arguments['input-file']}`
|
||||
}
|
||||
if (mini_arguments['source']) {
|
||||
inputPath = mini_arguments['source']
|
||||
}
|
||||
@ -47,7 +52,6 @@ function getColumnsFromRow(row: string) {
|
||||
return headings
|
||||
}
|
||||
|
||||
console.log('open file ', inputPath)
|
||||
|
||||
/**
|
||||
* sort unique values ascending in each column
|
||||
@ -58,8 +62,9 @@ function reorderValuesInDataVariance() {
|
||||
})
|
||||
}
|
||||
|
||||
fs.readFile(inputPath, function (err: any, fileData: any) {
|
||||
|
||||
console.log('read file ', inputPath)
|
||||
fs.readFile(inputPath, function (err: any, fileData: any) {
|
||||
if (err) {
|
||||
throw new Error(err)
|
||||
} else {
|
||||
@ -78,14 +83,14 @@ fs.readFile(inputPath, function (err: any, fileData: any) {
|
||||
|
||||
if (lines_count === 0) {
|
||||
console.log('line', line)
|
||||
if(line.indexOf(separator) === -1){
|
||||
if (line.indexOf(separator) === -1) {
|
||||
console.log('separator not found: ', separator, 'trying other separator')
|
||||
if(line.indexOf(separator_fallback) === -1){
|
||||
if (line.indexOf(separator_fallback) === -1) {
|
||||
console.log('separator not found: ', separator_fallback)
|
||||
|
||||
throw new Error('no separator found in csv')
|
||||
|
||||
}else{
|
||||
} else {
|
||||
console.log('fallback separator found: ', separator_fallback, 'now using it ')
|
||||
separator = separator_fallback
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
"scripts": {
|
||||
"start": "ts-node convert_to_osm_tags.ts --engine",
|
||||
"departments": "ts-node build_departments.ts",
|
||||
"variance": "ts-node make_variance_from_csv.ts",
|
||||
"variance": "ts-node make_variance_from_csv.ts --source=data_other/irve_osm_2023-08-30.csv",
|
||||
"example": "ts-node convert_to_osm_tags.ts --engine=true --department=974 --source=\"./etalab_data/irve_bornes_recharge/all.json\"",
|
||||
"irve": "ts-node convert_to_osm_tags.ts --engine=true --source=\"./etalab_data/irve_bornes_recharge/all.json\"",
|
||||
"irve:up": "bash get_irve.sh && ts-node convert_to_osm_tags.ts --engine=true --source=\"./data_other/irve_osm_2023-08-30.geojson\"",
|
||||
|
@ -1 +1 @@
|
||||
[out:csv(::id,::lon,::lat,capacity,name,ref,phone,contact)][timeout:25];area(id:3600007401)->.searchArea;(node["amenity"="charging_station"](area.searchArea););out meta;>;out meta qt;
|
||||
[out:csv(::id,::uid,::user,::changeset,::lon,::lat,'addr:postcode','addr:city',covered,layer,charging_type,'current:ac','current:dc','charging_station:output',capacity,voltage,amperage,socket,'note:location',access,charging_type,name,owner,network,operator,'operator:wikidata','operator:wikipedia','owner:ref:FR:SIREN',ref,'ref:EU:EVSE','email','contact:email','contact:phone',phone,contact,'socket:typee','socket:schuko','socket:type1','socket:type2','socket:type2:output','socket:type2_cable','socket:type2_combo','socket:type2_combo:output','socket:type3c','socket:type3c:output','socket:chademo','socket:chademo:output',fee,charge,'payment:contactless','parking:fee','payment:app','payment:credit_cards',reservation,authentication,'authentication:nfc','authentication:membership_card','authentication:none',bicycle,scooter,bus,hgv,motorcar,wheelchair,'survey:date',start_date,opening_hours,source,wikidata,description,note,fixme,shop,mapillary,panoramax)][timeout:25];area(id:3602202162)->.searchArea;(node["amenity"="charging_station"](area.searchArea););out meta;>;out meta qt;
|
@ -1 +1 @@
|
||||
[out:json][timeout:25];area(id:3600007401)->.searchArea; (node["amenity"="charging_station"](area.searchArea);); out center;
|
||||
[out:json][timeout:25];area(id:3602202162)->.searchArea; (node["amenity"="charging_station"](area.searchArea);); out center;
|
@ -1,11 +1,15 @@
|
||||
#!/bin/bash
|
||||
echo "récupérer les bornes de recharge en Essonne"
|
||||
overpass_website="https://overpass-api.de/api/interpreter"
|
||||
# personnaliser les scripts:
|
||||
# aire Essonne: id 3600007401
|
||||
# aire IDF: id 3600008649
|
||||
# aire FR: id 3602202162
|
||||
|
||||
curl --header "Content-Type: plain/text" --data @content_irve_geojson.txt --trace-ascii website-data.log "$overpass_website" > ../data_other/irve_osm_2023-08-30.geojson
|
||||
curl --header "Content-Type: plain/text" --data @content_irve_csv.txt --trace-ascii website-data.log "$overpass_website" > ../data_other/irve_osm_2023-08-30.csv
|
||||
|
||||
du -sch ../data_other/irve_osm_2023-08-30.geojson
|
||||
#du -sch ../data_other/irve_osm_2023-08-30.geojson
|
||||
du -sch ../data_other/irve_osm_2023-08-30.csv
|
||||
|
||||
rm website-data.log
|
Loading…
Reference in New Issue
Block a user