Example #1
0
        census_2000_energy[row[2]] = \
            [float(row[3]), float(row[6]), float(row[4])]

# test to see how much overlap in census blocks and print out a
# message about matching between spreadsheet block IDs and census
# block IDs
spreadsheet_blocks = set(census_2000_energy.keys())
chicago_blocks = set(CENSUS_BLOCK_2000.keys())
print >> sys.stderr, "Unknown blocks in spreadsheet: %s" % \
    spreadsheet_blocks.difference(chicago_blocks)
print >> sys.stderr, "# of Missing blocks in spreadsheet: %s" % \
    len(chicago_blocks.difference(spreadsheet_blocks))

# --------------------------------------------- maybe read in census information

# --------------------------------------- aggregate metrics and write JSON files
for zoom_level in [
        WARD,
        COMMUNITY_AREA,
        NEIGHBORHOOD,
        SCHOOL,
        CENSUS_TRACT_2010,
]:
    aggregate_dict = aggregate_metrics(
        WARD,
        CENSUS_BLOCK_2000,
        CENSUS_BLOCK_2000_INDEX,
        census_2000_energy,
    )
    write_json(aggregate_dict, None)
Example #2
0
#     census_2000_energy = {}
#     for row in reader:
#         census_2000_energy[row[2]] = \
#             [float(row[3]), float(row[6]), float(row[4])]

# # test to see how much overlap in census blocks and print out a
# # message about matching between spreadsheet block IDs and census
# # block IDs
# spreadsheet_blocks = set(census_2000_energy.keys())
# chicago_blocks = set(CENSUS_BLOCK_2000.keys())
# print >> sys.stderr, "Unknown blocks in spreadsheet: %s" % \
#     spreadsheet_blocks.difference(chicago_blocks)
# print >> sys.stderr, "# of Missing blocks in spreadsheet: %s" % \
#     len(chicago_blocks.difference(spreadsheet_blocks))

# --------------------------------------------- maybe read in census information


# --------------------------------------- aggregate metrics and write JSON files
for zoom_level in [
        NEIGHBORHOOD,
    ]:
    aggregate_dict = aggregate_metrics(
        zoom_level,
        CENSUS_BLOCK_2010,
        CENSUS_BLOCK_2010_INDEX,
        # census_2000_energy,
    )
    write_json(aggregate_dict, None)

Example #3
0
# test to see how much overlap in census blocks and print out a
# message about matching between spreadsheet block IDs and census
# block IDs
spreadsheet_blocks = set(census_2000_energy.keys())
chicago_blocks = set(CENSUS_BLOCK_2000.keys())
print >> sys.stderr, "Unknown blocks in spreadsheet: %s" % \
    spreadsheet_blocks.difference(chicago_blocks)
print >> sys.stderr, "# of Missing blocks in spreadsheet: %s" % \
    len(chicago_blocks.difference(spreadsheet_blocks))

# --------------------------------------------- maybe read in census information


# --------------------------------------- aggregate metrics and write JSON files
for zoom_level in [
        WARD,
        COMMUNITY_AREA,
        NEIGHBORHOOD,
        SCHOOL,
        CENSUS_TRACT_2010,
    ]:
    aggregate_dict = aggregate_metrics(
        WARD,
        CENSUS_BLOCK_2000,
        CENSUS_BLOCK_2000_INDEX,
        census_2000_energy,
    )
    write_json(aggregate_dict, None)