Shibuya Crossing Population

Ashley Louie
Data Mining the City
2 min readSep 26, 2018

Session A Project:
Interactive framework for community engagement

We are researching the Hudson Valley region comprised of small independent farms, which are threatened by competition with the ‘megafarming’ industry. Strengthening a network between small local farms could potentially sustain a thriving and mutually beneficial business model for Hudson Valley and New York City. The current decision making process of testing new consumer markets is based on trial and error, and as small farm owners, there is a lack knowledge and access to computational modeling for business efficiency. We hope to develop our Python skills and learn from testing different methods of transporting goods more efficiently within a local network while understanding the realistic cost and time implications for each method.

Simulation of people crossing a busy intersection in Shibuya, Tokyo

Shibuya Crossing
Shibuya Crossing in Python
x = []
y = []
xspeed = []
yspeed = []
populationSize = 500
for i in range(populationSize):
x.append(random(0,1200))
y.append(random(0,1200))
xspeed.append(random(-5,5))
yspeed.append(random(-5,5))
def setup():
size(1200,1200)
smooth()
global crossingWidth, crossingHeight, spacing, bldgSize, crosswalkX, crosswalkY
crossingWidth = 15
crossingHeight = 120
spacing = 15
bldgSize = 300

def crosswalkX(x,y,stripes):
for column in xrange(0,stripes):
fill(255)
noStroke()
rect(x+column*(crossingWidth+spacing)+crossingWidth,
y,
crossingWidth,
crossingHeight)
def crosswalkY(x,y,stripes):
for row in xrange(0,stripes):
fill(255)
noStroke()
rect(x,
y+row*(crossingWidth+spacing)+crossingWidth,
crossingHeight,
crossingWidth)
def draw():
background(200)

crosswalkX(380,170,14)
crosswalkX(380,895,14)
crosswalkY(175,380,14)
crosswalkY(900,380,14)
pushMatrix()
translate(380,290)
rotate(PI/4)
crosswalkX(0,0,24)
popMatrix()

for i in range(populationSize):
x[i] = x[i] + xspeed[i]
y[i] = y[i] + yspeed[i]
if (x[i] > width) or (x[i] < 0):
xspeed[i] = xspeed[i] * -1
if (y[i] > height) or (y[i] < 0):
yspeed[i] = yspeed[i] * -1
noStroke()
fill(0)
ellipse(x[i], y[i], 10, 10)

noStroke()
fill(150)
rect(0,0,bldgSize,bldgSize)
rect(0,900,bldgSize,bldgSize)
rect(900,0,bldgSize,bldgSize)
rect(900,900,bldgSize,bldgSize)

--

--

Ashley Louie
Data Mining the City

With a background in architecture and urban design, I work with data and technology for social good.