Skip to content

WindsorEssexCycling is a bicycle-oriented map maintained by Windsor Hackforge as part of the City-County Cycling Tech (C3Tech) initiative, built on top of OpenStreetMap data. It aims at providing a beautiful and practical map for cyclists, no matter their cycling habits or abilities.

License

Notifications You must be signed in to change notification settings

hackf/WindsorEssexCycling

Repository files navigation

WindsorEssexCycling

WindsorEssexCycling is a bicycle-oriented map maintained by Windsor Hackforge as part of the City-County Cycling Tech (C3Tech) initiative, built on top of OpenStreetMap data. It aims at providing a beautiful and practical map for cyclists, no matter their cycling habits or abilities.

The website can be view at: windsoressexcycling.ca.

Development

An LTS version of nodejs and npm is required to run the development server.

Create a file called .env in the project root with contents:

Check out Vite's documentation for more information on how it handles env variables

VITE_BROUTER_ENDPOINT=http://127.0.0.1:17777

This assumes that you're running a standalone brouter server using the steps found below in the Standalone BRouter Server section.

To install the dependencies and start the dev server, execute the following commands:

npm ci
npm run dev

Production

To compile the production build, execute the following commands:

npm ci
npm run build

A simple web server can be used to test the build by executing the following command:

npm run preview

Standalone Brouter Server

This section is geared towards documentation how to configure and run the Brouter HTTPServer. This server is used to provide routing information.

Building the docker image

The docker image requires two build arguments, LAT and LNG. These arguments are used to download a segment of the world that will be used by Brouter to provide routing. As of right now, the docker image only downloads one of these segment files because all of the WE area is contained in one slice. For WE the values are: N40 and W85. Go here if you'd like to see what other segments are available. The routing segment files provisioned by Brouter are organized in a 5*5 degrees, with the filename containing the southwest corner of the square. The docker image will download the required segment file and place it there Brouter expects it to be located. Below is an example on how to build the Brouter image:

docker build -t brouter-server:N40_W85 --build-arg LAT=N40 --build-arg LNG=W85 .

Running the container

To run the Brouter routing server container, run the following command:

docker run --rm --name brouter -it -p 17777:17777 brouter-server:N40_W85

Testing custom profiles

Custom profiles can be found in the brouter_profiles directory in the project root. These profiles are tailored to work while within the Windsor Essex Area.

To test modifications to these profiles or to test new profiles, place the files into the brouter_profiles or into another directory on your system. Using the command below will override the custom profile directory.

If you're using a different directory then brouter_profiles, make sure to update the volume command below to point to that directory.

docker run --rm --name brouter -it -p 17777:17777 -v "$(pwd)"/brouter_profiles:/opt/brouter/profiles2/custom
profiles/ brouter-server:N40_W85

Brouter doesn't seem to pick up on changes to the profiles. So it's best to restart the server every time changes to the custom profiles are made.

Verify that the server is running

The complete set of API end points exposed by Brouter server are documented here. An example url for Windsor-Essex is:

http://127.0.0.1:17777/brouter?lonlats=-82.992005,42.303384%20|-82.989140,42.306258&nogos=&profile=trekking&alternativeidx=0&format=geojson

This gives the url can be polled to get the routing directions in the form of a geojson.
A sample response looks like :

GeoJSON payload example ```json { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "creator": "BRouter-1.6.3", "name": "brouter_trekking_0", "track-length": "547", "filtered ascend": "0", "plain-ascend": "0", "total-time": "82", "total-energy": "8198", "cost": "810", "messages": [ [ "Longitude", "Latitude", "Elevation", "Distance", "CostPerKm", "ElevCost", "TurnCost", "NodeCost", "InitialCost", "WayTags", "NodeTags", "Time", "Energy" ], [ "-82992930", "42305037", "187", "199", "1150", "0", "0", "0", "0", "reversedirection=yes highway=residential surface=asphalt", "", "21", "2139" ], [ "-82987893", "42304117", "187", "348", "1150", "0", "180", "0", "0", "highway=residential surface=asphalt", "", "81", "8198" ] ], "times": [ 0, 21.396, 39.375, 56.411, 68.127, 79.813, 81.968 ] }, "geometry": { "type": "LineString", "coordinates": [ [ -82.991890, 42.303424, 188.5 ], [ -82.992930, 42.305037, 187.0 ], [ -82.991955, 42.305383, 188.5 ], [ -82.991015, 42.305712, 189.0 ], [ -82.990178, 42.306024, 188.0 ], [ -82.989306, 42.306333, 187.5 ], [ -82.989237, 42.306224, 187.5 ] ] } } ] } ```

About

WindsorEssexCycling is a bicycle-oriented map maintained by Windsor Hackforge as part of the City-County Cycling Tech (C3Tech) initiative, built on top of OpenStreetMap data. It aims at providing a beautiful and practical map for cyclists, no matter their cycling habits or abilities.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published