A service that predicts where people taking cabs will want to be dropped off in NYC
url http://taxi.gsoeller.com/index.html
Make a request, get a response
- Pojo's for the data
- Connect to a database
- Dao's for the Pojo's
What is the best way to actually make a prediction?
- git clone https://github.com/soelgary/Taxi.git -> downloads all the code and sets up your local git repo
- git pull origin master -> updates your local repo
- git checkout -b branch-name
- git add filename
- git commit
- git push origin branch-name
- go to github and create a pull request for your branch
- merge pull request into master
- git checkout master
- repeat steps 2-8
- Install and run mongodb
- clone this repo
- Add this project to eclipse by importing an existing maven project
- install
TaxiDataandTaxiAlgorithmsto your local maven repository by running these commandscd TaxiDataandmvn clean install. Repeat forTaxiAlgorithms - Setup the run configuration in eclipse. Set the project to be
TaxiService. Set the main class to becom.gsoeller.taxi.TaxiService.TaxiServiceApplication. Set the program arguments to beserver. - Click run and you can send GET/POST requests to http://127.0.0.1/trip
This is a list of all the endpoints that you can hit and example payloads.
GET /trip?limit=n
This endpoint will get you all of the trip objects stored in the database. limit is an optional query param that sets a limit on the number of trips to query for. The default is set to 100.
POST /trip
This endpoint will create a new trip and return the trip that you created. An example json payload is below
{
"endLocation": {
"type": "Point",
"coordinates": [1.8761, 2.2874]
},
"endTime": 1357681356,
"startLocation": {
"type": "Point",
"coordinates": [1.1, 2.2]
},
"startTime": 1357680958
}load_trip_data.py
This script is located in TaxiData/src/main/scripts and will add all the taxi data from a given script. Execute the script by running ./load_trip_data.py -i /path/to/file/with/trip/data.txt