Skip to content Skip to footer
0 items - $0.00 0

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

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

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

8 Comments

  • Post Author
    dmitrygr
    Posted May 8, 2025 at 12:32 am

    Routing library, having nothing to do with Google or Google maps.

  • Post Author
    simonw
    Posted May 8, 2025 at 12:49 am

    From poking around in the source code I found this 282M SQLite database:

      wget https://services.arcgis.com/xOi1kZaI0eWDREZv/arcgis/rest/services/NTAD_North_American_Roads/FeatureServer/replicafilescache/NTAD_North_American_Roads_3862439624850511818.geodatabase
    

    I can't figure out how to read it though. I get this error:

      Connection to NTAD_North_American_Roads_3862439624850511818.geodatabase failed check: no such module: VSRS
    

    As far as I can tell VSRS is a proprietary Esri thing.

  • Post Author
    jdelman
    Posted May 8, 2025 at 1:48 am

    It's kinda nice to see a non-AI project on here.

  • Post Author
    svcphr
    Posted May 8, 2025 at 2:17 am

    Nice. Very light-weight compared to proper local routers like Graphhopper, OSRM, etc., which can be overkill for simple tasks. Although the 'routing' 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?

  • Post Author
    CamperBob2
    Posted May 8, 2025 at 3:20 am

    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.

    ————–

    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'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's just giving me the same old Python version errors:

        C:develus-routing-masterus_routing>uv venv
        Using CPython 3.10.9 interpreter at: c:WinPython-31090
        python-3.10.9.amd64python.exe
        Creating virtual environment at: .venv
        Activate with: .venvScriptsactivate
    
        C:develus-routing-masterus_routing>.venvScriptsactivate
    
        (us_routing) C:develus-routing-masterus_routing>uv pip     
        install us-routing
    
        x No solution found when resolving dependencies:
        `-> Because the current Python version (3.10.9) does not 
        satisfy Python>=3.11,<3.12 and us-routing==0.1.0
        depends on Python>=3.11,<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.
    

    Am I misunderstanding the whole uv thing, or just doing something wrong? Or is us-routing somehow incompatible with it?

  • Post Author
    protocolture
    Posted May 8, 2025 at 3:31 am

    Came here to complain about US Telcos being willing to do anything other than enabling dynamic routing.

    Glad to see this is for roads.

  • Post Author
    VladVladikoff
    Posted May 8, 2025 at 3:34 am

    Does it work for shorter distances? within a city from one business to another address?

  • Post Author
    culopatin
    Posted May 8, 2025 at 4:53 am

    I’d love to see if I could assist in adding road type filters such as avoid multi lane highways for example

Leave a comment

In the Shadows of Innovation”

© 2025 HackTech.info. All Rights Reserved.

Sign Up to Our Newsletter

Be the first to know the latest updates

Whoops, you're not connected to Mailchimp. You need to enter a valid Mailchimp API key.