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.
An LTS version of
nodejs
andnpm
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
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
This section is geared towards documentation how to configure and run the Brouter HTTPServer. This server is used to provide routing information.
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 .
To run the Brouter routing server container, run the following command:
docker run --rm --name brouter -it -p 17777:17777 brouter-server:N40_W85
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.
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 :