The goal of the project is to transform the real world position of geographic coordinate system (latitude and longitude) onto the coordinate (x, y) of BART's rail track diagram.
The problem with morphing geolocations onto schematic diagram around one core idea: How do we project the geolocation to the diagram more accurate?
We can then break this down into two further questions:
- How can we convert the geolocation onto the diagram?
- Where should we project the point on graph between two stations?
This web page provides a list of all of the BART stations with their full names, abbreviations, latitude, longitude and addresses. https://api.bart.gov/docs/stn/stns.aspx
- bart_json.txt: real bart location in latitude and longitude
- station_names_BART.csv: bart station id and its corresponding name
- AerialStructuresAndTrainControl.csv: Input data in latitude and longitude
- Real Map Visulization (Google Map API)
- yellow dot: input geolocation data
- purple dot: bart location
- Schematic Diagram with its corresponding bart station
- green dot: bart station
The algorithm constist of two goals:
- Use a straight-forward way to project the real location on the graph.
- Try to be efficient and save the run time for the algorithm.
- Calculating the distance between given point and bart station and find the first closest and second closest bart id, and its distance.
- Project the given point onto the diagram by ratio calculation
- ratio function: distance / (two bart distance) = dis / (two bart distance on the diagram)
- find a point along a line a certain distance away from another point
- Draw all the projected points on the given diagram.
- Seperate station IDs into 12 groups and write them in a dictionary.
- Ideas: There are total 12 straight lines, we can seperate in different groups. Once we know the closest station for the given point, then we can target that single line (key) based on its station id (value). The final step is to project the point on the line.
- Set the boundary.