TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: US Routing – Python library for fast local routing in the US

110 pointsby ivanbelenkyabout 22 hours ago

11 comments

dbattenabout 9 hours ago
If you find this interesting, definitely consider checking out contraction hierarchies. One of the early algorithms used by mapping software to enable calculating fastest routes between any pair of places. It&#x27;s exact, and it&#x27;s orders of magnitude faster than graph search algorithms like Dijkstra.<p>This webpage has a very intuitive graphical explanation of how it works: <a href="https:&#x2F;&#x2F;www.mjt.me.uk&#x2F;posts&#x2F;contraction-hierarchies&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.mjt.me.uk&#x2F;posts&#x2F;contraction-hierarchies&#x2F;</a><p>(I had the joy of implementing this in Python with OSM data a few years ago. Planning a three hour car trip with software I wrote and having it come back with the same path recommended by Google Maps in a matter of milliseconds was a very rewarding feeling.)
svcphrabout 19 hours ago
Nice. Very light-weight compared to proper local routers like Graphhopper, OSRM, etc., which can be overkill for simple tasks. Although the &#x27;routing&#x27; here is nx.shortest_path, which is just Dijkstra, so pretty slow compared to other easy to implement routing algorithms (even just bi-directional Dijkstra or A*... although contraction hierarchies would be huge gain here since edge weights are fixed). Also not sure why readme describes it as an approximation? Dijkstra is guaranteed to return lowest cost path. Maybe approximation because assuming free-flow, or if the NAR dataset is incomplete?
评论 #43922512 未加载
评论 #43925442 未加载
评论 #43926441 未加载
simonwabout 21 hours ago
From poking around in the source code I found this 282M SQLite database:<p><pre><code> wget https:&#x2F;&#x2F;services.arcgis.com&#x2F;xOi1kZaI0eWDREZv&#x2F;arcgis&#x2F;rest&#x2F;services&#x2F;NTAD_North_American_Roads&#x2F;FeatureServer&#x2F;replicafilescache&#x2F;NTAD_North_American_Roads_3862439624850511818.geodatabase </code></pre> I can&#x27;t figure out how to read it though. I get this error:<p><pre><code> Connection to NTAD_North_American_Roads_3862439624850511818.geodatabase failed check: no such module: VSRS </code></pre> As far as I can tell VSRS is a proprietary Esri thing.
评论 #43921969 未加载
评论 #43922027 未加载
schemathingsabout 9 hours ago
The feature I always wish for with nav software is &#x27;go back the same way&#x27;.
culopatinabout 17 hours ago
I’d love to see if I could assist in adding road type filters such as avoid multi lane highways for example
评论 #43923202 未加载
django-johnabout 12 hours ago
Nice. Clean and lightweight compared to full routing stacks like OSRM or Graphhopper, which can be a bit much for smaller&#x2F;local tasks. Curious why the README calls it an &quot;approximation&quot; though — Dijkstra gives exact shortest paths unless you&#x27;re simplifying inputs. Maybe that&#x27;s referring to free-flow assumptions or limitations in the underlying network data? Still, cool to see a focused US-only tool.
protocoltureabout 18 hours ago
Came here to complain about US Telcos being willing to do anything other than enabling dynamic routing.<p>Glad to see this is for roads.
CamperBob2about 18 hours ago
Edit: thanks very much for the suggestions, especially adding the Python version to the uv command line. I totally missed that, and that totally fixed it. Apologies for the OT tech support derailment.<p>--------------<p>Question for those familiar with uv. US Routing apparently requires a very specific Python version (3.11 and nothing else), but my system has Python 3.10.9 installed at the moment and I&#x27;d rather not upgrade the global version just now. My understanding from reading a lot of uv evangelism on HN and elsewhere is that uv fixes this type of dilemma. But, having just tried to use it to install this package, it&#x27;s just giving me the same old Python version errors:<p><pre><code> C:\devel\us-routing-master\us_routing&gt;uv venv Using CPython 3.10.9 interpreter at: c:\WinPython-31090 \python-3.10.9.amd64\python.exe Creating virtual environment at: .venv Activate with: .venv\Scripts\activate C:\devel\us-routing-master\us_routing&gt;.venv\Scripts\activate (us_routing) C:\devel\us-routing-master\us_routing&gt;uv pip install us-routing x No solution found when resolving dependencies: `-&gt; Because the current Python version (3.10.9) does not satisfy Python&gt;=3.11,&lt;3.12 and us-routing==0.1.0 depends on Python&gt;=3.11,&lt;3.12, we can conclude that us- routing==0.1.0 cannot be used. And because only us-routing==0.1.0 is available and you require us-routing, we can conclude that your requirements are unsatisfiable. </code></pre> Am I misunderstanding the whole uv thing, or just doing something wrong? Or is us-routing somehow incompatible with it?
评论 #43922814 未加载
评论 #43922861 未加载
评论 #43922808 未加载
评论 #43922807 未加载
评论 #43922804 未加载
VladVladikoffabout 18 hours ago
Does it work for shorter distances? within a city from one business to another address?
评论 #43922893 未加载
jdelmanabout 20 hours ago
It&#x27;s kinda nice to see a non-AI project on here.
评论 #43923161 未加载
评论 #43931279 未加载
dmitrygrabout 21 hours ago
Routing library, having nothing to do with Google or Google maps.
评论 #43921952 未加载
评论 #43922177 未加载