Disclaimer: this is a toy project to play around with open street maps, I am not following all best practices in the interest of spending more time working with the map data.
- Install Java 21, for instance Corretto JDK.
- Place your
.osm
file(s) in the resources. The OSM filetype is ignored in Git, so you don't accidentally dox yourself.
In the current form running this code is a bit cumbersome.
- Download a map from OSM. A map for a city can easily be accessed here (but beware of the size of the dataset, Boulder is nicely sized).
- Place the map here.
- In the map data, find two nodes you want to route between. This is easiest by looking for
way
element with a particular street name, and taking a node from that way. - Run the main and supply the IDs when prompted. For instance, in Boulder we can go from
176481828
to7590743835
.
Some thoughts one interesting concerns.
- Split a
RoutePresenter
class out of the main. - Find start and end node by street name.
- Traversability of ways per mode of transport. Easiest is to assume any way is valid, but we should separate this concern in a neat way later.