-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df0333e
commit afd3798
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
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,18 @@ | ||
{ | ||
"requests": { | ||
"description": "One trip from every building to the nearest (as the crow flies) school. Elevation is included.", | ||
"pattern": "FromEveryOriginToNearestDestination", | ||
"origins_path": "buildings.geojson", | ||
"destinations_path": "schools.geojson" | ||
}, | ||
"cost": { | ||
"ByLTS": { | ||
"lts1": 1.0, | ||
"lts2": 1.5, | ||
"lts3": 3.0, | ||
"lts4": 5.0 | ||
} | ||
}, | ||
"uptake": "Identity", | ||
"lts": "BikeOttawa" | ||
} |
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,57 @@ | ||
import csv | ||
import json | ||
|
||
from utils import * | ||
|
||
|
||
def makeOSM(): | ||
download( | ||
url="https://download.geofabrik.de/europe/portugal-latest.osm.pbf", | ||
outputFilename="input/portugal-latest.osm.pbf", | ||
) | ||
# Clip to Lisbon | ||
run( | ||
[ | ||
"osmium", | ||
"extract", | ||
"-b", | ||
"-9.291687,38.673717,-9.080887,38.831685", | ||
"input/portugal-latest.osm.pbf", | ||
"-o", | ||
"input/input.osm.pbf", | ||
] | ||
) | ||
|
||
|
||
def makeElevation(): | ||
# TODO LisboaCOPERNICUS_clip.tif doesn't have any errors, but no data seems to get scraped | ||
# TODO LisboaIST_clip_r1.tif is apparently missing a TIF signature? | ||
download( | ||
url="https://github.com/U-Shift/Declives-RedeViaria/raw/main/raster/LisboaCOPERNICUS_clip.tif", | ||
outputFilename="input/LisboaCOPERNICUS_clip.tif", | ||
) | ||
|
||
|
||
def makeOrigins(): | ||
# Use building centroids as origins | ||
extractCentroids( | ||
osmInput="input/input.osm.pbf", geojsonOutput="input/buildings.geojson" | ||
) | ||
|
||
|
||
def makeDestinations(): | ||
# School centroids as destinations | ||
extractCentroids( | ||
osmInput="input/input.osm.pbf", | ||
geojsonOutput="input/schools.geojson", | ||
where=f"amenity = 'school'", | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
checkDependencies() | ||
run(["mkdir", "-p", "input"]) | ||
makeOSM() | ||
#makeElevation() | ||
makeOrigins() | ||
makeDestinations() |
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 @@ | ||
../utils.py |
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