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.

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()

No comments:

Post a Comment