Synopsis

The basic geo-data set for public transport stops comprises public transport stops in Switzerland and additional selected geo-referenced public transport locations that are of operational or structural importance (operating points).

The data can be downloaded here

Data processing

Loading

data <- read.csv("PointExploitation.csv")

Short analysis

dim(data)
## [1] 26109    19
names(data)
##  [1] "xtf_id"                 "Numero"                
##  [3] "Nom"                    "Abreviation"           
##  [5] "RespDonneesAbreviation" "NumeroET"              
##  [7] "AbreviationET"          "TypePointExploitation" 
##  [9] "MoyenTransport"         "Altitude"              
## [11] "NumeroCommune"          "NomCommune"            
## [13] "DebutValidite"          "FinValidite"           
## [15] "DateTraitement"         "Etat"                  
## [17] "rArretSuperieur"        "y_Coord_Est"           
## [19] "x_Coord_Nord"
table(data$MoyenTransport)
## 
##                                                   Ascenseur 
##                            11                             2 
##                        Bateau   Bateau_CheminFerCremaillere 
##                           327                             1 
##                           Bus                 Bus_CheminFer 
##                         20950                           259 
##          Bus_Funiculaire_Tram                     Bus_Metro 
##                             1                            16 
##              Bus_Telepherique                      Bus_Tram 
##                             3                           379 
##            Bus_Tram_CheminFer                     CheminFer 
##                             2                          2582 
##                CheminFer_Tram          CheminFerCremaillere 
##                             4                            76 
##                   Funiculaire               Funiculaire_Bus 
##                           138                             4 
##         Funiculaire_CheminFer      Funiculaire_Telepherique 
##                             2                             7 
##                         Metro               Metro_CheminFer 
##                            16                             1 
##                  Telepherique        Telepherique_CheminFer 
##                          1023                             1 
##                          Tram Tram_Bus_CheminFerCremaillere 
##                           303                             1

Coordinate transformation

The locations of the stops are provided using the CH1903 Swiss coordinate system. A mathematical transformation has to be applied since GPS (WGS84) coordinates are required for the plotting.

The source code for the transformation in R language is here

source("WGS84_CH1903.R")

Cleaning

Cleanup of column names, selection of meaningful columns and conversion of coordinates.

df <- data %>% 
    select(Nom, MoyenTransport, y_Coord_Est, x_Coord_Nord) %>% 
    mutate(Stop=Nom, Kind=MoyenTransport,
           Latitude=CH.to.WGS.lat(y_Coord_Est, x_Coord_Nord), 
           Longitude=CH.to.WGS.lng(y_Coord_Est, x_Coord_Nord)) %>% 
    select(-MoyenTransport, -Nom, -y_Coord_Est, -x_Coord_Nord)
head(df)
##                                             Stop         Kind
## 1                          Schwellbrunn, Hohrain          Bus
## 2                                    Obers\xe4ss Telepherique
## 3 Biel/Bienne, Brunnenplatz/Place de la Fontaine          Bus
## 4                         Langenthal West (Abzw)    CheminFer
## 5                       Lantsch/Lenz, Vischnanca          Bus
## 6                          Cortaillod, C\xe2bles          Bus
##                Latitude             Longitude
## 1 47.357022272661566831 9.2558785247876862456
## 2 46.865400825557351538 9.8092532160005188047
## 3 47.138464367516135667 7.2448349766471595856
## 4 47.212894848550540416 7.7582453048510728877
## 5 46.685766730077574493 9.5629675109465264171
## 6 46.945113093260232517 6.8580823634777416942

Data plotting

Funicular stops

df %>% 
    select(-Stop) %>% 
    filter(Kind=='Funiculaire') %>%
    leaflet() %>%
    addTiles() %>%
    addCircleMarkers(clusterOptions = markerClusterOptions())

Cableway stops

df %>% 
     select(-Stop) %>% 
     filter(Kind=='Telepherique') %>%
     leaflet() %>%
     addTiles() %>%
     addCircleMarkers(clusterOptions = markerClusterOptions())