codereport / city-strides-hacking

Python scripts that build optimal routes for node collection
MIT License
9 stars 3 forks source link

Node Preview

image

Route Generation

7xh4u7

How to Use the Python Scripts

  1. git clone https://github.com/codereport/city-strides-hacking.git

  2. Add a file named cookies.json with the following contents:

{
    "_citystrides_session": "...",
    "remember_user_token": "..."
}
  1. Add a parameters.yaml. Example below.
city: bangkok
map_style: 'open-street-map'
max_distance: 25.0
steps: 9
hot_spots: true
hot_spot_n: 2
hot_spot_delta: 0.05
heat_map_max_length: 1
heat_map_exclude_csnodes: false
start_node: 1692740969
  1. You can now run:
    • ./download_node_csv.py cookie.json to scrape all the nodes to nodes.csv
    • ./plot_nodes.py to view all of the nodes without a 1000 node limit

How to use the Rust route generator

  1. Compile the Rust code: cargo build, this creates executable ./city_strides_route_generator
  2. Download the file data/bangkok.json and data/bangkok_all.json by querying https://overpass-api.de with the queries of overpass_queries.md (assuming you set bangkok in parameters.yaml)
  3. Call ././city_strides_route_generator

Useful Links