In brief:
- AI does not plan routes or generate data — it understands your question and passes it to the same computational tools that the On Trail app has used for a long time.
- Routes are calculated by the A* algorithm on an OpenStreetMap trail graph. Elevations come from NASA data (SRTM). Weather — from Meteoblue. Avalanche danger — from official EAWS bulletins.
- Where can AI get things wrong? When suggesting a starting point (if you don’t specify one), in textual descriptions, and in practical advice. Numbers and data from tools are reliable — treat AI’s text as guidance.
- No app replaces common sense. Make your final decisions on the trail yourself.
Artificial Intelligence as a Translator, Not a Navigator
Many users rightly ask: „Can I trust a route planned by AI?”. This is an important question, because language models can generate responses that sound convincing but have no basis in reality — so-called hallucinations. In On Trail, we solved this problem at its root: AI does not plan routes. AI only understands what you’re looking for.
When you write to Chat AI: „Plan a hike from Morskie Oko to Rysy”, the language model does not draw a route on the map. Instead, it recognizes your intent — identifies destination points, activity type, preferences — and passes this information to specialized computational tools that do the actual work.
Importantly, these same tools have been available in the On Trail app for a long time — place search, route planning, weather forecasts, avalanche danger information. Until now, you accessed them through buttons, lists, and forms. Chat AI does not introduce new, unproven mechanisms — it simply makes it easier to access the same proven features. Instead of several clicks and switching between screens, you describe your need in a single sentence, and AI selects the right tools for you.
Architecture: Separating Intent from Computation
At the heart of Chat AI is a tool-calling architecture. This means that the language model never generates data on its own. Instead:
- Understands the question — analyzes the user’s text and recognizes the intent (e.g., „I want to hike from point A to point B on Saturday”).
- Invokes tools — based on the understood intent, activates the appropriate computational modules: place search engine, routing engine, weather service, or avalanche safety module.
- Presents results — formats the received data (distance, elevation gain, time, weather conditions) into a clear response.
At none of these stages does the AI model „make up” data. Every number, every route parameter comes from a verifiable source.
Route Planning — The A* Algorithm and Trail Network
The most important component of the system — route planning — is based on the classic graph algorithm A* (A-star), known since the 1960s and widely used in navigation systems, robotics, and computer games.
How Does the A* Algorithm Work?
A network of hiking trails can be represented as a graph — a mathematical structure composed of nodes (trail intersections, peaks, mountain huts) and edges (trail segments connecting these points). The A* algorithm searches this graph intelligently:
- It starts from the starting point and explores neighboring nodes.
- For each node, it calculates the cost of arrival (based on distance, elevation gain, terrain type) plus the estimated cost to the destination (distance heuristic).
- It always selects the most promising node — the one with the lowest total cost.
- It guarantees finding the optimal route, provided one exists in the trail network.
This is not an approximation or „guessing” — it is an algorithm with a mathematical proof of optimality, used in systems where safety is critical.
Cost Function — Intelligent Terrain Weighting
The algorithm does not simply search for the shortest path. The cost function takes into account:
- Activity type — hiking, ski touring, and cycling routes have different surface preferences.
- Road type — hiking trails are preferred over roads open to motor vehicle traffic, which receive a higher traversal cost.
- Access restrictions — seasonal trail closures (e.g., „closed from November 1 to May 1”) are verified against the planned departure date.
- Terrain difficulty — the system recognizes and classifies difficulty according to the SAC scale (T1–T6), an international standard for alpine trail difficulty.
Map Data — OpenStreetMap
The trail graph traversed by the algorithm is built from OpenStreetMap (OSM) data — the world’s largest open cartographic database. OSM is created and updated by a community of over 10 million volunteer cartographers from around the world.
OSM data includes:
- Trail routes with precise GPS coordinates.
- Trail attributes — surface type, difficulty, markings, access restrictions.
- Points of interest — peaks, mountain huts, passes, parking areas, water sources, and hundreds of other categories.
- Metadata — multilingual names, Wikipedia links, elevation above sea level.
OSM data is used by many recognized cartographic and navigation services worldwide, confirming its reliability and completeness.
Elevation Model — SRTM with EGM Correction
Terrain elevations, elevation profiles, and slope calculations are based on data from the SRTM (Shuttle Radar Topography Mission) — a NASA and NGA (National Geospatial-Intelligence Agency) project from 2000, which used radar interferometry to map the terrain of nearly the entire Earth at a resolution of 1 arc-second (~30 meters).
What Is the EGM Correction?
GPS receivers report altitude relative to the ellipsoid — a simplified mathematical model of Earth’s shape. However, altitudes on hiking maps and in everyday life refer to the geoid — sea level. The difference between the ellipsoid and the geoid can range from -100 to +85 meters depending on location.
EGM (Earth Gravitational Model) is an Earth gravitational field model developed by the NGA that allows conversion of ellipsoidal heights to heights above sea level. Thanks to this correction, displayed elevations correspond to those you will find on physical hiking maps and information boards on trails.
Weather Forecast — Meteorological Data, Not Generated Text
When Chat AI provides weather information, it does not generate descriptions based on statistical language patterns. It retrieves real forecast data from the professional meteorological service Meteoblue, which provides:
- Hourly and daily forecasts for 7 days.
- Temperature, precipitation, wind speed, and wind gusts.
- Sunshine hours, UV index, snow fraction in precipitation.
- Automatic warnings about dangerous conditions: thunderstorms, strong winds (above 60 km/h), heavy rain or snowfall.
The forecast takes into account the exact location and elevation of the destination point, which is crucial in the mountains, where conditions change dramatically with every 100 meters of altitude.
Avalanche Danger — EAWS Data
During winter season, Chat AI has access to official avalanche danger level data on a 1–5 scale published by avalanche services affiliated with EAWS (European Avalanche Warning Services). The system automatically identifies which avalanche region the planned route falls within and retrieves the current bulletin — instead of guessing based on the season or weather.
Place Search — Fuzzy Matching, Not Generative
When you type the name of a peak or mountain hut, the system does not try to „guess” which place you mean. It uses a fuzzy matching algorithm based on Levenshtein distance — a mathematical measure of string similarity. This allows it to:
- Tolerate typos and minor spelling errors.
- Search an index of thousands of places across 21 mountain regions.
- Rank results by name accuracy, place popularity, and distance from the user.
Every found place has specific GPS coordinates, elevation, type, and a database identifier — it is not „generated” by the language model.
Summary: Where Is AI and Where Is Science
| Element | Data Source | AI Role |
|---|---|---|
| Understanding the question | — | Yes — user intent interpretation |
| Route planning | A* algorithm + OSM trail graph | No — result of algorithmic computation |
| Elevation profile | SRTM + EGM correction | No — NASA mission data |
| Weather forecast | Meteorological service | No — real forecast data |
| Avalanche danger | EAWS | No — official bulletins |
| Place search | Levenshtein algorithm + OSM index | No — algorithmic matching |
| Difficulty, time, terrain | Routing algorithm (SAC, time, trail features) | Constrained — AI presents tool data, rules forbid subjective assessments |
| Results presentation | — | Yes — formatting and description |
The AI model serves as an intelligent interface — it understands natural language and coordinates the work of specialized tools. All data, calculations, and safety recommendations come from proven scientific and algorithmic sources. This means Chat AI responses are as reliable as the data they are based on — not as reliable as what „seems right” to a language model.
Where AI Can Get Things Wrong
The sections above describe the parts of the system where AI does not generate data on its own. However, there are situations where the language model creates content based on its general knowledge — and that is where it can make mistakes.
Suggested Starting Points
When you write „Plan a hike to Giewont” without specifying where to start, AI has to suggest a starting point on its own. It selects candidates based on the model’s general knowledge — e.g., „Kuźnice” for Giewont — and then verifies each suggested place in the trail database using the search engine. This means AI will not suggest a place that does not exist in the system. However, it may choose a starting point that is logistically suboptimal — e.g., far from parking or public transport, or less popular than the trailhead most hikers actually use.
Tip: By specifying both a starting point and a destination in your query, you eliminate this type of uncertainty — AI does not have to guess.
Textual Descriptions and Interpretations — Built-in Safeguards
Data from tools (distance, elevation gain, estimated time, temperature) is accurate. Without proper safeguards, AI could add information inconsistent with system data when formatting results — e.g., describe a T3 route as „easy,” suggest a hiking time from its own judgment, or describe trail scenery from imagination.
To prevent this, the system includes explicit rules that constrain the language model’s freedom in three key areas:
- Route difficulty — AI cannot use subjective terms („easy,” „family-friendly,” „demanding”) without referencing the specific SAC scale grade (T1–T6) returned by the route planning algorithm. Instead of „this is an easy route,” it will say „this is a T1 route — a well-marked wide path.”
- Estimated time — AI must present only the time calculated by the routing algorithm. It cannot estimate time based on its own knowledge of distance or elevation gain. If the algorithm did not return a time — AI does not provide one.
- Trail character — AI does not describe scenery, vegetation, views, or landscape based on general knowledge (e.g., „the path leads through a picturesque forest”). It describes only characteristics present in system data: SAC difficulty, chains and rungs, river crossings, access restrictions. If you explicitly ask about trail character, AI may answer, but will clearly note that the information comes from general knowledge.
Practical Advice
When AI adds recommendations about equipment, the best time of day to start, or the seasonality of a route, it relies on the language model’s general knowledge. Such advice may be accurate, but it does not carry the same guarantee as algorithmically computed data.
How to Tell the Difference?
As a general rule: numbers and data (distance, elevation gain, time, temperature, avalanche danger level) come from tools and are reliable. Meanwhile, starting point suggestions and practical recommendations are generated by the language model and should be treated as guidance, not certainties.
Important Disclaimer
The On Trail app — including the Chat AI feature — does not replace an experienced mountain guide, your own situational awareness, or common sense. Planned routes, weather forecasts, and trail condition information should serve only as helpful guidance for planning.
Before heading out on the trail and during your hike, always:
- Adjust the route to your skills and physical fitness — the SAC difficulty scale is an objective terrain classification, but your readiness for a given section depends on your experience, equipment, and condition on the day.
- Follow current trail markings — closures, warnings, and redirections on site take precedence over any app.
- Respond to prevailing conditions — mountain weather changes rapidly. A forecast from a few hours ago may already be outdated.
- Bring appropriate equipment and do not venture alone on difficult trails without experience.
No app knows your current capabilities as well as you do. Use Chat AI for planning, but make your final decisions on the trail yourself.
