Analysing a route w...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

Analysing a route with AI

50 Posts
17 Users
44 Reactions
1,502 Views
Posts: 241
Free Member
Topic starter
 

I would like to upload a GPX file and have AI analyse it to tell me things like:
1) What towns it passes through, do they have shops, what is the population
2) Hotels on the route
3) Campsites
4) Altitude

Etc

Anyone done this?


 
Posted : 03/01/2025 9:32 pm
Posts: 241
Free Member
Topic starter
 

Best I can find so far is exporting to text with GPS Visualiser then pasting into ChatGPT
It's very limited. I am less scared of AI after this.


 
Posted : 03/01/2025 10:04 pm
gecko76 and gecko76 reacted
Posts: 1786
Full Member
 

No idea whether that is possible but I've got to ask: why?

There are plenty of ways to import GPX files into a myriad of websites or apps which will show you the data (maybe not population!)

I could only see the usefulness of such a feature if you have a HUGE amount of GPX files to compare and optimize, or the route itself is exceptionally long...


 
Posted : 03/01/2025 10:38 pm
ngnm, matt_outandabout, ngnm and 1 people reacted
 Aidy
Posts: 2941
Free Member
 

I was trying to do something similar last year, I don't think there's any out of the box solutions really. For your kind of questions, I think it should be pretty solvable with non-AI methods, but I really wanted it to generate routes based on various parameters.


 
Posted : 03/01/2025 11:56 pm
MarkE25 and MarkE25 reacted
Posts: 241
Free Member
Topic starter
 

To answer on the "why?", it's a 500 mile ride in Spain. I'd like to get a list of the towns it passes through and whether there is a shop etc, I can write this down and refer to it to plan refuel, sleeping, timing daylight with getting over mountains.

I can absolutely do it myself by studying ride with GPS/Google maps. In fact, this is what I usually do

I was hoping though that AI could do this for me, by analysing the route and cross referencing against shops open, restaurants, hotels etc. I was even hoping it could include data like which are the cheapest hotels, the ones that take bikes.

I was also interested in whether it's possible. I've seen AI do many things like this at work, but not with GPX routes.

I would guess in 5 years or sooner , it'll be there! In the meantime I should just enjoy being old fashioned 🙂


 
Posted : 04/01/2025 12:24 am
Posts: 957
Full Member
 

Well I just got some results using chat GPT. I started by asking this

"Can I upload a gpx file for you to tell me about the route it takes?"

I uploaded a Carlisle to Hamilton gpx.

After a few more questions it's given me a list of cafes and shops on route, however some were several miles off route, so I asked for cafes and shops within 1 mile of the route but I've now "reached my data analytics limit for today", so need to upgrade or wait.

It looks possible to get info you need but you'll defo need to apply human intelligence to the output to validate it.


 
Posted : 04/01/2025 8:46 am
Posts: 7433
Free Member
 

Problem with using chatgpt for stuff like this (pretty much anything) is that (by design and intention!) it just makes up something that looks like a plausible answer. That's literally what it was created to do. So then if the truth of the output actually matters, you have to go and check it anyway. As you have found.

If you just want something that looks convincing, it's great. I recently used one of the picture generators to create an image, using a couple of prompts, similar to a stock image but better than I could easily find on the interweb. That I then used as the headline image for a blog post. I didn't use chatGPT to generate the content of the post however!

This chatbot stuff is really pernicious nonsense that is ruining the internet and will ruin society if we aren't careful. Yes I know I sound like a grumpy old man. That's because I am one!


 
Posted : 04/01/2025 8:56 am
ngnm, tillydog, Earl_Grey and 3 people reacted
Posts: 20169
Full Member
 

This chatbot stuff is really pernicious nonsense that is ruining the internet and will ruin society if we aren’t careful. Yes I know I sound like a grumpy old man. That’s because I am one!

+1.

At its worst, you'll be midway through your 500-mile tour of Spain aiming for the next place where some AI bot has confidently informed you there'll be a load of shops, cafes etc and you find a one-horse town where even that one-horse is fast asleep.

I think AI has its uses although most of them are not the uses that people keep trying to shoehorn it into doing. And for a long tour in a country I didn't know well, I'd absolutely never be relying on it!


 
Posted : 04/01/2025 9:04 am
tillydog, Tom-B, prettygreenparrot and 3 people reacted
Posts: 2616
Full Member
 

Perhaps if you load the route in to Google maps which is easy via 'my maps' then ask your ai tool to analyse that.


 
Posted : 04/01/2025 9:08 am
Posts: 957
Full Member
 

@thecaptain My experience of AI to date is that how successful it is depends very much on what you use it for and what you do with the output.

When solving a problem like this route planning one with a human, you'd be wise to validate their responses too before embarking on your trip, in the same way as you'd need to do with AI output.

Quite possibly, if you ask a human to help with this problem you'd probably get talked into cycling in another country based on some positive experiences they once had there!


 
Posted : 04/01/2025 9:37 am
Posts: 1844
Full Member
 

Isn't part of the fun to set off and see whats there?


 
Posted : 04/01/2025 9:46 am
Posts: 15261
Free Member
 

I guess there comes a tipping point where the time it takes to refine the queries and validate the outputs starts to get close to the amount of time it would take to throw the route into Google maps (or similar) and look at the POIs and towns along the route for yourself...

Here's a question, can you tweak a route with things like Basecamp or ride with GPS to flag/alert you for specific POIs along the route? Must be possible.


 
Posted : 04/01/2025 9:58 am
Posts: 219
Free Member
 

As someone who at times works in this space: that's not what "AI" - specifically, the language models you're describing - do. Clarifying is slightly fiddly, and probably boring, but it's also important to debunk some of the magic you're imagining is possible. The key question is: "how would they find those things out?"

When you throw XML (a GPX file) at this stuff, it sometimes can make a decent stab at interpreting it, but it's not parsing it particularly well; it's reading it like it's text. Secondly: ChatGPT isn't asking the Internet anything. It's not a search tool, and it doesn't do a great deal of programattic stuff without you specifically commanding it in certain ways (specifically, the Code Interpreter mode). So once you've thrown a GPX file at it, how on earth is it going to look up what's nearby? It's not making API calls to geo services (yet), it has no idea of what's nearby. At some point, it read quite a lot of the Internet, so picking up on placenames and "remembering" things nearby is sort-of possible.

The usual question to ask is: "well how would a computer do this anyway" and it's a really tricky question: GPX is just points and paths in space, so working out what settlements/roads that coincides with involves doing a lot of lookups in a gazetteer, then you're searching for things in towns in another space, and then you have to start looking up hotels etc possibly elsewhere. None of that is made easier, or more doable, because of a language model (other than maybe "help me write the code to do this"). In general, tasks that involve multiple instances of "and then" are hard.

You might go, "dude, shut up about all this computer crap, I just wanted to ask the magic box a question" (which is reasonable: I don't think anybody using stuff should have to think about it in this way) but my point is the way this is discussed by *waves hands* the media, culture, and sometimes the companies that make this stuff, is like it's a magic black box, which is amazingly unhelpful for anyone then trying to work out what it can do, and leads to lots of people in lots of walks of life trying to slap "AI" on things that it just won't help. The fact is it's mainly a very interesting engine for processing data and making similarly-shaped predictions, which is really powerful/unusual in lots of ways (summarisation, OCR, explanation, synthesis), but it's hilariously limited in others, and in this case it just won't do the the thing you want. It is not end-users fault they make this confusion, because most of the time, that's what's been marketed to them.

More to the point: if it looks like it's doing this task, I wouldn't trust it. Check that recommendations a) are where they say they are, b) are still open and c) actually exist in the first place.


 
Posted : 04/01/2025 10:03 am
ngnm, submarined, ossify and 11 people reacted
Posts: 1513
Free Member
 

Cycle.travel will show you campsites and hotels along a route. Not AI but quite useful.


 
Posted : 04/01/2025 10:08 am
doris5000 and doris5000 reacted
Posts: 45504
Free Member
 

Is some of the fun of planning and en-route to be able to see a map and think 'that looks a nice viewpoint / wee road / local hill to climb / castle to visit / etc' and adjust your route in planning. This is both in the weeks before starting and day to day on the route.

"AI" will regurgitate the mass tourism options, the promoted places and the "advice" of other visitors who are not familiar with the region, but want to be influencers.

Yeah, I'm not convinced it would be good, and in fact think it could detract from a cycling experience.


 
Posted : 04/01/2025 10:09 am
Posts: 1513
Free Member
 

I asked an LLM (AI is marketing bollocks) whether there was somewhere to reassemble my bike in Rome airport and it just made up a very convincing answer.  Don’t trust them if you need facts of any kind.


 
Posted : 04/01/2025 10:11 am
 zomg
Posts: 850
Free Member
 

I would guess in 5 years or sooner , it’ll be there! In the meantime I should just enjoy being old fashioned ?

I think it’s more likely that in five years the sources which are currently fairly reliable online will have been polluted by LLM hallucinations and will have got a whole lot worse.


 
Posted : 04/01/2025 10:22 am
Posts: 241
Free Member
Topic starter
 

Wow! Some great responses there.

@infovore, your answer was truly enlightening.  Appreciate the time you took to write that out. You've corrected a misunderstanding I had about these AI chat bots, I really did think they were plugging into things other than their trained database. "Prompt engineering" may get some forced reply I understand but I'll go old fashioned and just research it all manually. I can hack my way around python, I'll have a look at using that to write my own analyser.

Good points from all about not relying on it, I certainly wouldn't do that. I'd not normally bother too much with detailed planning but there's a time cut off on this route so I want to get forensic on where I can sleep, resupply, time my ride to get over sparsely populated areas in daylight etc.

Thanks all!


 
Posted : 04/01/2025 12:05 pm
Posts: 20169
Full Member
 

Good points from all about not relying on it, I certainly wouldn’t do that. I’d not normally bother too much with detailed planning but there’s a time cut off on this route so I want to get forensic on where I can sleep, resupply, time my ride to get over sparsely populated areas in daylight etc.

Is it Badlands by any chance?


 
Posted : 04/01/2025 1:35 pm
Posts: 241
Free Member
Topic starter
 

@crazy-legs

I didn't get a place on badlands. That was my first choice.

I'm doing "el piri" ultra event (not a race) out of Girona. It looks truly amazing! Bit worried about my capability for it, hence I'm trying to prepare everything.

I won't be using AI though, the responses here are the voice of sanity 🙂


 
Posted : 04/01/2025 1:58 pm
 Aidy
Posts: 2941
Free Member
 

Scanning a 500mile fixed route for resupply etc. options isn't too painful. I kinda like Strava's routing for that, if you load up a route and scan along it, there's POI for shops/water/cafes etc.


 
Posted : 04/01/2025 2:03 pm
 Aidy
Posts: 2941
Free Member
 

I’m doing “el piri” ultra event (not a race)

It's always a race


 
Posted : 04/01/2025 2:06 pm
Posts: 241
Free Member
Topic starter
 

@aidy thanks, checking that out now along with the other suggestions.

Stw has outperformed AI!

Yes it probably will be a race 🙂


 
Posted : 04/01/2025 3:05 pm
Posts: 20169
Full Member
 

As @aidy says, Strava has those POI already, Ride With GPS has a similar capability:

https://ridewithgps.com/routes/46532762

That's the El Piri route with notes made concerning remote sections, busy roads etc. I don't know that one although I've done a bit of road / light gravel around Girona - for what it's worth, I never thought I was *that* far from civilisation around there although I appreciate that's a relative term. 50km on a fully working bike on a decent road is very different to 50km on a broken bike via a steep mountain pass with limited water...

I know most of the Badlands route and there are bits of that which you really don't want to go into with anything less than lots of full water bottles!

Honestly, with any of these bikepacking routes, you'll gain loads more info from reading blog posts and looking at the photos than any AI could ever give you. And if in doubt, restock!


 
Posted : 04/01/2025 3:44 pm
Posts: 241
Free Member
Topic starter
 

Thanks @crazy-legs 
That's the route I've been looking at - I am looking at the videos/blogs/Google Maps too, got the lurgy so a lot of time on my hands today! There is a good one from watt wagon and a few others who've done it. The last thing I did like this I had a piece of paper with all the info on towns, remote sections strapped to my top tube, hoping to do the same on this.  The organisers of El Piri say you're never further than 50k from a town or something but yeah that's a long walk if something bad happens!


 
Posted : 04/01/2025 4:34 pm
 Aidy
Posts: 2941
Free Member
 

I've ridden a bit around that area too. fwiw, I don't remember resupply being *too* much of a challenge around there, but that's sorta in comparison with the rest of the Pyrenees, where resupply can definitely be troublesome.


 
Posted : 04/01/2025 7:46 pm
Posts: 241
Free Member
Topic starter
 

Reassuring, thanks @aidy!

Does look a good area to ride and camp


 
Posted : 04/01/2025 10:40 pm
 Aidy
Posts: 2941
Free Member
 

Yeah, the Pyrenees are stunning - I'm sure you'll have a great time


 
Posted : 04/01/2025 10:48 pm
Posts: 2304
Full Member
 

Just to add my 2p to those saying "don't trust the output!!!", I've found with a few queries that it often gives answers that are 95% correct and then has some made-up rubbish hiding in there. Or it's missed something out. This is more of a problem than getting some obvious garbage result. I wouldn't trust it as far as I could throw it for something like this. Overall though, as infovore says, used correctly it's great.


 
Posted : 05/01/2025 10:48 am
Posts: 241
Free Member
Topic starter
 

Totally agree @ossify. Following the comments here I've done more research and because of factors such as marketing, "well intentioned belief", failure to test effectively, insufficient input data, nuances of variables etc I've really lowered my expectations of  most of what is termed AI considerably.

In fact, my suggested use case probably isn't even for AI to do. It doesn't require creative skills, it doesn't generate its own solution or adapt to new scenarios. I think this was a point infovore might have been getting at: Consider the task and test the steps against what might be termed AI.

Really appreciate all the answers, I've had a mini AI epiphany as a result!


 
Posted : 05/01/2025 3:47 pm
 Ewan
Posts: 4336
Free Member
 

Playing with AI is my day job. Just to answer the question in a round about way, I probably would use ai to answer the question, but rather than say "what's along this route" I would ask it to knock up some python code to compare the route to a database of towns / villages (Csvs with this information seem easy to find)  within some defined distance of the route. Id then probably use search grounding in Google Gemini or something to do a profile on each town. Id see how well that worked and fall back to a poi database if it wasn't great.

My python is not great but feel confident that with AI (use cusor)  I could knock that up in an hour or so. Possibly less. (As in it'd work for any arbitrary route rather than a specific route).


 
Posted : 05/01/2025 5:19 pm
Posts: 150
Free Member
 

How to find places along a GPX route in Python using Overpass API and Google Maps Places API

You could do the same in QGIS using Overpass to provide the POI's.


 
Posted : 05/01/2025 6:21 pm
Posts: 241
Free Member
Topic starter
 

Thanks @ewan, hadn't seen cursor.ai before.

Does sound like the best use of  generative AI given it's pretty good at knocking up a starter for ten code base which I can hack and test.

Then the real work is going to be done by a good old fashioned program calling trusted data sources. I'm working out if I have the energy to do it, I've almost completed doing it using ride with GPS.


 
Posted : 05/01/2025 6:29 pm
Posts: 241
Free Member
Topic starter
 

@gregsd just seen your post, thanks, looks great. I probably will have a go just for fun!

Edited to add: that page link is so good!!


 
Posted : 05/01/2025 6:30 pm
 Ewan
Posts: 4336
Free Member
 

I was bored after the kids bedtime:

https://github.com/mrhoney81/routethink

So far it will take a GPX route:

breaks it into chunks if it's a long route (like 500k or whatever)

creates a buffer round the route (user definable, defaults to 500m)

finds all the settlements defined as village or larger (hamlets and such nonsense are excluded)

takes each settlement and queries whether there are any shops or campsites within 500m of the centre of the settlement.

dumps it into a csv and a html where you can click on the links and have it open up google maps.

E.g. for a random 130km route to Glastonbury from near Newbury.

Seems to work!

https://github.com/mrhoney81/routethink

This took less than an hour and I didn't write a single line of code. The age of custom software is very close...


 
Posted : 05/01/2025 7:18 pm
 Ewan
Posts: 4336
Free Member
 

I think now i've (/the AI) built that, I actually steered it in the wrong direction. I focused on finding the settlements and then finding the POIs near those settlements - now i've seen how the APIs work, I should have just created searched the polgon for the POIs of interest rather than those near the settlements. Most of the time you wouldn't care if the campsite is in a village or not.... e.g. in my example it finds no campsites in Glastonbury, because it's querying 500m from the centre of Glastonbury - they're all on the outskirts.


 
Posted : 05/01/2025 7:22 pm
Posts: 241
Free Member
Topic starter
 

Incredible! Thank you! Mind = blown.

Generative AI for coding does seem like a thing that works well.


 
Posted : 05/01/2025 7:31 pm
 Ewan
Posts: 4336
Free Member
 

Well in the 13 minutes since I posted that, I just gave it the code based i'd already written and said actually i've over complicated this just create and search a buffer zone for the actual POIs - and it did it. Much better approach actually.

Updated the git, but now it looks along the route (500m by default each side) and finds all the department, grocery, supermarket and campsites. It then finds the nearest gpx point to that (to find how far along the route it is) and then uses that to order them. Should work well in spain since OSM is good there (better than the offical maps in my experience of climbing!)


 
Posted : 05/01/2025 7:40 pm
Posts: 241
Free Member
Topic starter
 

I love it. Can't wait to run it later!

And get cursor.ai on it myself!

Thank you for opening my eyes to this


 
Posted : 05/01/2025 7:45 pm
 Ewan
Posts: 4336
Free Member
 

Forgot you wanted altitude as well. I've added that and the nearest settlement to each POI

Edit: it's the better_search_poi.py that is the one you want (unless you want to go down the rabbit hole of my first approach).


 
Posted : 05/01/2025 7:49 pm
 Ewan
Posts: 4336
Free Member
 

Was about to write a readme file on how to install and use it, then realised I could get the AI to do that as well (lol) - so there's instructions now.

Whilst this is my day job (not coding but working out how to apply AI to my company) it is remarkable how quickly this stuff has come on. The coding stuff rarely makes a mistake now and is very adept at fixing it's errors, and tools like cursor make it significantly better (mainly because they remove the pain of adding the relevant code to the context window and then applying to the existing code).

It's certainly no expert level coder (yet, but the trajectory is heading that way rapidly), but most coders aren't either, and it's better than the average grad who's been told to write some python!


 
Posted : 05/01/2025 7:59 pm
 Ewan
Posts: 4336
Free Member
 

Ok last update (my wife has finished putting child no. 2 to bed now!)....

I've added an interactive map, where you can click on the link and it zooms into the shop or whatever, also provides a link to google maps so you can look at the satellite if you want (I would 100% be verifying my campsites at least!).

Hope that was helpful - was fun!


 
Posted : 05/01/2025 8:18 pm
Posts: 241
Free Member
Topic starter
 

Just seen your update - wow!
Thank you!


 
Posted : 05/01/2025 8:28 pm
Posts: 241
Free Member
Topic starter
 

Version one looked like this for me - exciting!

Distance (km) Name Type Elevation Nearest Settlement Location
0.04 km Oriell bakery [80.0]m Sant Gregori (village, 5.58km) 41.98263, 2.822857
0.04 km Rigo butcher [80.0]m Sant Gregori (village, 5.5km) 41.984293, 2.8222262
0.04 km Pecat Original supermarket [79.0]m Sant Gregori (village, 5.53km) 41.9845461, 2.8226186
0.04 km nan supermarket [79.0]m Sant Gregori (village, 5.52km) 41.9845254, 2.822547

 
Posted : 05/01/2025 8:31 pm
 Ewan
Posts: 4336
Free Member
 

No worries! Let me know all the ways it doesn't work lol (in case it's not obvious nan means that no value is held for that variable - e.g. if OSM doesn't have the name of the butcher it'll write nan).


 
Posted : 05/01/2025 8:35 pm
Posts: 241
Free Member
Topic starter
 

Thanks - I remember now that something like pandas does that nan thing now you mention it!
I've got your code base up in cursor ai, I changed the measurements to imperial just to see how it all works.
Initially I got an error, I pasted the error into the chat and it offered up a fix which I accepted.

And asked for changes like this -

Make the ignore two parameters - ignore first x miles and ignore last x miles

"I'll modify the code to make the ignore distances configurable parameters. We'll add them to the main function and pass them through to where they're needed. I'll modify the code to make the ignore distances configurable parameters. We'll add them to the main function and pass them through to where they're needed."

It's just...brilliant!!!


 
Posted : 05/01/2025 8:59 pm
Posts: 241
Free Member
Topic starter
 

I will refine it a bit more then check it against a real map before trusting it of course 🙂
(Thinking I'll add hotels, compress to a list, look for some more API's like population count on towns, add a "handlebar print" mode that kind of thing!)

Wow, just wow!!


 
Posted : 05/01/2025 9:13 pm
 Ewan
Posts: 4336
Free Member
 

Nice! Feel free to submit the changes to the GitHub. That's all integrated in cursor too.


 
Posted : 05/01/2025 9:40 pm
Posts: 241
Free Member
Topic starter
 

I will do cheers!

I'm thinking to ask it to put all the parameters in a toml configuration file and a few other things!


 
Posted : 05/01/2025 10:05 pm
Posts: 8771
Full Member
 

This is quite interesting!

I recently dabbled with Python for the first time to process bike rides within Golden Cheetah (a ride/HR/power/data analyzer for desktop pc/mac).

I wrote some code to determine if a ride was a commute, and which direction it was in (ie to work, or, back home) - quickly discovered something more sophisticated than a series of if statements comparing coordinates within a rectangle was needed! Searching online gave me the Haversine Formula the code of which can be found on stackoverflow (note: be careful of the order of lat/lon).

Other rides and runs were filled in with generic data, and in some instances the bike could be determined from this also.

Would be quite good to automatically fill in the route field with settlements such that rides could then be filtered by aspects of the route.


 
Posted : 05/01/2025 11:37 pm
 Ewan
Posts: 4336
Free Member
 

That seems doable. I've found that claude is actually quite a good coach given enough context. It's currently doing my half marathon training - I've basically given it my goals, performance metrics etc, and it gave me a training plan. I then paste in my run lap performaces from strava and it it'll then give me views etc - helped moderate my return from illness etc. I'm doing it just in a claude chat at the moment, but it could be worth turning it into more of an app.


 
Posted : 06/01/2025 12:23 pm

6 DAYS LEFT
We are currently at 95% of our target!