Skip to content

Routing optimization solution for the Knoxville Ale Trail

License

Notifications You must be signed in to change notification settings

kcavagnolo/knoxville_ale_trail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Knoxville Ale Trail

So you want to traverse the Knoxville Ale Trail but are uncertain of the best route to take? Here's a solution! Some pre-computed routes are available here. Note that raw legs of the routing solution from the Optimization API are encoded polyline which is easy to parse in JS, but GeoJSON is more portable.

version: v0.5.0

Setup

You need several Mapbox tools installed if you want to create and upload Mapbox vector tiles (mbtiles):

Alternatively, Mapbox has a tilesets CLI in beta for interacting with their new tilset source data model and a step-by-step guide.

Usage

Then run the simplistic command line script:

python3 trail.py --geocode --optimize --geojson -d data/ -vv

Convert geojson to Mapbox tile and upload to Mapbox:

python3 create_tiles.py -gd data/geojson -td data/tiles --mbtiles --upload -vv

Maintenance

Mapbox Credentials

If you're working with multiple Mapbox accounts, the scripts assume you have standard env vars like this:

export MAPBOX_USERNAME=$MAPBOX_USER_PERSONAL
export MAPBOX_ACCESS_TOKEN=$MAPBOX_ACCESS_TOKEN_PERSONAL

Local Tileserver

To inspect the tiles locally, I use TileServer GL:

docker pull klokantech/tileserver-gl
cd data/tiles/
docker run -it -v $(pwd):/data -p 8080:80 klokantech/tileserver-gl

Now navigate to http://localhost:8080/ and you'll find the interactive tileserver dashboard.

Versioning

I like the old school bumpversion:

bumpversion minor --verbose

Code Quality

  1. Install and configure Sonarqube or launch a maintained container:

    docker run -d --name sonarqube -p 9000:9000 sonarqube
  2. Setup a sonar-project.properties file with configurations for scans.

  3. Run a scan:

    sonar-scanner

TODOs

  • Add support for appointments:

     if 'elkmont' in brewery_name:
        appointment = [
            {
                "appointment_start": appt_start,
                "appointment_end": appt_end
            }
        ]
        order['appointments'] = appointment
        order['duration'] = 2.5*3600
  • Add time_windows to each location for hours of operation.

  • Add animation to markers on arrival.

  • Dig into this awesome viz

  • Seek inspiration from this design

  • Add minify of css and js

Credits

License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Creative Commons License