{"id":15764445,"url":"https://github.com/turistikrota/osm","last_synced_at":"2025-04-21T03:32:32.947Z","repository":{"id":257809159,"uuid":"867270911","full_name":"turistikrota/osm","owner":"turistikrota","description":"openstreetmap nominatim api for golang","archived":false,"fork":false,"pushed_at":"2024-11-13T15:42:05.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-24T09:39:33.518Z","etag":null,"topics":["openstreetmap","openstreetmap-api"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/turistikrota/osm","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/turistikrota.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,"publiccode":null,"codemeta":null}},"created_at":"2024-10-03T18:44:05.000Z","updated_at":"2024-12-11T03:12:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"2de84200-9f49-4acf-abb6-9c316b5fc7c2","html_url":"https://github.com/turistikrota/osm","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"b610abb4be0134cbc2edf6b3c1795691787879af"},"previous_names":["turistikrota/osm"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turistikrota%2Fosm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turistikrota%2Fosm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turistikrota%2Fosm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turistikrota%2Fosm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/turistikrota","download_url":"https://codeload.github.com/turistikrota/osm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249991165,"owners_count":21357214,"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":["openstreetmap","openstreetmap-api"],"created_at":"2024-10-04T12:03:37.497Z","updated_at":"2025-04-21T03:32:32.690Z","avatar_url":"https://github.com/turistikrota.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# turistikrota osm\n\nThe `osm` package provides functions to interact with the OpenStreetMap API. It includes functionalities for reverse geocoding, retrieving details about specific OSM objects, searching for places, and looking up information based on OSM type and ID.\n\n## Installation\n\nTo install the package, use:\n\n```sh\ngo get github.com/turistikrota/osm\n```\n\n## Usage\n\n### Importing the Package\n\n```go\nimport \"github.com/turistikrota/osm\"\n```\n\n### Methods\n\n- `Reverse(ctx context.Context, lat float64, long float64, opts ...optFunc) (*ReverseResult, error)`\n- `Details(ctx context.Context, osmType string, osmID int, opts ...optFunc) (*DetailsResult, error)`\n- `DetailsWithPlaceID(ctx context.Context, placeID int, opts ...optFunc) (*DetailsResult, error)`\n- `Search(ctx context.Context, q string, opts ...optFunc) ([]SearchResult, error)`\n- `Lookup(ctx context.Context, osmType string, osmID int, opts ...optFunc) (*LookupResult, error)`\n\n### Internationalization\n\nThe package supports internationalization. To set the language for the API requests, use the `WithLanguage` option:\n\n```go\nresult, err := osm.Reverse(ctx, 40.748817, -73.985428, osm.WithLocale(\"de\"))\n```\n\nor change the default language:\n\n```go\nosm.DefaultConfig = osm.Config{\n    Locale: \"de\",\n}\n```\n\n### Examples\n\n#### Reverse Geocoding\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/turistikrota/osm\"\n)\n\nfunc main() {\n    ctx := context.Background()\n    result, err := osm.Reverse(ctx, 40.748817, -73.985428) // Latitude and Longitude for the Empire State Building\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n    fmt.Println(\"Reverse Geocoding Result:\", result)\n}\n```\n\n#### Retrieving Details\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/turistikrota/osm\"\n)\n\nfunc main() {\n    ctx := context.Background()\n    result, err := osm.DetailsWithPlaceID(ctx, 240109189) // PlaceID for the Empire State Building\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n    fmt.Println(\"Details Result:\", result)\n}\n```\n\n#### Searching for Places\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/turistikrota/osm\"\n)\n\nfunc main() {\n    ctx := context.Background()\n    results, err := osm.Search(ctx, \"Central Park\")\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n    for _, result := range results {\n        fmt.Println(\"Search Result:\", result)\n    }\n}\n```\n\n#### Looking Up Information\n\n```go\npackage main\n\nimport (\n    \"context\"\n    \"fmt\"\n    \"github.com/turistikrota/osm\"\n)\n\nfunc main() {\n    ctx := context.Background()\n    result, err := osm.Lookup(ctx, \"way\", 123456789) // Example OSM type and ID\n    if err != nil {\n        fmt.Println(\"Error:\", err)\n        return\n    }\n    fmt.Println(\"Lookup Result:\", result)\n}\n```\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturistikrota%2Fosm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturistikrota%2Fosm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturistikrota%2Fosm/lists"}