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.

Tuesday, March 13, 2018

Working with New York City Transit Authority Ridership Statistics Using "R"

Baruch College of CUNY offers data sets that can be downloadable dealing with station ridership statistics roughly from 2008 to 2016.  During this time, many stations or parts of stations were closed down for renovation so your really cannot compare the stats from station to station and from year to year.  

Using the dataset given at this site, I converted the *.xls file into a *.csv file and read it into "R".   Are there any common characteristics to the statistics for all these stations over various years?  First let us see if there are any clusters.   Using R code, I got the following graphs(s):  Looking at the curve, I was told that the ideal number of clusters may be at the location where on point is out of line with the rest.  This appears to be around 5 clusters.  Incidentally, the data set for ridership includes total for the year and average weekday and weekend ridership.  Note that during weekends, many lines may be closed and replaced by bus services.  In the cluster dendrogram below, there appears to be only two clusters: One cluster for total annual ridership figures (2008 -2016) and average  weekday and weekend ridership for the same years.  The clusters were made obviously on the difference of annual and average weekday and weekend data.  This this experiment was a failure.   The output below shows the proposed clusters.  I will try to figure this out in the future

Tuesday, January 30, 2018

Williamsburg Area Brooklyn: Feet to Nearest Station

  In 2019, the "L" train will be shut down for about a year in which thousands of residents will need to make new travel plans.  It is proposed that the last stop closest to Manhattan will be Bedford Avenue Brooklyn.  Using various programs, I made two maps of the area in Brooklyn   The top map shows the closest station to the subject station in feet.  Each station has a serial number.  The bottom map shows the number of feet to the Bedford Avenue Station from any station in the area.  This distance is as the crow flies.  I hope these maps are useful to anyone wishing to change their travel plans.  I assume that the measurements are accurate and are included here just as a aid but mainly for showing interesting spacial analytic techniques.   Please use other apps to help plan your trips.

Monday, January 29, 2018

Staten Island 3-D Elevation Map with SIRT using ARCGIS Pro.

Staten Island Elevation Map with Street Layout Added .  Elevation is from Raster File.

Notice the human like head circled in the Staten Island Elevation Map.  Compare to images found on the martian landscape.

Notice that using an enriched raster file with NYC elevations produces a nice map.

Thursday, December 21, 2017

K Nearest Subway Station to Next Station in Feet: 14th Street Area & Williamsburg Brooklyn

In the map above, produced in ARCGIS, I  used a QGIS produced output of K-Nearest Neighbors from the Distance Matrix.   I joined that table to a previously produced map layer showing NYC subway stations.  I used the previous layer showing the new serial numbers.   I joined the layers together using ARCGIS.   The results are as follows: From top to bottom for each station:

Station Serial Number
Station Name
Nearest Station Serial Number
Shortest Distance in Feet

Thus for the 14th Street 1st Avenue Station "L Line"
Station Serial # 195
Station Label:  1 AV
Nearest Station to this station: 194  ( 3rd Avenue and 14 Street)
Distance in Feet (straight Line)    1424.2 Feet.

Another Example
Station Serial # 133
Station Name;  Astor Place
Nearest Station to this Station: 215 ( 8th Street NYU)
Distance in Feet: 443.466

Wednesday, December 20, 2017

How to Calculate Distances between Subway Stations Using ARCGIS and QGIS

  In this exercise, we will try to develop a matrx of distances between all subway stations, including Staten Island Rapid Transit.  You may do so for your own system that you are interested in.    Thus, if we are interested in the new Second Avenue Subway Station at 96th Street and Second Avenue ( my reference number 205 ), we can observe the distance to the 71 St. Forest Hills Station ( Reference Number 427 ).    From the chart, we can see that it is 36,457.72 feet, or 6.90487 miles.  I only did this analysis for the new Second Avenue Stations ( 203 to 205 Serial Numbers).  Thus the 96 th Street Station has 493 distances to all the other stations.  This is a large amount of material to post on a log and I am not giving you the serial numbers of all stations.   Let me know if you need them.

At any rate, I hope to show you how to do this soon.

To start, you need a mapping program and a shape (*.shp) file.  ARCGIS is a big mapping program but it not free.  QGIS is a free open source software for maps.   Download a shape file for your subway stop locations.   If you want to see the line itself, (subway lines), you will need to download a shape file of the subway line.  This analysis will use only subway stops.

Once you have a shape file of subway stations, you will need to make a slight alteration to the table that lists all the subway stations.  In ARCGIS, the FID identification column begins with a zero.   Many distance tools can not read a list that has a unique serial number that begins with zero.  In ARCGIS  while in the table mode for your shapefile, create a new column.  I call mine "Newserial".  Use the field calculator to add one to the FID number:   NEWSERIAL = FID +1.   You will get a serial number that begins with 1 and you can start to do various analysis.   Incidentally, the Newserial number is the number that I use to identify the subway stations in this exercise.  If you are using ARCGIS and do not have full tool availability (Advanced Package), you will need to bring up the shape station file in QGIS.     Bring your vector station file, and then choose, vector, analyst tools and then the Distance Matrix.   The unique identifier is the serial number with no duplicates.   Choose one of the variations and make sure you designate an output file.   Let us say, the your file contains 150 stations, locations, or whatever points you are using to analyze.   You will be returned with a csv file with point 1 and 149 locations, point 2 with 149 locations until point 150 with 149 other locations.  For the New York City subway system, the number of locals is large so I could not give you all of them.   On the map, the Second Avenue Line is not shown, only the stations.  Staten Island Rapid Transit stations are also included in the analysis.  Staten Island Stations are  #493 St George to #473 Tottenville,   Far Rockaway Mott Avenue is 451 and Pelham Bay Park is 45.

Therefore, the distance between 2nd Avenue - 96 Street (Ref. 205) to Tottenville, (Ref. 473) is 130, 162.6 feet or 24.65 miles as the birds fly.

Tramway Null()