Dear Visitors:

Please scroll down the page to see present and archive blogs.

Thank you very much: Tramway Null(0)

Webrings - Maps - Trolleys and More

Navigation by WebRing.

Thursday, January 17, 2019

Interesting article about Battery Buses vs Trolleybuses with In Motion Charging

Excellent Article.   Perhaps there is some hope for trolleybuses after all.    Interesting, as stated in the article, that officials in California do not have respect for trolleybuses?  How will weak battery buses get up those San Francisco hills during a cold snap?

The Verdict's Still Out on Battery-Electric Buses

Monday, December 31, 2018

In Motion Charging: Part II

In my previous blog about In Motion Charging, I gave a brief introduction to the subject.   I am a lazy researcher, but looking over some documents, I got a better view of the subject.   The basics are that a bunch of cities, worldwide, basically the transportation organizations, will no longer buy buses that run on carbon fuels in order to protect the environment.   The type of buses desired are battery powered, that may require recharging at some point in the day.   Thus we can see that battery powered buses are not perfect.   In fact, to get a battery to do a heavy job of transporting passengers has been under research for at least 100 years.  Some streetcars in Manhattan were light and battery powered.  I am not sure if those cars were recharged or that a new battery was slipped in.  Move forward 100 years and it seems now, that for smaller buses, on infrequent trips, the units work well but some time must be spent in recharging;  perhaps at night or at bus stops by raising a device to the re-charging pole.  But what happens for bus routes that are very busy, carry a lot of passengers and use air-conditioning and perhaps are articulated into two or three units?   It seems that for some routes, the buses cannot spend excessive time in recharging mode for economic and logistic reasons.  In the literature, IMC for trolley buses was discussed as a solution because while the bus is under the wired portion of the route, the battery can be re-charged.   It seems to me that the literature is talking about existing trolley bus systems where IMC can extend a route and cut down on recharge time.  It is not clear if the literature is talking about brand new trolley buses systems with route length extensions  that are wireless.   The question is:  Can battery buses handle summer loads with recharging down  time?   Is the trolleybus with IMC electronics considered an alternative for cities that currently do not have trolleybuses?  If these battery buses can handle crush loads with recharging time that is reasonable, the trolleybus will be in trouble.  If the only solution is IMC trolleybuses, can the world cities afford to build trolley bus systems from scratch?  How long would it take?  And as a aside, can a city with new trolleybus overhead use it  for trolley trucks (e-highway?).  I think that this would be a good investment for a city.  So far, I do not see a movement to build new trolleybus systems.

Just my opinion.
Tramway Null()

Sunday, December 23, 2018

In Motion Charging: Can this save the traditional trolleybus?

Hi Folks:

  Sorry not to have added a new entry recently into this blog.  In New York City, nothing is much happening from my viewpoint.  The Brooklyn Queens light rail is decades away, if it should be built.  There are new deliveries of R-179 cars.   I was on one last week on the "C" train and I believe the number of the car was 3136?   The car that I was in had no advertising cards set up and the only difference that I noticed between the R 179 and perhaps the R 160 was that the door indicator light was somewhat different with a flatter lens.   Last week, California and perhaps several other states said that they will no longer purchase diesel buses or other type of similar buses and will use instead battery buses.  No mention was made of trolley buses.   It it known that battery buses are not perfect and that they have to be charged for a certain amount of time.  Could a busy bus route, with crowds of passengers on a hot summer day, with hills be handled by a battery bus?   It was pointed out by some, and I am sorry that I do not have a link, that perhaps In Motion Charging could solve the problem.  IMC would be a battery bus that has trolley poles and that a portion of the route would be under wire.   When the trolleybus is under wire, the batteries can be charged and the trolley - battery bus can complete the balance of the route without wires.   I believe the technology for this exists already.   In the next several months or years, this and other factors will determine if trolley bus systems can survive.   If battery buses cannot handle the load, and hills and ice, perhaps new trolleybus systems can be developed where part of the journey is wireless.  I would like the two former routes in South Philly to be reinstated with TB's , if the battery bus experiments fail.   IMC will be ideal where several bus routes share a street and later branch out.   The common street can have the overhead.  One group even suggested that some bus routes in downtown Brooklyn that run on Fulton Street can be a candidate for this technology.

Let us see what happens,

Tramway Null(0)

See "Pedestrian Observations" 2018 /12/9  In-Motion Charging
See their opinion about Boston and even Brooklyn!

I do not find the situation where a bus raises a pantograph for recharging at a bus stop interesting from a rail buff standpoint.  Here, I believe they are talking about a regular trolleybus with traditional overhead.  The line can be extended without wires.   All the time the bus is under wires the batteries will be recharged more efficiently that recharging and losing time at bus stops.  InEurope, I believe there are units operating under this mode.  If the battery buses can be recharged fast while caring big loads in the summer, the trolleybus is dead.
  According to Canada's "National Observer", trolley:motion, an organization that promotes the use of trolleybuses is help conducting an experiment in converting a regular battery bus to a trolley bus to be used on demanding routes.   If this experiment is a success, Trolley:Motion will help electric battery bus companies offer a bus with optional trolley poles for in motion charging.  This is wonderful.

In my opinion, it is a good for a city to have a few sets of overhead wires for trolleybus lines.  How about using them for trolley trucks?    What I see from videos from Siemans E-highway, the overhead is very different, but let us give it a try.  If many bus companies offer buses with trolley poles, perhaps more cities will consider battery buses with In Motion Charging with wires for a major part of the route, and thus, the trolleybus is saved.

Tuesday, November 13, 2018

Plotting Japanese Railways: Source: R Blog

Hi folks:

 I ran into this posting in R-Bloggers for 11/9/18 by "R on Chi's Impe[r]fect blog.   I just looked at it for a few moments and it should be of interest to "R" users, map makers and railway fans form all over.   The code looks complicated but the diagrams are great.   I hope this helps someone.   Will eventually get to look at the code.

Voronoi diagram with ggvoronoi package with Train Station data

November 9, 2018
(This article was first published on R on Chi's Impe[r]fect Blog, and kindly contributed to R-bloggers)

I’ve always been curious to make Voronoi diagram, I just think they are beautiful! When I came across data set with train stations in Japan. I instantly thought this would be great data sets to make Voronoi diagram! I’ve gotten data sets from (Ekidata)[] site. I’m amazed how many train stations we have in Japan, as well as coverage of train systems in Japan.
There are couple of packages I could’ve used to make Voronoi diagram, but I’ve utilized package ggvoronoi. I really like using “outline” inside of geom_voronoi function to mask out the shape! (Which I wasn’t sure how to do before using deldir package).

Voronoi Diagram with Train Station as a seed.

ggvoronoi makes it easy to plot voronoi diagram! All I really needed to produce voronoi diagram was longitude & latitude.
Initially I’ve plotted all the train station as a point (using geom_point), you can see that station will reveal shape of Japan, as JR (Japan Railway) really covers coast line of Japan. There are total of 10828 points, as there were 10828 stations listed in most recent data set downloaded today.
I also used treemap package to create treemap.
I’ve colour coded rectangle inside of treemap with company types. 47% of 10K+ stations are JR Japan Railway stations in Japan.
Tokyo (area: 2,188 has 943 stations all together, followed by Hokkaido 650 stations, but Hokkaido is the biggest prefecture in terms of area (83,456.87 . It would be interesting to get area data for each prefecture, so we can calculate stations per area.
jp <- ggplot2::map_data('world2', region='japan')
names(jp) <- c("lon","lat", "group","order","region","subregion")
## for train, I'm going to tidy up the map bit. (I've excluded Okinawa for now)
jp_outline <- jp %>% filter(subregion %in% c("Honshu","Hokkaido","Kyushu","Shikoku"))

## I also wanted prefecture level data, so I've used map data from mapdata package.
jp_outline_detailed <- map_data("japan")

## station_master lists all stations of all lines
plotPoints <-station_master %>%
  ggplot(aes(x=lon, y=lat)) +
  theme_void(base_family="Roboto Condensed") +
  geom_polygon(data=jp_outline, aes(group=group), fill="#ffffff", color="#33333380") +
  geom_point(aes(color=pref_cd),size=0.1, alpha=0.8) +
  scale_color_viridis_c(end=0.5, guide="none") +
  labs(title="Each Train Station as a point") +

## station_master2 is reduced version of station_master
plotVoronoi <-station_master2 %>%
  ggplot(aes(x=lon, y=lat)) +
  theme_void(base_family="Roboto Condensed") +
  geom_polygon(data=jp_outline, aes(group=group), fill="#ffffff00", color="#33333380") +
  geom_path(stat="voronoi", size=0.1, aes(color=pref_cd)) +
  coord_quickmap() +
  scale_color_viridis_c(end=0.5, guide="none") +
  labs(title="Voronoi Diagram with station as a seed")

## use patchwork package to plot 2 plots side by side
plotPoints + plotVoronoi

## All of Japan - Takes long time to draw on my machine.
station_master2 %>% 
  ggplot(aes(x=lon, y=lat)) +
  theme_void(base_family="Hiragino Sans W5") +
  geom_voronoi(aes(fill=station_cnt),size=0.05, color="#ffffff", 
               outline=jp_outline) + ## this outline feature is awesome!
  coord_quickmap() +
  scale_fill_viridis_c(end=0.8, option="magma", guide="none") 

Treemap with treemap package

With treemap, I can easily see which prefecture has more stations. Also I wanted to see which railway company are dominant in each prefecture.
## Treemap to see which prefecture has more stations.
station_master %>% 
  count(pref_name,company_type_descr,company_name_r) %>%
  add_count(pref_name,wt=n) %>%
  mutate(pref_descr = paste(pref_name,":",nn,"駅")) %>%
          vSize="n", vColor="company_type_descr", type="categorical",
          fontfamily.labels="Hiragino Sans W3",
          title="Number of Stations by Prefecture\ncoloured by operating company types")

Writing Function to Plot Prefecture Level Voronoi

There are 47 prefectures in Japan. So I’ve decided to write function to draw voronoi as below. I think below can be simplified…, but for now it does the job…
## function to draw voronoi map at prefecture level
draw_pref <- function(pref_no=1,zoom=T,save_file=F,folder_name="prefecture",...){
  region <- prefs %>% filter(pref_cd==pref_no) %>% pull(pref_name_en)
  region_jp <- prefs %>% filter(pref_cd==pref_no) %>% pull(pref_name) 
  pref_summary  <- station_master %>% 
    filter(pref_cd==pref_no) %>% 
              line_cnt =n_distinct(line_name), 
  tmp_df <- station_master2 %>% filter(pref_cd==pref_no)
  pref_outline <- map_data("japan", region=region)
  capital <-jpnprefs %>% mutate(pref_cd=row_number()) %>% filter(pref_cd==pref_no)
  ## calculate distance between capital city & each station so i can colour the cell of voronoi.
  tmp_df <- tmp_df %>%
    mutate(dist_from_capital = 
             sqrt((lon-capital$capital_longitude)^2 + (lat-capital$capital_latitude)^2))
  # finding bounding box from train station data... , so I can crop the map if I want to.
  bbox <-tmp_df  %>% ungroup() %>% 
    summarise(xmax=max(lon), xmin=min(lon), ymax=max(lat), ymin=min(lat))
  base_map <-tmp_df %>% ggplot(aes(x=lon,y=lat)) +
    theme_void(base_family="Hiragino Sans W5") +
    #geom_voronoi(aes(fill=comp_cd_min) ,size=0.1, color="#ffffff", 
    #           outline=pref_outline) +
    geom_voronoi(aes(fill=dist_from_capital) ,size=0.1, color="#ffffff", 
               outline=pref_outline) +
    #scale_fill_gradientn(colors = c("#440154FF","#000000FF","#31688EFF", "#1F9E89FF","#6DCD59FF"),
                       #breaks=c(0,7,30,100,200), limits=c(1,250), guide="none") +
    scale_fill_viridis_c(end=0.9, guide="none", option="magma") +
    labs(title=paste0(region_jp," (",region,")"), 
         caption=paste0("Capital City of ",region," is ",capital$capital, " @ (",
                        round(capital$capital_longitude,2),",", round(capital$capital_latitude,2),")"),
                       pref_summary$line_cnt," lines operated by", 
                       pref_summary$company_count, "companies in", 
                       str_to_title(region))) +
    geom_point(data=capital, aes(x=capital_longitude, y=capital_latitude),shape=4, color="#ffffff") 
  if (zoom) {
    print(base_map + 
    } else {
    print(base_map + coord_quickmap())
                  formatC(pref_no, width=2,flag="0"),"-",str_to_lower(region),".png"),

## function to draw treemap at prefecture level
draw_treemap <- function(pref_no=1,...){
  station_master$color <- 
  title_text <- prefs %>% filter(pref_cd==pref_no) %>% pull(pref_name_en)
  station_master %>% 
    filter(pref_cd==pref_no) %>%
    count(company_type_descr,company_name_r,line_name,color,station_name) %>%
            vSize="n", vColor="color", type="color",
            fontfamily.labels="Hiragino Sans W3",
            fontfamily.title="Roboto Condensed",
            border.lwds = c(3,2,1,0.2),
            title.legend="", title="",
            aspRatio = 16/9)


While it’s interesting to see Voronoi map of Japan, I wanted to zoom into selected prefectures that I care maybe more about.
Firstly, Tokyo. I love looking at Tokyo’s train map such as this one. JR East Route Map PDF.
For below voronoi diagram, I’ve decided to colour the voronoi cell with distance from Shinjuku (capital city of Tokyo) to corresponding station cell. (I actually think it’s more interesting to get train usage data, and colour the cell with train usage data, but because there are so many different operating company, getting data about train usage seemed like pretty hard task to do…)
I like how dense train staions are packed around central tokyo (east side), but as you go towards the west, cell becomes bigger and bigger. In fact, far west side of Tokyo, there are NOT that many stations at all.
I’ve also created treemap for Tokyo below. Personally I was surprised that there are maybe more Tokyo metro stations than JR stations in Tokyo. I’ve also came to realize that there are so many companies…
draw_pref(13, zoom=T, save_file=F)


station_master %>% 
  filter(pref_cd==13) %>%
  arrange(e_sort) %>%
  ggplot(aes(x=lon, y=lat)) +
  geom_sf(data=jpn_pref(13), inherit.aes=F, color="#33333320") +
  geom_point(aes(color=company_name_r, shape=company_type_descr), alpha=0.8) +
        axis.title=element_blank()) +
  theme_minimal(base_family="Hiragino Sans W5") +
  geom_text_repel(data=station_master2 %>% filter(pref_cd==13 & station_cnt>6), 
            family="Osaka", min.segment.length=0, nudge_x=0.25, segment.color="#33333350") +
  scale_color_hue(l=45) +
  coord_sf(ylim=c(35.5,35.9), xlim=c(138.8,139.9)) ## to remove islands of Tokyo

Plotting Kanagawa Prefecture

Kanagawa prefecture is where Yokohama, Also where one of my favourite place, Kamakura is. I like the shape of prefecture, as it sort of looks like a dog?! Maybe camel?!
Capital city of Kanagawa prefecture is Yokohama, and I’ve again coloured cell based on distance from Yokohama. Similar to Tokyo, east side of Kanagawa has a lot of stations but west side is pretty sparse.
draw_pref(14, zoom=T, save_file=F)


## See Station in Kanagawa
station_master %>% 
  filter(pref_cd==14) %>%
  arrange(e_sort) %>%
  ggplot(aes(x=lon, y=lat)) +
  geom_sf(data=jpn_pref(14), inherit.aes=F, color="#33333320") +
  geom_point(aes(color=company_name_r, shape=company_type_descr), alpha=0.8) +
        axis.title=element_blank()) +
  theme_minimal(base_family="Hiragino Sans W5") +
  geom_text_repel(data=station_master2 %>% filter(pref_cd==14 & station_cnt>3), 
            family="Osaka", min.segment.length=0, nudge_x=0.25, segment.color="#33333350") +

Plotting Chiba Prefecture

Chiba is where Narita Airport is. I just had to plot it out, because I like the shape of prefecture 🙂 It looks like a hummingbird to me, but Chiba prefecture actually have a maskot called Chi-ba-kun, and it’s a dog character.
draw_pref(12, zoom=T, save_file=F)


## See Station in Chiba
station_master %>% 
  filter(pref_cd==12) %>%
  arrange(e_sort) %>%
  ggplot(aes(x=lon, y=lat)) +
  geom_sf(data=jpn_pref(12), inherit.aes=F, color="#33333320") +
  geom_point(aes(color=company_name_r, shape=company_type_descr), alpha=0.8) +
        axis.title=element_blank()) +
  theme_minimal(base_family="Hiragino Sans W5") +
  geom_text_repel(data=station_master2 %>% filter(pref_cd==12 & station_cnt>3), 
            family="Osaka", min.segment.length=0, nudge_x=0.25, segment.color="#33333350") +

Bonus: Plotting Hokkaido Prefecture

Hokkaido is the largest prefecture in Japan, and it has 2nd most numbers of train stations. (While it has 2nd most stations in number, Hokkaido is about 37 times bigger than Tokyo in area).
Shape of Hokkaido is pretty iconic (at least in my mind.) I recently found out there’s heart-shaped lake called Toyoni lake in Hokkaido too, but I didn’t spot heart-shaped Voronoi cell…
draw_pref(1, zoom=T, save_file=F)


## To see station on actual map
station_master %>% 
  filter(pref_cd==1) %>%
  arrange(e_sort) %>%
  ggplot(aes(x=lon, y=lat)) +
  geom_sf(data=jpn_pref(1), inherit.aes=F, color="#33333320") +
  geom_point(aes(color=company_name_r, shape=company_type_descr), alpha=0.8) +
        axis.title=element_blank()) +
  theme_minimal(base_family="Hiragino Sans W5") +
  geom_text_repel(data=station_master2 %>% filter(pref_cd==1 & station_cnt>=3), 
            family="Osaka", min.segment.length=0, nudge_x=2, segment.color="#33333350") +
  scale_color_hue(l=45, name="company name")
To leave a comment for the author, please follow the link and comment on their blog: R on Chi's Impe[r]fect Blog. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...
Comments are closed.

Monday, November 12, 2018

El Paso Trolley Opens

Hi Folks:

 I just heard that a small system of PCC restored streetcars opened in El Paso, Texas.  I saw some clips of the trolley restoration and the first day of operation and I am quite impressed.   I believe the shells of the original PCC fleet were stored in the desert and were restored beautifully with all the modern conveniences including air-conditioning.   Even though, of course, I am at home and saw the video, you can "feel" the smooth running of the PCC cars.  Unlike the original system, the new PCC streetcars use pantographs instead of trolley wheel and bow.  They really look cool.   I wish El Paso much success and that more lines could be established.   For  New York City, I would be happy if a stationary exhibit of a streetcar, PCC or not would be available.

Good luck El Paso!
Tramway Null()

Wednesday, November 7, 2018

Visiting QGIS Again

I have not worked with QGIS is some time.   I was called upon to do an analysis of distances between certain clients and institutions and I therefore revisited QGIS.  Several years ago, I made a map with some altitude files (both vector and raster) and this map contains both types of files.  The subway lines are in green are of the vector types and the contours for the Hudson River and New York upper bay are also contour raster files.   The eastern part Staten Island is also shown and is a raster file.   It is interesting that the Bay Ridge Division of the LIRR is also shown.   Some persons want to make this line into a Triborough crosstown line to Co-Op City in the Bronx.  Also is shown next to the West End Line (fourth green line from the right) is a vertical straight line that comes from an uneven edge of an aerial photograph.  This map is not useful but it is interesting to look at and perhaps can be considered a work of art?  The Hudson River depth file comes probably comes from a New York State data source file that I extracted and used many years ago.

Tuesday, October 30, 2018

Church - McDonald Streetcar Line died 10/31/56

/Tonight is the anniversary of the end of streetcars in Brooklyn on 10/31/56 which may have been also a Wednesday.   On this date, the Church Avenue, Church - McDonald and the Cortelyou Road trolleybus (B-23) also ended.  In this shot taken off the web shows a southbound Church - McDonald streetcar along the incline of the IND subway system between Ditmas and Church Avenue stations.  To the right of the PCC streetcar is a R-1-9 subway car going south towards the Ditmas Avenue station.  The Brooklyn - Queens Tram shown below is not doing well and around a week ago it was declared that the Staten Island Ferris Wheel is also dead.   I guess trolleys in Brooklyn, old or new and a ferris wheel in Staten Island were not meant to be.