move wip, update datasets
This commit is contained in:
parent
ecdcebfddb
commit
b4ce86322a
@ -1 +0,0 @@
|
||||
,cipherbliss,nova,01.03.2024 14:59,file:///home/cipherbliss/.config/libreoffice/4;
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
@ -1,55 +0,0 @@
|
||||
import fs from "fs";
|
||||
import * as path from "path";
|
||||
|
||||
const stations = [
|
||||
{
|
||||
id: 1,
|
||||
name: 'Tesla Supercharger',
|
||||
address: '123 Main St',
|
||||
lat: 37.7749,
|
||||
lon: -122.4194,
|
||||
network_operator: 'Tesla'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Electrify America',
|
||||
address: '456 Maple Ave',
|
||||
lat: 40.7128,
|
||||
lon: -74.0060,
|
||||
network_operator: 'Electrify America'
|
||||
},
|
||||
{id: 3, name: 'ChargePoint', address: '789 Oak St', lat: 34.0522, lon: -118.2437, network_operator: 'ChargePoint'},
|
||||
];
|
||||
|
||||
interface Station {
|
||||
[key: string]: string
|
||||
}
|
||||
|
||||
function groupStationsByNetworkOperator(stations: Station[]): Map<string, Station[]> {
|
||||
const groups
|
||||
= new Map<string, Station[]>();
|
||||
|
||||
for (const station of stations) {
|
||||
if (!groups.has(station.properties.network_operator)) {
|
||||
groups.set(station.properties.network_operator, []);
|
||||
}
|
||||
|
||||
groups.get(station.properties.network_operator)!.push(station);
|
||||
}
|
||||
|
||||
return groups;
|
||||
}
|
||||
|
||||
|
||||
function groupStationsByNetworkOperatorAndWriteToFiles(stations: any[], outputDir: string): void {
|
||||
const groups = groupStationsByNetworkOperator(stations);
|
||||
|
||||
for (const [networkOperator, stationsForOperator] of groups.entries()) {
|
||||
const fileName = `${networkOperator}.json`;
|
||||
const filePath = path.join(outputDir, fileName);
|
||||
|
||||
fs.writeFileSync(filePath, JSON.stringify(stationsForOperator, null, 2));
|
||||
}
|
||||
}
|
||||
|
||||
groupStationsByNetworkOperatorAndWriteToFiles(stations, "output")
|
313415
mappings/extractors/irve_zone_france_from_openstreetmap.json
Normal file
313415
mappings/extractors/irve_zone_france_from_openstreetmap.json
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
35
wip/irve_split_by_operators_from_json.ts
Normal file
35
wip/irve_split_by_operators_from_json.ts
Normal file
@ -0,0 +1,35 @@
|
||||
const stations = [
|
||||
{
|
||||
id: 1,
|
||||
name: 'Tesla Supercharger',
|
||||
address: '123 Main St',
|
||||
lat: 37.7749,
|
||||
lon: -122.4194,
|
||||
network_operator: 'Tesla'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Electrify America',
|
||||
address: '456 Maple Ave',
|
||||
lat: 40.7128,
|
||||
lon: -74.0060,
|
||||
network_operator: 'Electrify America'
|
||||
},
|
||||
{id: 3, name: 'ChargePoint', address: '789 Oak St', lat: 34.0522, lon: -118.2437, network_operator: 'ChargePoint'},
|
||||
];
|
||||
|
||||
interface Station {
|
||||
[key: string]: string
|
||||
|
||||
}
|
||||
|
||||
function groupStationsByNetworkOperator(stations: Station[]) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
function groupStationsByNetworkOperatorAndWriteToFiles(stations: any[], outputDir: string) {
|
||||
|
||||
}
|
||||
|
||||
groupStationsByNetworkOperatorAndWriteToFiles(stations, "output")
|
Loading…
x
Reference in New Issue
Block a user