urban-analytics-technology-platform / od2net Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://od2net.org
License: Apache License 2.0
Home Page: https://od2net.org
License: Apache License 2.0
Not useful and unsure how to implement, but see inspiration from the throughput layer in A/B Street
This project started by making HTTP requests to OSRM, but the performance of that is terrible. I'm going to remove that integration for now to simplify and trim dependencies. Later on, revisit this:
Same questions for other routing engines
From every building to https://www.openstreetmap.org/way/23196317:
AREA=leeds
URL=https://download.geofabrik.de/europe/great-britain/england/west-yorkshire-latest.osm.pbf
mkdir $AREA
curl $URL -o $AREA/input.osm.pbf
ogr2ogr -f GeoJSON -dialect sqlite -sql 'SELECT ST_Centroid(geometry) FROM multipolygons WHERE building IS NOT NULL' $AREA/origins.geojson $AREA/input.osm.pbf
# For destinations, just one hospital: https://www.openstreetmap.org/way/23196317
echo '{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"coordinates":[-1.5521021406315,53.80241788159283],"type":"Point"}}]}' > $AREA/destinations.geojson
# Generate the "fast" network
cargo run --release -- '{"directory":"'"$AREA"'","requests":{"Generate":{"pattern":"FromEveryOriginToOneDestination"}},"routing":{"FastPaths":{"cost":"Distance"}}}'
mv $AREA/output.geojson $AREA/fast_output.geojson
# Now a rough approximation of a "quiet" network, penalizing main roads heavily
rm -f $AREA/ch.bin
cargo run --release -- '{"directory":"'"$AREA"'","requests":{"Generate":{"pattern":"FromEveryOriginToOneDestination"}},"routing":{"FastPaths":{"cost":"AvoidMainRoads"}}}'
mv $AREA/output.geojson $AREA/quiet_output.geojson
Manually load the two leeds/{fast,quiet}_output.geojson files in the viewer
Most users will be using one of the two, so figure out how to nicely integrate
If you have two different count outputs, visualize the diff
Example diffs could represent a network modification (if some edge becomes nicer, how does traffic redirect) or be used to parameter tune (if we change LTS definition, what overall effect does it have?)
Just documenting findings as I look at this with Joey:
That's from running it in browser for Leeds. Not an issue with this codebase but with the LTS scoring or OSM tags or combination. There is a light seggregated cycleway on and off the road but is defo not suitable for children, this is quite a scary place to be on a bike:
Decide a name. I have many ideas offline, but none quite fit yet
Probably make a multi-page book, possibly integrated with the Svelte app or not
A way to run all examples locally, recording time / memory / space / etc requirements and formatting nicely for docs.
Next: Create an example for Lisbon! @partavogen already forked this repo and is trying to make that, but also facing some issues.
Originally posted by @temospena in #2 (comment)
Hi all,
We are exploring od2net in Lisbon, and facing some problems.
Regarding #18 , how can we add this as the gradient value? Is it a matter to put the geotiff in a folder and point to it, or we need to pre-process with the data?
Here is a nice geotiff of Lisbon area: https://github.com/U-Shift/Declives-RedeViaria/blob/main/raster/LisboaIST_clip_r1.tif (10m res)
https://github.com/U-Shift/Declives-RedeViaria/blob/main/raster/LisboaCOPERNICUS_clip.tif (25m res)
Thanks!
Currently settings such as the tags associated with paths on which cycling is forbidden are hard coded in .rs
files:
Lines 31 to 38 in b3fb828
Would it be possible to replace such settings with config files in json
for easier editing and less Rust code reading? Aligns with the aim set out in #28 to make this more accessible (and in this case configurable) for others.
Use case: places like Norway and I believe Japan where cycling on footpaths is allowed, or for uses where we want to route cycling on a wider part of the network to inform investment decisions.
There are ways to fix this by changing the arguments sent to tippecanoe
, sure others have noticed it but cannot see an issue open on it.
Related issue is #37, I think fixing this one would yield a bigger benefit, especially for use cases where strategic planning is the aim.
Source: following instructions in #2
Deadline: 24th August.
https://github.com/dabreegster/routing-engines/blob/main/src/plugins/route_cost.rs is a placeholder
highway=construction
and maxspeed
bugs)Similar to LTS, visualize and break down distance by roads with excess width, parking/turn lanes, etc
This has been started, but needs docs and to include uptake info
Loading the GJ file with all edges and optionally origins/destinations is painfully slow
attribute-filter
or https://github.com/felt/tippecanoe#geojson-extension to simplify at low zooms)Ungap the Map, v2! Glue to the scheme sketcher, let people apply a proposed scheme, and see how it affects od2net output
I know this is work in progress but thought I'd give it a spin. Things I've tried so far based on looking at https://github.com/dabreegster/od2net/blob/main/examples/run_all.sh
I've tried:
cd examples/liverpool/
python setup.py
Traceback (most recent call last):
File "/home/robin/github/people/dabreegster/od2net/examples/liverpool/setup.py", line 109, in <module>
run(["mkdir", "-p", "input"])
NameError: name 'run' is not defined
A particularly useful first example to flesh out more.
Possibly this could be a generally useful mode of the web app... instead of loading a prebuilt network representing some OD pattern, let people manually pick a destination, use preconfigured OD data, and show the network to that one place. Depending on the size of the inputs, could/should we...
The
```bash
code in there can run with quarto render README.qmd
improving reproducibility.
Could set
#| eval: false
for the computationally intensive chunks or could just run the whole thing on any suitably resourced computer.
I plan to give this a bash over the next couple of weeks in any case, impressive speed-ups compared with routing used by PCT from what I can tell.
Concentrate on usage of crossings, not roads. As an example, see if the Angel crossing lights up
and publish to https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
Blocked by branding
Just a heads-up after reproducing some of the code in the README, managed to get this map which I'm happy with ๐
FYI anyone running this on Ubuntu, you may need to update your node version. This is what worked for me after reading this.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc
nvm list-remote
nvm install v18.12.0
nvm use v18.12.0
Run one of the Python examples end-to-end in GH actions and check something about the output. Pick a small one and possibly stash fixed input files somewhere.
I am following example from sotm-eu, and following it gives
Warning 1: Input datasource uses random layer reading, but output datasource does not support random layer writing
among output.
No idea is it pointless message or critical error or what, but would be nice to somehow get rid if it or get clearer error.
For visualization and/or analysis purposes, bundle parallel edes
For all of these, I think we could first just detect this situation about the edge (and surface that info in the UI clearly). Then we can write edge cost and LTS functions that take these things into account, using TBD weightings.
And a further idea: local knowledge (or routing preference) is always going to be helpful. If we have a way in the UI to just annotate a road and edit the LTS / edge cost manually, then that could be super helpful.
config.json
Use case: you want to know the main areas that will benefit from investment in a particular bridge. Illustration for Waterloo Bridge:
This suggests that many of the users are coming from the south of the river to access destinations just north of the river.
I recall conversations at FOSS4G last year in Florence about ways to do this on-the-fly, that was impressive. In this case it's just returning all the routes that intersect with the view area after zooming in and clicking 'Free lines'. Not the most intuitive interface or efficient implementation, but works to illustrate the concept.
Source: https://www.pct.bike/m/?r=london
Possible reference, https://www.liedman.net/2015/04/13/add-elevation-data-to-osrm/
It's down as LTS 4 in the tool but is 20 mph living street.
Is the .ts code expecting speed in units of kph?
https://www.openstreetmap.org/way/31958493#map=19/53.80025/-1.55256
Today:
Can we re-express this with less repetition?
Also, another pattern is commuting distance from an origin, without knowing direction
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.