calculate ways instead of drawing or: a look at "osm-makeroads" https://api.openstreetmap.org/user/malenki/diary/17976