πŸ—ΊοΈ City Route Finder

The same eight search algorithms, now let loose on real street networks pulled live from OpenStreetMap. Watch A* cut through Barcelona's grid, then watch it get lost in Venice.

Pick a mode, then click anywhere on the map β€” the nearest junction becomes your pin.

Water Parks Major road Start End Explored Explored (reverse) Route

How it works

Road data comes from the OpenStreetMap Overpass API. Every way tagged as a road inside a roughly 2 km box is downloaded, its points become graph nodes, and consecutive points become weighted edges. Only the largest connected component is kept, so no pin can land on an unreachable fragment.

Drawing the sea is harder than it sounds. OpenStreetMap does not store the Marmara or the Danube as polygons β€” open water is defined by natural=coastline lines, with the convention that land lies on the left of each way's direction. To fill it, the coastline is clipped to the bounding box and then closed by walking clockwise around the box edge, which keeps the enclosed area on the water side. Rivers and lakes that are polygons arrive as multipolygon relations instead, with their islands punched out using the even-odd fill rule.

Edge weight is either length in metres or length Γ· speed limit, using the road's maxspeed tag where it exists and a per-road-class default where it doesn't. Switching between the two changes which route wins β€” the fast road around is often shorter in time and longer in distance.

The heuristic for A* and Greedy is great-circle distance, not the Manhattan distance used on the maze page β€” and in travel-time mode it is divided by the fastest speed in the network, because a heuristic that overestimates silently destroys A*'s optimality guarantee.

Known limits: one-way restrictions and turn bans are ignored, so every street is treated as two-way. Buildings are not drawn β€” they would multiply the download size for something no algorithm reads. There is no pan or zoom yet. Rendering is plain 2D canvas: no map tiles, no Leaflet, no Mapbox, every line drawn from raw coordinates.

Back to Projects
β„Ή

About Me

I'm Doruk Orak, a 12th grade student at Sankt Georg Austrian High School in Istanbul.

My interests span hardware design, artificial intelligence, programming, and physics. Connecting the world of intelligent systems with physical circuits.