Pick Up Energetic Fast Food For Your Final Review
How can GSAPP students obtain quickest food from surrounding restaurants when they have to push themselves for various deadlines.
The video link: https://youtu.be/tJLTHFGbvIU
It is very common for students in GSAPP to stay in studio for a whole day especially during the mid-term and finally review. No time to eat because of the deadline and the lack of choice is a big living problem in this specific period.
Most students are forced by deadline caused they have no time to wait or enjoy a well-prepared food. Even students want to go out for food there is not a clear guide for them about what kind food can be had immediately. So the fastest way can help us get the food and have different food is a strong desire. So we want to utilize data mining skills to make us clear about how much time exactly we will spend on going to nearby restaurants.
Firstly, we managed to obtain necessary data about address, name, location,evaluation of all the fast food restaurants by using Grasshopper, and make it a list. Secondly, we imported the base map of New York City and the csv list to identify all the points of these restaurants. Thirdly, we estimated the distance between GSAPP and a restaurant that can be covered within 10 min’ walking and 15 min’ walking. Then, we mainly focused on the 10 min’s circle, and depend on Google Directions to get the recommend route and exact time from Google map. Finally, we use green color to show the distance between GSAPP and restaurants can be covered in 5 min, and blue ones to show the distance that can be covered within 10 min. And these restaurants are the ones that can help us most to save time.
DATA SOURCE
yelp
google map
CODE
import spatialpixel.mapping.slippymapper as slippymapper
import spatialpixel.google.directions as directions
import csvglobal nycdef setup():
size(1000, 800, P2D)
stroke(255, 102, 0)
strokeWeight(1)
noFill()
pin = loadImage(“https://s3.amazonaws.com/spatialpixel/maps/map-pin-10px.png")global nyc
global zoom
zoom = 14
nyc = slippymapper.SlippyMapper(40.715, -73.899, zoom, ‘carto-light’, width, height)
nyc.addMarker(40.808451, -73.960301)
apikey = ‘AIzaSyCntagLVTbRv_-gaFzpXGcgtJLy5kruxKE’
nyc.addMarker(40.807976, -73.964322, “ShakeShack”)
nyc.addMarker(40.806474, -73.961103, “HamiltonDeli”)
nyc.addMarker(40.80548, -73.965248, “TomRestaurant”)
nyc.addMarker(40.809971, -73.962353, “UncleLuoyang”)
nyc.addMarker(40.804792, -73.966539, “FamousFamigliaPizzeria”)
nyc.addMarker(40.80458, -73.96674, “FiveGuys”)
nyc.addMarker(40.804448, -73.966795, “ChipotleMexicanGrill”)
nyc.addMarker(40.80443, -73.96618, “MelBurgerBar”)
nyc.addMarker(40.80442, -73.966056, “KoronetPizza”)
nyc.addMarker(40.815777, -73.958585, “McDonald”)
nyc.addMarker(40.815262, -73.958122, “Subway”)
nyc.addMarker(40.810555, -73.952809, “Checker”)
nyc.addMarker(40.807643, -73.945032, “Checkers”)
nyc.addMarker(40.808451, -73.960301, “gsapp”)
TomRestaurant = (40.80548, -73.965248)
ShakeShack = (40.807976, -73.964322)
HamiltonDeli = (40.806474, -73.961103)
gsapp = (40.808451, -73.960301)
UncleLuoyang = (40.809971, -73.962353)
FamousFamigliaPizzeria = (40.804792, -73.966539)
FiveGuys = (40.80458, -73.96674)
ChipotleMexicanGrill = (40.804448, -73.966795)
MelBurgerBar = (40.80443, -73.96618)
KoronetPizza = (40.80442, -73.966056)
McDonald = (40.815777, -73.958585)
Subway = (40.815262, -73.958122)
Checker = (40.810555, -73.952809)
Checkers = (40.807643, -73.945032)
ShakeShackTogsapp = directions.SlippyLayer(apikey)
HamiltonDeliTogsapp = directions.SlippyLayer(apikey)
TomRestaurantTogsapp = directions.SlippyLayer(apikey)
UncleLuoyangTogsapp = directions.SlippyLayer(apikey)
FamousFamigliaPizzeriaTogsapp = directions.SlippyLayer(apikey)
FiveGuysTogsapp = directions.SlippyLayer(apikey)
ChipotleMexicanGrillTogsapp = directions.SlippyLayer(apikey)
MelBurgerBarTogsapp = directions.SlippyLayer(apikey)
KoronetPizzaTogsapp = directions.SlippyLayer(apikey)
McDonaldTogsapp = directions.SlippyLayer(apikey)
SubwayTogsapp = directions.SlippyLayer(apikey)
CheckerTogsapp = directions.SlippyLayer(apikey)
CheckersTogsapp = directions.SlippyLayer(apikey)
HamiltonDeliTogsapp.addRoute(HamiltonDeli, gsapp, ‘walking’, strokeColor=color(113,197,63))
ShakeShackTogsapp.addRoute(ShakeShack, gsapp, ‘walking’, strokeColor=color(113,197,63))
TomRestaurantTogsapp.addRoute(TomRestaurant, gsapp, ‘walking’, strokeColor=color(113,197,63))
UncleLuoyangTogsapp.addRoute(UncleLuoyang, gsapp, ‘walking’, strokeColor=color(63,119,222))
FamousFamigliaPizzeriaTogsapp.addRoute(FamousFamigliaPizzeria, gsapp, ‘walking’, strokeColor=color(63,119,222))
FiveGuysTogsapp.addRoute(FiveGuys, gsapp, ‘walking’, strokeColor=color(63,119,222))
ChipotleMexicanGrillTogsapp.addRoute(ChipotleMexicanGrill, gsapp, ‘walking’, strokeColor=color(63,119,222))
MelBurgerBarTogsapp.addRoute(MelBurgerBar, gsapp, ‘walking’, strokeColor=color(63,119,222))
KoronetPizzaTogsapp.addRoute(KoronetPizza, gsapp, ‘walking’, strokeColor=color(63,119,222))
McDonaldTogsapp.addRoute(McDonald, gsapp, ‘walking’, strokeColor=color(63,119,222))
SubwayTogsapp.addRoute(Subway, gsapp, ‘walking’, strokeColor=color(63,119,222))
CheckerTogsapp.addRoute(Checker, gsapp, ‘walking’, strokeColor=color(63,119,222))
CheckersTogsapp.addRoute(Checkers, gsapp, ‘walking’, strokeColor=color(63,119,222))
nyc.addLayer(ShakeShackTogsapp)
nyc.addLayer(HamiltonDeliTogsapp)
nyc.addLayer(TomRestaurantTogsapp)
nyc.addLayer(UncleLuoyangTogsapp)
nyc.addLayer(FamousFamigliaPizzeriaTogsapp)
nyc.addLayer(FiveGuysTogsapp)
nyc.addLayer(ChipotleMexicanGrillTogsapp)
nyc.addLayer(MelBurgerBarTogsapp)
nyc.addLayer(KoronetPizzaTogsapp)
nyc.addLayer(McDonaldTogsapp)
nyc.addLayer(SubwayTogsapp)
nyc.addLayer(CheckerTogsapp)
nyc.addLayer(CheckersTogsapp)global choices
choices = directions.SlippyLayer(apikey)
nyc.addLayer(choices)nyc.render()
with open(‘Food.csv’)as f:
reader = csv.reader(f)
header = reader.next()for row in reader:
latitude = float(row[3])
longitude = float(row[4])
name = row[1]
#nyc.addMarker(latitude, longitude, name)
nyc.addMarker(latitude, longitude, pin)
#nyc.render()
nyc.render()def mouseClicked():
global nyc, zoom
lon = nyc.xToLon(mouseX)
lat = nyc.yToLat(mouseY)
# making zoom in
if mouseButton == LEFT:
zoom += 1
# defining maximum zoom in
if zoom > 18:
zoom = 18
# making zoom out
elif mouseButton == RIGHT:
zoom -= 1
# defining maximum zoom out
if zoom < 1:
zoom = 1
nyc.setCenter(lat, lon)
nyc.setZoom(zoom)
nyc.render()
#ellipse(circleXPosition, circleYPosition, circleRadius, circleRadius)
def draw():
background(255)
nyc.addMarker(40.808451, -73.960301)
nyc.draw()
global circleYPosition
global circleXPosition
#circleRadius = 300
#circleYPosition = nyc.latToY(40.808451)
#circleXPosition = nyc.lonToX(-73.960301)
#print circleYPosition
#print circleXPosition
#noFill()
#ellipse(circleXPosition, circleYPosition, circleRadius, circleRadius)
#circleRadius = 100
#circleYPosition = nyc.latToY(-73.960301)
#circleXPosition = nyc.lonToX(40.808451)
#circleYPosition = nyc.latToY(-73.960301)
#circleXPosition = nyc.lonToX(40.808451)
#ellipse(circleXPosition, circleYPosition, circleRadius, circleRadius)