Curious Case with Routing in Mexico

by Roman Bilusiak, Vas Mylko

During the release of Curious Mexico we tested this “soup” of points related to the Ultimate Baja California trip:

Tijuana
Valle de Guadalupe
Ensenada, Baja California
Bahía de los Ángeles
Mulegé
San Ignacio, Baja California Sur
Loreto, Baja California Sur
Bahía de Loreto National Park
La Paz, Baja California Sur
Los Barriles, Baja California Sur
Cabo Pulmo National Park
El Pescadero, Baja California Sur
Todos Santos, Baja California Sur
Cabo San Lucas

We got a weird routing in Baja California and Baja California Sur— the routing happened via the continent, via the mainland Mexico. The reference validation with the online OSM and Google Maps showed it was our issue.

Curiosio uses its own Routing Engine, consisting of OSM, OSRM, and multiple custom components, very specific to our needs (sticking to the country borders; recognizing POIs between adjacent countries, e.g. Lake Ontario; using custom low-level configs; other IP related blocks that we are not going to describe today).

Digging into how our Routine Engine saw Baja California Peninsula confirmed that it indeed saw the gap. It saw the road but that road was not driveable-rideable. Hence, the whole segment between the two points was routed via the closest routable roads — via the continent.

How our Routing Engine saw the route

We use OSM crowdsourced data in our Routing Engine. Federal Highway 1 (BCS) became unrouteable around “San Lino, Mulegé, Baja California Sur, Mexico”.

The gap on the road

We recalled we had a similar case with California 1 in the state of California, US. There was some issue with the road in Big Sur, a small segment of it was closed. Back then we solved the issue with the newest OSM data dump. Links to the latest OSM dumps can be found at https://wiki.openstreetmap.org/wiki/Planet.osm.

Using the latest-hottest data is not always a good practice. The main reason is mistakes — contributors do a lot of useful work but sometimes they make mistakes. The secondary reason is live data — sometimes people overwrite each others’ edits — especially during the change of administrative order. The third reason is vandalism — sometimes the data is corrupted intentionally. Using two different instances could be a more robust architecture; redundancy can help to catch the anomalies.

Interactive Ultimate Baja California has been fixed. Here is a trip widget from Curiosio web site:

Widget in the Travel Stories carousel
Opened trip plan for Ultimate Baja California journey

PS.

The trip embedded via Open Graph still has the issue, as it may take up to two weeks to flush the [Medium’s] cache. The cache is somewhere on Medium servers. It caches all OG details including images and text to speed up the rendering of the stories. It does not have a manual on how to flush cache or force link scraping. Once the link is scraped, the preview can stay not updated for a day or week, or even a month. There is no info about how Medium handles OG at all. Tell us if you know, please.

Facebook has a debug tool to flush the cache for the Open Graph (OG). Facebook claims it updates (scrapes) OG details once per day. It is unclear how Medium works, hence the old route worm is still shown.

geek travel