{"id":15939837,"url":"https://github.com/scitator/osm_rg","last_synced_at":"2025-09-13T02:32:05.023Z","repository":{"id":133293878,"uuid":"66960654","full_name":"Scitator/osm_rg","owner":"Scitator","description":"Fast, offline osm based reverse geocoder","archived":false,"fork":false,"pushed_at":"2017-04-22T13:15:17.000Z","size":2145,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-06T17:59:31.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Scitator.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":"2016-08-30T17:00:11.000Z","updated_at":"2019-04-18T00:30:34.000Z","dependencies_parsed_at":"2023-04-28T08:10:51.723Z","dependency_job_id":null,"html_url":"https://github.com/Scitator/osm_rg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Scitator/osm_rg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scitator%2Fosm_rg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scitator%2Fosm_rg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scitator%2Fosm_rg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scitator%2Fosm_rg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Scitator","download_url":"https://codeload.github.com/Scitator/osm_rg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Scitator%2Fosm_rg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274909046,"owners_count":25372093,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-07T06:21:33.799Z","updated_at":"2025-09-13T02:32:04.159Z","avatar_url":"https://github.com/Scitator.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"OSM Reverse Geocoder\n=================\nA Python library for offline reverse geocoding. It improves on an existing library called [reverse-geocoder](https://github.com/thampiman/reverse-geocoder) developed by [Ajay Thampi]\n\n## Features\n1. Besides city/town and country code, this library also returns the nearest latitude and longitude and also administrative regions 1 and 2.\n2. This library also uses a parallelised implementation of K-D trees which promises an improved performance especially for large inputs.\n3. Many extra information from OSM\n\nThe K-D tree is populated with cities that have a population \u003e 1000. The source of the data is [GeoNames](http://download.geonames.org/export/dump/).\n\n### Dependencies\n1. scipy\n2. numpy\n3. geopy\n4. pandas\n5. ast\n\n## Usage\nThe library supports two modes:\n\n1. Mode 1: Single-threaded K-D Tree (default, similar to [reverse_geocode] (https://pypi.python.org/pypi/reverse_geocode/1.0))\n2. Mode 2: Multi-threaded K-D Tree\n\n```python\nimport osm_rg as rg\n\ncity = (-33.86785, 151.20732)\n\nresults = rg.get(city) # default mode = 1, precision = 2\n\nprint results\n```\n\nThe above code will output the following:\n```\n[{\n    'town': nan,\n    'village': nan,\n    'country': 'Australia', \n    'city': 'Sydney', \n    'country_code': 'au', \n    'geo_id': 2147714\n}]\n```\n\nIf you'd like to use the multi-threaded K-D tree, set mode = 2 as follows:\n```python\nresults = rg.get(city, mode=2)\n```\n\n## Acknowledgements\n1. Major inspiration is from Ajay Thampi's [reverse_geocoder] (https://github.com/thampiman/reverse-geocoder) library\n2. Parallelised implementation of K-D Trees is extended from this [article](http://folk.uio.no/sturlamo/python/multiprocessing-tutorial.pdf) by [Sturla Molden](https://github.com/sturlamolden)\n3. Geocoded data is from [GeoNames](http://download.geonames.org/export/dump/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscitator%2Fosm_rg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscitator%2Fosm_rg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscitator%2Fosm_rg/lists"}