Live data from Hacker News

Show HN: Bike route planner that follows almost only official bike trails

trailimap.com

151–156 of 156 posts

Re: Show HN: Bike route planner that follows almost only official bike trails

#151

This looks really great! Do you offer an api as well? I'm part of the team behind https://cyclema.ps and we'd love to see if we could incorporate this as a backend.

The backend at this point is just Graphhopper so I think it would make more sense to use it directly and customize it based on your needs: https://github.com/graphhopper/graphhopper

Re: Show HN: Bike route planner that follows almost only official bike trails

#152
post #23
post #14

Sorry, forgot to mention. The planner is a mess on mobile I totally forgot to make it mobile friendly as I didn't think anyone would want to plan their trip on a phone.

Interesting assumption. My mind goes to to a) Most people are mobile first and b) In this category of app, i imagine people want the route with them on their phone as they bike (as they're probably unfamiliar with the route, hence the need to plan it) Cool idea, i'd love to try it but honestly i'd love it on my phone for the aforementioned reasons! --- Edit: Some follow up remarks (From Chrome on a Mac) 1. I found it…

Thanks for the feedback! I actually want to have it on mobile as well but will most likely choose React Native instead of trying to make the web app work on mobile (or maybe only with some very simple functionality). At first, my approach was to have a planner on desktop and route viewer/navigator on mobile, but you're right - there needs to be an option to update/modify your route while traveling.

Regarding state: it's only a matter of changing the blacklist array in redux persist config. Right now I have all global state blacklisted because I noticed a small bug with rendering the map layers when the state is persisted and I didn't have time to fix it but in the next version it will be persisted in localstorage.

Re: Show HN: Bike route planner that follows almost only official bike trails

#153

Does anyone know of similar apps for walking/hiking trails?

brouter web with hiking profile. https://brouter.de/essbee/ Select it in in upper left menu - then fine tune the script on the right.

Thanks, I will go have a look, much appreciated!

Re: Show HN: Bike route planner that follows almost only official bike trails

#154
post #132
post #121

Earlier quoted context omitted.

Hey karussell, I really appreciate all the hard work you’ve put into Graphhopper. I wouldn't be able to create this project without GH. I have a question about memory usage during the import stage (specifically in the OSM Reader's preprocessRelations function). I'm using a HashMap > to map way IDs to OSM bike route relation IDs, which means allocating lots of arrays. Could this be causing me to run out of heap memory…

Love your project! Maybe you already considered, but there are a number of collection libraries out there that are optimized for holding Java primitives and/or for very large sets of data, which could help you save significant memory. Eclipse Collections [0] and Fastutil [1] come to mind first, but there are many out there [2] [0] https://github.com/eclipse-collections/eclipse-collections [1] https://fastutil.di.unim…

Thank you! I'm a total Java noob - actually, this is the first project where I've written any Java code (had to slightly modify the Graphhopper source code to suit my needs). Those libraries look very interesting. I'm saving this post for another battle with processing maany GBs of OSM data :D

Re: Show HN: Bike route planner that follows almost only official bike trails

#155
post #154
post #132

Earlier quoted context omitted.

Love your project! Maybe you already considered, but there are a number of collection libraries out there that are optimized for holding Java primitives and/or for very large sets of data, which could help you save significant memory. Eclipse Collections [0] and Fastutil [1] come to mind first, but there are many out there [2] [0] https://github.com/eclipse-collections/eclipse-collections [1] https://fastutil.di.unim…

Thank you! I'm a total Java noob - actually, this is the first project where I've written any Java code (had to slightly modify the Graphhopper source code to suit my needs). Those libraries look very interesting. I'm saving this post for another battle with processing maany GBs of OSM data :D

We already use carrotsearch internally so you could replace the java util classes like HashMap and HashList with it to reduce memory usage a bit. But it won't help much. E.g. all data structures (in any standard library btw) do usually double their size at some point when their size increases and then copy from the old internal array to the new internal array, which means that you need roughly 3x the current size and if that happens roughly at the end of the import process you have a problem. For that reason we developed DataAccess (inmemory or MMAP possible) which is basically a large List but 1. increases only segment by segment and 2. allows more than 2 billion items (signed int).

Another trick for planet size data structure could be to use a List instead of the Map and the OSM ID as index. Because the memory overhead of a Map compared to a List is huge (and you could use DataAccess) and the OSM IDs for planet are nearly adjacent or at least have not that many gaps (as those gaps are refilled I think).

All these tricks (there are more!) are rather tricky&low level but necessary for memory efficiency. A simpler way for your use case could be to just use a database for that, like MapDB or sqlite. But this might be (a lot) slower compared to in-memory stuff.

Post reply on HN