Open hannphry opened 2 years ago
Stations (Preisklassen, behindertengerecht, Parkplätze, Fahrradparkplätze, ÖPNV-Anschluss, Wieviele Stationen sind in welchen Bundesländern?)
export interface StationModel{ id: string, name: string, shortcut: string, lon: number, lat: number, type?: string, priceCategory ?: number, hasSteplessAccess ?: boolean, hasParking ?:boolean, hasBicycleParking ?:boolean, hasLocalPublicTransport ?:boolean, hasTaxiRank ?: boolean, hasCarRental ?: boolean, hasWiFi ?: boolean, federalState ?: string, stationManagement ?:string, has247service?: boolean }
Aktuell sind 4197 Bahnhöfe in der Datenbank
this.stationService.getStations().subscribe(data =>{
this.stations = data; //Unsere Bahnhofsstationen für die Komponente setzen
this.stationsByFederalState.splice(0,1); //Das erste Element für die Bundesländer und Stationen leeren, weil das erste nicht gebraucht wird
let stateStations: any[] = [];
console.log(this.stations);
this.federalStates.forEach(state=>{ //Jedes Bundesland im Bundesland-Array durchgehen
let tmpStations = this.stations.filter(obj=> obj.federalState == state ); //Die Stationen rausfiltern, die im richtigen Bundesland liegen
this.stationsByFederalState.push({ // Zu dem Objekt hinzufügen
federalState: state,
stations : tmpStations
});
//Wieviele davon haben ÖPNV-Anschluss?
let publicTransportStations = tmpStations.filter(obj => obj.hasLocalPublicTransport == true);
stateStations.push([state, tmpStations.length, publicTransportStations.length, (tmpStations.length - publicTransportStations.length)]);
});
this.comboChart.values = stateStations;
let priceCategoryStations: any[] = [];
this.priceCategories.forEach(category =>{
let tmpStations = this.stations.filter(station => station.priceCategory == category);
let taxiRankStations = tmpStations.filter(station => station.hasTaxiRank == true);
let stations247 = tmpStations.filter(station => station.has247service == true);
priceCategoryStations.push([category, tmpStations.length, taxiRankStations.length, stations247.length]);
})
this.steppedAreaChart.values = priceCategoryStations;
let stationTypeStations: any[] = [];
this.stationTypes.forEach(type =>{
let tmpStations = this.stations.filter(obj => obj.type == type);
let taxiRankStations = tmpStations.filter(station => station.hasTaxiRank == true);
let carRentalStations = tmpStations.filter(station => station.hasCarRental == true);
stationTypeStations.push([type, tmpStations.length, taxiRankStations.length, carRentalStations.length])
});
this.areaChart.values = stationTypeStations
//console.log(this.steppedAreaChart);
});
federalStates: string[] = [ "Bayern", "Baden-Württemberg", "Berlin", "Brandenburg", "Bremen", "Hamburg", "Hessen", "Mecklenburg-Vorpommern", "Niedersachsen", "Nordrhein-Westfalen", "Rheinland-Pfalz", "Saarland", "Sachsen", "Sachsen-Anhalt", "Schleswig-Holstein", "Thüringen" ]
priceCategories: number[] = [ 1, 2, 3, 4, 5, 6, 7 ];
stationTypes: string[] = [ "Knotenbahnhof", "Zubringerbahnhof", "S-Bahnhof", "Metropolbahnhof" ];
stationsByFederalState :[{ federalState: string, stations: Station[] }] = [{ federalState: "", stations: [] }];
comboChart: Chart = { title: 'Bundesländer', type: ChartType.ComboChart, options: { title : 'Anzahl Stationen mit ÖPNV-Anschluss', vAxis: {title: 'Anzahl'}, hAxis: {title: 'Bundesländer'}, seriesType: 'bars', series: {2: {type: 'line'}}, colors: [ '#aecbfc', //'#aedcfc', //'#aeeafc', '#aef2fc', //'#aefcf4', //'#aefce1', '#aefcc3' ],
},
columns: ['Bundesland','Stationen','ÖPNV', 'Differenz'],
values: []
}
steppedAreaChart: Chart= { title: 'Anzahl Stationen mit Taxi und 24/7 Service nach Preisklasse', type: ChartType.SteppedAreaChart, options: { colors: [ '#aecbfc', //'#aedcfc', //'#aeeafc', '#aef2fc', //'#aefcf4', //'#aefce1', '#aefcc3' ], }, columns: ['Preisklasse','Anzahl Stationen','Mit Taxi','24/7-Service'], values: [] }
areaChart: Chart = { title: 'Mit Taxi und Mietwagen nach Bahnhofstypen', type: ChartType.AreaChart, options: { //isStacked: true, colors: [ '#aecbfc', //'#aedcfc', //'#aeeafc', '#aef2fc', //'#aefcf4', //'#aefce1', '#aefcc3' ], }, columns: ['Anzahl','Typ', 'Anzahl Mit Taxi','Anzahl mit Mietwagen'],
Neue Ideen für Graphen:
[ ] 1:
Übersicht über alle Bahnhöfe mit Preisklassen
Dann DropDown und Auswahl einer Preisklasse
[ ] 2:
Dann für eine Preisklasse Verteilung auf Bundesländer anzeigen
Ein Bundesland auswählen
[ ] 3:
Dann in letzter Suchfunktion über alle Bahnhöfe
Station auswählen
anhand von 4 Klassen Menge an Stationen im Umfeld der ausgewählten Station
[ ] 4:
Infos einer Station anzeigen Eine Station
Hier kann ich parken, wieviel % der Stationen kann ich Fahrrad und Auto parken
Hier ist 24h Service
Hier kriege ich ein Taxi
Dies gehört zu dieser Preiskategorie (wieviele sind's insgesamt)
Unterschiede in Längen und Breitengraden:
Kassel - München ~400 km Luftlinie Differenz Lat (Breitengrade) : 2,068834 Differenz Lon (Längengrade) : -3,178028
Kleinere Änderungen:
Angular Component: Stations