Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big pin #23

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a8a8e7b
Replace data url, bounds, and center for Oakland
daguar Aug 25, 2014
716fe17
Change icon size
daguar Aug 25, 2014
9362079
Make basic HTML layout for soft story data
daguar Aug 25, 2014
1a97972
Change default zoom level to 14
daguar Aug 25, 2014
d03e984
Make each property have parcel-based URL
daguar Aug 25, 2014
7044d73
Max zoom 18, min zoom 14, and fix unique arg in tilelayer laying
daguar Aug 25, 2014
f636e72
Remove console log statement
daguar Aug 25, 2014
f3defbb
Edit search to use Oakland bounding box and name
daguar Aug 25, 2014
0628d2b
Zoom to level 17 (not 18) for a search result
daguar Aug 25, 2014
f2c9669
update to color scheme, font, and small layout changes
criscristina Aug 25, 2014
4699e38
Merge pull request #1 from daguar/visual-tweaks
daguar Aug 25, 2014
2c9459c
Change color of status box to match header bar
daguar Aug 25, 2014
2292fe9
Resize box
daguar Aug 25, 2014
d68aaea
Added new icons
migurski Aug 26, 2014
d8e4e64
Added icon source files
migurski Aug 26, 2014
455d9f5
Added wee icons
migurski Aug 26, 2014
3353583
First commit after 2 days of noodling
migurski Aug 26, 2014
ee0d9af
Moved everything under data/
migurski Aug 26, 2014
001ef89
Merge commit '2292fe9' into oops
migurski Aug 26, 2014
d6f0140
Cleaned up unneeded files
migurski Aug 26, 2014
d8a29d7
Make lower box nicer
daguar Aug 26, 2014
883c3c7
Distinguish level 2 markers
daguar Aug 26, 2014
f6cfbf3
Merge pull request #3 from migurski/new-icons
daguar Aug 26, 2014
2e7661f
Add soft story header image
daguar Aug 26, 2014
fb7eed2
Change market sizes slightly
daguar Aug 26, 2014
48a056e
New icons!
daguar Aug 26, 2014
96e7f7a
Remove unused HTML generation from JS
daguar Aug 26, 2014
2f82e1d
Don't geolocate user and change map there
daguar Aug 26, 2014
150264e
Make header img mobile responsive
daguar Aug 27, 2014
9547b96
Img icon max width 100%
daguar Aug 27, 2014
6546b4a
Merge pull request #2 from migurski/oakland-soft-story
daguar Aug 27, 2014
50cfe31
Merge branch 'oakland-soft-story' of https://github.com/daguar/ohhs_F…
daguar Aug 27, 2014
943c163
Add revised data
daguar Aug 27, 2014
b87279f
updated background and increased size for active marker
criscristina Aug 27, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ input,
select,
textarea {
font-family: 'Open Sans', sans-serif;
color: #666;
}

a {
color: #FD8E25;
color: #00699A;
font-weight: bold;
}

a:hover {
color: #FFC145;
color: #009DE7;
}

ul {
Expand All @@ -21,11 +22,12 @@ ul {

#header {
height: 41px;
background: #19A89D;
background: #00699A;
}

#header img {
width: 150px;
max-height: 69%;
max-width: 100%;
margin: 0px auto;
display: block;
padding: 7px 0px;
Expand Down Expand Up @@ -69,15 +71,13 @@ ul {
#housinginfo div.infoboxes div.inspectbox,
#housinginfo div.infoboxes div.violationbox {
color: #fff;
width: 49%;
height: 64px;
width: 98%;
text-align: center;
padding: 7px 0px 0px;
margin-bottom: 10px;
}

#housinginfo div.infoboxes div.inspectbox {
background: #19A89D;
background: #00699A;
float: left;
}

Expand Down Expand Up @@ -106,30 +106,31 @@ input {
}

#addressentry {
padding: 10px 0 10px 10px;
padding: 10px 10% 10px 10%;
background: #eee;
}

#address {
width: 80%;
padding: 6px 0px;
padding: 6px 1%;
border: none;
}

#submitaddress {
width: 50px;
width: 80px;
height: 32px;
margin-left: 5px;
background: #FD8E25;
margin-left: 7px;
color: #f8f8ff;
background: #FF8B00;
border: none;
text-transform: uppercase;
/*text-transform: uppercase;*/
font-weight: bold;
font-size: 16px;
padding: 0px;
}

#submitaddress:hover {
background: #FFC145;
background: #FFAE4C;
}

::-webkit-input-placeholder {
Expand All @@ -156,6 +157,7 @@ input {
font-size: 12px;
font-style: italic;
padding: 0px;
margin-left: 10px;
}

#sampleaddresses p {
Expand Down
12 changes: 0 additions & 12 deletions data/Makefile

This file was deleted.

1 change: 1 addition & 0 deletions data/address-statuses.csv

Large diffs are not rendered by default.

93 changes: 0 additions & 93 deletions data/import-buildings.py

This file was deleted.

19 changes: 19 additions & 0 deletions data/import-parcels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from csv import DictReader
from re import sub
import json

if __name__ == '__main__':

statuses = list()

with open('statuses-2014-08-25.csv', 'rU') as f:
for row in DictReader(f, dialect='excel'):
if row['latitude']:
statuses.append(row)
statuses[-1]['latitude'] = float(statuses[-1]['latitude'])
statuses[-1]['longitude'] = float(statuses[-1]['longitude'])

for status in statuses:
id = sub(r'\W', '-', status['address'])
with open('parcels/{0}.json'.format(id), 'w') as f:
json.dump(status, f, indent=2, sort_keys=True)
49 changes: 18 additions & 31 deletions data/import-tiles.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#!/usr/bin/env python
from itertools import product
from os import makedirs
from csv import DictReader
from json import dump
from re import sub

from ModestMaps.Geo import Location
from ModestMaps.Core import Coordinate
from ModestMaps.OpenStreetMap import Provider

from lib import load_violations, load_inspections, load_buildings
from lib import match_inspection_violations, match_building_inspections

min_zoom = 14
max_zoom = 17
max_zoom = 18

def starting_tiles(buildings):
''' Get tile coordinates at min_zoom for a list of buildings.
Expand Down Expand Up @@ -47,38 +46,26 @@ def search_tile(coord, buildings):

if __name__ == '__main__':

print 'Getting violations...'

violations_url = 'http://s3.amazonaws.com/data.codeforamerica.org/OHHS/SF/1.2/Violations.csv'
violations = load_violations(violations_url)

print 'Getting inspections...'

inspections_url = 'http://s3.amazonaws.com/data.codeforamerica.org/OHHS/SF/1.2/Inspections.csv'
inspections = load_inspections(inspections_url)

print 'Getting buildings...'
statuses = list()

buildings_url = 'http://s3.amazonaws.com/data.codeforamerica.org/OHHS/SF/1.2/Buildings.csv'
buildings = load_buildings(buildings_url)
with open('statuses-2014-08-25.csv', 'rU') as f:
for row in DictReader(f, dialect='excel'):
if row['latitude']:
statuses.append(row)
statuses[-1]['latitude'] = float(statuses[-1]['latitude'])
statuses[-1]['longitude'] = float(statuses[-1]['longitude'])

print 'Matching inspection violations...'

match_inspection_violations(violations, inspections)

print 'Matching building inspections...'

match_building_inspections(inspections, buildings)

building_list = buildings.values()
search_coords = [(coord, building_list) for coord in starting_tiles(building_list)]
search_coords = [(coord, statuses) for coord in starting_tiles(statuses)]

while search_coords:
coord, building_list = search_coords.pop(0)
found_buildings = search_tile(coord, building_list)
coord, status_list = search_coords.pop(0)
found_buildings = search_tile(coord, status_list)

print ('%(zoom)d/%(column)d/%(row)d' % coord.__dict__),
print len(found_buildings), 'of', len(building_list)
print len(found_buildings), 'of', len(status_list)

if len(found_buildings) == 0:
continue

try:
makedirs('tiles/%(zoom)d/%(column)d' % coord.__dict__)
Expand All @@ -87,7 +74,7 @@ def search_tile(coord, buildings):

with open('tiles/%(zoom)d/%(column)d/%(row)d.json' % coord.__dict__, 'w') as out:
features = [dict(
id=p['id'],
id=sub(r'\W', '-', p['address']),
type='Feature',
properties=p,
geometry=dict(
Expand Down
Loading