From a192f052294b88898791fbdb8591fee9b21efbe4 Mon Sep 17 00:00:00 2001 From: robinlovelace Date: Wed, 3 Jan 2024 14:55:56 +0000 Subject: [PATCH] Add basic docs to readme, close #39 --- README.md | 11 ++++++++++- examples/edinburgh/setup.py | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bf76b30..b08b3b1 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,16 @@ od2net helps you turn *o*rigin/*d*estination data about where people travel into ## How to use it -... +After you have installed the necessary dependencies (including Python, Rust, and tippecanoe), you can run the code in the [`examples/`](examples/) directory, e.g.: + +```bash +cd examples/edinburgh +python3 setup.py +cargo run --release config.json +``` + +Then navigate to https://od2net.org/ (which may redirect) and upload the resulting .pmtiles file in the outputs directory. +Note: you may need to move code in `examples/utils.py` into `examples/edinburgh/setup.py` to get it to run (see [issue #2](https://github.com/Urban-Analytics-Technology-Platform/od2net/issues/2) for details). - set up with your own data, run on your computer (directly or with docker), and compute country-wide network with millions of trips in under an hour - the quick setup route: clip a small area from OSM, use dummy OD data, tune cost function, and make route networks ending at a single point. interactive in your browser, no install required, get something in minutes diff --git a/examples/edinburgh/setup.py b/examples/edinburgh/setup.py index 8b75daa..ef33eaa 100644 --- a/examples/edinburgh/setup.py +++ b/examples/edinburgh/setup.py @@ -2,6 +2,11 @@ import json import sys +# Import code in ../utils.py: +# - download(url, outputFilename) +# - run(args) +# - extractCentroids(pbfInput, geojsonOutput, where="building IS NOT NULL") +# - writeFixedOutputFile(path, contents) sys.path.append("..") from utils import *