Best jazz bars in the city (midterm)

Yichen Ouyang
Data Mining the City
2 min readOct 23, 2017

New York is the city of jazz and blues. Although a lot of the old-school spots have since bitten the dust — with some others devolving into tourist traps — there are still plenty of clubs around town, and it is hard to pick one to spend weekend nights. Every jazz club has its own feature. Bars like Mezzrow have the best piano and bass duos. Jazz Standard has the best food service. If you are looking for a bar has the longest history, pick Village Vanguard…

This project is trying to find out the features of the jazz bars with the highest rating and help people make their choices easier and right. By collecting data from Yelp and Google Map, this project visualizing the top 20 jazz bars in the city with some briefing offered in the bottom of the map.

code:

import spatialpixel.mapping.slippymapper as slippymapper
import csv
def setup():
size(1000, 800, P2D)
fill(0,0,0)

global nyc
nyc = slippymapper.SlippyMapper(40.765, -74.00, 13, ‘carto-dark’, 1100, 1000)
global img
bars=[]
with open(‘Jazzbar.csv’) as f:
reader = csv.reader(f)

for row in reader:
name = str(row[0])
rate = str(row[1])
openhour = str(row[5])
feature = str(row[4])
barlatitude = float(row[2])
barlongitude = float(row[3])
imagename=str(row[6])
barimage = loadImage(imagename)
bar ={‘lat’:barlatitude,’long’:barlongitude,’rates’:rate,’openhours’:openhour,’features’:feature, ‘names’: name, ‘images’: barimage}
bars.append(bar)
for jazzbar in bars:
nyc.addMarker(jazzbar[‘lat’],jazzbar[‘long’], pin(jazzbar))
nyc.render()
class pin(slippymapper.DataMarker):

def drawMarker(self, barlatitude, barlongitude, marker):
marker.noStroke()
marker.fill(255, 0, 0, 95)
marker.ellipse(barlatitude, barlongitude, 15, 15)

if dist(barlatitude,barlongitude, mouseX, mouseY) <= 4:
textSize(20)
fill(255,255,255)
marker.text(self.data[‘names’], 130, 680)
marker.text(self.data[‘features’], 130, 705)
marker.text(self.data[‘rates’], 130, 730)
marker.text(self.data[‘openhours’], 155, 755)
marker.image(self.data[‘images’], 25, 80)
def draw():
background(200)
nyc.draw()
# title
textSize(35)
fill(255,255,255)
text (“Great Jazz Bars in Manhattan”, 25, 50)
textSize(23)
fill(255,255,255)
text(“Name: “, 25, 680)
text(“Features: “, 25, 705)
text(“Rating: “, 25, 730)
text(“Openhours: “, 25, 755)

--

--