-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from olincollege/bronze-db
Add new files to bronze db and reformat
- Loading branch information
Showing
3 changed files
with
53 additions
and
45 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import util | ||
|
||
# Eventually we want to automate the process of generating these geojsons into this file, so they are generated | ||
# at the same time that the bronze database is created and then automatically deleted. | ||
|
||
|
||
def generate_bronze_db(): | ||
db_path = "bronze.db" | ||
|
||
# Run the scripts in tests to generate the GeoJSON files | ||
datasets = [ | ||
("tests/test_boston_crosswalk.geojson", "crosswalks"), | ||
("tests/test_boston_streetlights.geojson", "streetlights"), | ||
("tests/test_all_population_density.geojson", "population_density"), | ||
("tests/test_boston_traffic.geojson", "traffic"), | ||
("tests/test_boston_vision_zero.geojson", "accidents"), | ||
("tests/test_ma_median_household_income.geojson", "median_income"), | ||
("tests/test_boston_traffic_lights.geojson", "traffic_lights"), | ||
("tests/test_pedestrian.geojson", "pedestrian_generators"), | ||
("tests/test_road_speeds.geojson", "speed_limits"), | ||
] | ||
|
||
conn = util.connect_to_duckdb(db_path) | ||
util.load_multiple_datasets(conn, datasets) | ||
|
||
|
||
if __name__ == "__main__": | ||
print(generate_bronze_db()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters