{"id":28591141,"url":"https://github.com/mojixcoder/gosrm","last_synced_at":"2026-04-30T02:38:46.975Z","repository":{"id":164427429,"uuid":"639867666","full_name":"mojixcoder/gosrm","owner":"mojixcoder","description":"Go client library for OSRM","archived":false,"fork":false,"pushed_at":"2024-02-03T10:39:52.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-03T11:33:15.551Z","etag":null,"topics":["go","golang","openstreetmap","osm","osrm","routing-engine"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/mojixcoder/gosrm","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mojixcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-12T12:08:24.000Z","updated_at":"2023-05-12T14:54:44.000Z","dependencies_parsed_at":"2024-02-03T11:31:49.496Z","dependency_job_id":"6051663a-9293-478d-9fb9-522df2a39b00","html_url":"https://github.com/mojixcoder/gosrm","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojixcoder%2Fgosrm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojixcoder%2Fgosrm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojixcoder%2Fgosrm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojixcoder%2Fgosrm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mojixcoder","download_url":"https://codeload.github.com/mojixcoder/gosrm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mojixcoder%2Fgosrm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259236397,"owners_count":22826309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","openstreetmap","osm","osrm","routing-engine"],"created_at":"2025-06-11T09:13:14.431Z","updated_at":"2026-04-30T02:38:46.969Z","avatar_url":"https://github.com/mojixcoder.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![test](https://github.com/mojixcoder/gosrm/actions/workflows/test.yaml/badge.svg)\n[![code quality](https://app.codacy.com/project/badge/Grade/a9ca122539bc4d198a370dab1d6081a9)](https://app.codacy.com/gh/mojixcoder/gosrm/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade)\n[![coverage](https://app.codacy.com/project/badge/Coverage/a9ca122539bc4d198a370dab1d6081a9)](https://app.codacy.com/gh/mojixcoder/gosrm/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_coverage)\n\n### GOSRM\n---\n**GOSRM** is an OSRM client written in Go. It implements all OSRM 5.x installations.  \nIf you want to get the most out of this package I highly recommend to read OSRM [docs](https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md).\n\n#### Features\n---\n - [x] Nearest Service\n - [x] Route Service\n - [x] Table Service\n - [x] Match Service\n - [x] Trip Service\n - [ ] Tile Service\n\n#### Installation\n---\nRequires Go \u003e= 1.24: `go get github.com/mojixcoder/gosrm`\n\n#### How To Use\n---\n``` go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n\n    \"github.com/mojixcoder/gosrm\"\n)\n\nfunc main() {\n    osrm, err := gosrm.New(\"http://router.project-osrm.org\")\n    checkErr(err)\n \n    nearestRes, err := gosrm.Nearest(context.Background(), osrm, gosrm.Request{\n        Profile:     gosrm.ProfileDriving,\n\tCoordinates: []gosrm.Coordinate{{13.388860, 52.517037}},\n    }, gosrm.WithNumber(3), gosrm.WithBearings([]gosrm.Bearing{{Value: 0, Range: 20}}))\n    checkErr(err)\n\n    fmt.Println(\"### Nearest Response ###\")\n    fmt.Printf(\"%#v\\n\", nearestRes)\n    fmt.Println(\"##########\")\n\n    // String type represents the type of geometries returned by OSRM.\n    // It can be either string or gosrm.LineString based on geometries option.\n    // If you don't specify any geometries the default is polyline and you can use string.\n    routeRes, err := gosrm.Route[string](context.Background(), osrm, gosrm.Request{\n\tProfile:     gosrm.ProfileDriving,\n\tCoordinates: []gosrm.Coordinate{{13.388860, 52.517037}, {13.397634, 52.529407}, {13.428555, 52.523219}},\n    })\n    checkErr(err)\n\n    fmt.Println(\"\\n### Route Response ###\")\n    fmt.Printf(\"%#v\\n\", routeRes)\n    fmt.Println(\"##########\")\n\n    tableRes, err := gosrm.Table(context.Background(), osrm, gosrm.Request{\n\tProfile:     gosrm.ProfileDriving,\n\tCoordinates: []gosrm.Coordinate{{13.388860, 52.517037}, {13.397634, 52.529407}, {13.428555, 52.523219}},\n    }, gosrm.WithSources([]uint16{0, 1}), gosrm.WithDestinations([]uint16{2}))\n    checkErr(err)\n\n    fmt.Println(\"\\n### Table Response ###\")\n    fmt.Printf(\"%#v\\n\", tableRes)\n    fmt.Println(\"##########\")\n\n    // This time we use geojson geometries so geometry type is gosrm.LineString not string.\n    matchRes, err := gosrm.Match[gosrm.LineString](context.Background(), osrm, gosrm.Request{\n\tProfile:     gosrm.ProfileDriving,\n\tCoordinates: []gosrm.Coordinate{{13.3122, 52.5322}, {13.3065, 52.5283}},\n    }, gosrm.WithAnnotations(gosrm.AnnotationsTrue), gosrm.WithGeometries(gosrm.GeometryGeoJSON))\n    checkErr(err)\n\n    fmt.Println(\"\\n### Match Response ###\")\n    fmt.Printf(\"%#v\\n\", matchRes)\n    fmt.Println(\"##########\")\n\n    tripRes, err := gosrm.Trip[string](context.Background(), osrm, gosrm.Request{\n\tProfile:     gosrm.ProfileDriving,\n\tCoordinates: []gosrm.Coordinate{{13.388860, 52.517037}, {13.397634, 52.529407}, {13.428555, 52.523219}, {13.418555, 52.523215}},\n    }, gosrm.WithSource(gosrm.SourceFirst), gosrm.WithDestination(gosrm.DestinationLast))\n    checkErr(err)\n\n    fmt.Println(\"\\n### Trip Response ###\")\n    fmt.Printf(\"%#v\\n\", tripRes)\n    fmt.Println(\"##########\")\n}\n\nfunc checkErr(err error) {\n    if err != nil {\n\tpanic(err)\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojixcoder%2Fgosrm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmojixcoder%2Fgosrm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmojixcoder%2Fgosrm/lists"}