Skip to content

Repository files navigation

SunnySide - Sun Exposure Calculator

Calculate sun exposure on a transit trip and find out which side of the bus or train to sit on to avoid the sun.

Live demo: https://evnb.github.io/sunlight-exposure-skeleton

Features

  • Enter an origin and destination to get a side-of-vehicle recommendation (left, right, either, or nighttime)
  • Preview map showing the route and sun direction at each point along the trip
  • Shareable URLs — origin and destination coordinates are saved to the URL automatically

How it works

The user enters origin and destination, as well as departure and arrival times for the trip. Sun azimuth is calculated using SunCalc at the origin, destination, and sometimes intermediate points along the route. (Intermediate points are equidistant based on slerp.) The sun azimuth is compared against the route bearing at each point to determine which side of the vehicle the sun will be coming from. The side that appears most often across the route wins.

Geocoding and reverse geocoding are provided by Nominatim (OpenStreetMap data). Maps are rendered with MapLibre GL.

Stack

Development

npm install
npm run dev
npm run build    # production build
npm run preview  # preview production build
npm run check    # type-check

Found Resources

Resources I discovered along the way while working on this project

Sun Calculation

Geocoding

Map Rendering

Icons

Resource Lists

  • Awesome Lists, resource lists about many topics

Releases

Packages

Contributors

Languages