{"id":24203269,"url":"https://github.com/netrixone/geo-rev","last_synced_at":"2025-03-03T11:22:02.930Z","repository":{"id":143829672,"uuid":"248723894","full_name":"netrixone/geo-rev","owner":"netrixone","description":"Reverse geocoder working with offline data and fast lookup times.","archived":false,"fork":false,"pushed_at":"2020-09-24T11:23:26.000Z","size":2575,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-13T22:17:19.162Z","etag":null,"topics":["geo","geoip","ip","reverse","webkitty"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/netrixone.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":"2020-03-20T10:06:48.000Z","updated_at":"2025-01-01T17:23:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0acb896-0449-43d2-8067-c92798f25d02","html_url":"https://github.com/netrixone/geo-rev","commit_stats":null,"previous_names":["webkitty/geo-rev","netrixone/geo-rev","f00b4r/geo-rev"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netrixone%2Fgeo-rev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netrixone%2Fgeo-rev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netrixone%2Fgeo-rev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netrixone%2Fgeo-rev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netrixone","download_url":"https://codeload.github.com/netrixone/geo-rev/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241653106,"owners_count":19997603,"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":["geo","geoip","ip","reverse","webkitty"],"created_at":"2025-01-13T22:17:18.280Z","updated_at":"2025-03-03T11:22:02.902Z","avatar_url":"https://github.com/netrixone.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=center\u003eGEO:Rev\u003c/h1\u003e\n\n\u003cp align=center\u003e\n🌐 \u003ca href=\"https://stuchl4n3k.net\"\u003estuchl4n3k.net\u003c/a\u003e | 💻 \u003ca href=\"https://github.com/stuchl4n3k\"\u003estuchl4n3k\u003c/a\u003e | 🐦 \u003ca href=\"https://twitter.com/stuchl4n3k\"\u003e@stuchl4n3k\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=center\u003e\n\u003ca href=\"https://circleci.com/gh/webkitty/geo-rev\"\u003e\u003cimg src=\"https://img.shields.io/circleci/build/github/webkitty/geo-rev?style=flat-square\"\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/webkitty/geo-rev\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/github/webkitty/geo0rev?style=flat-square\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/webkitty/geo-rev/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/webkitty/geo-rev?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=center\u003e\n\u003cstrong\u003eSimple reverse geocoder for Node.js that works with offline data and offers fast lookup times.\u003c/strong\u003e\n\u003cbr\u003e\n📍 → 🌐🔍 → 🏘️\n\u003c/p\u003e\n\nEvery release of the package contains a modified version of the latest free GeoNames.org [cities500](https://download.geonames.org/export/dump/)\ndataset (licensed under a Creative Commons Attribution 4.0 License). There is also a possibility to use an external\ndataset in the same format. Geocoding of given coordinates is performed using a K-D Tree index, which is built during\ninitialization of the component.\n\n## ✅ Features\n\n- [x] Parses local (offline) geographical database of places.\n- [x] Looks up a nearest place (town/city) to a given geographical location.\n\n## ⚙️ Usage\n\n**Show me the code!**\n\n```typescript\nimport { createRevGeocoder } from '@webkitty/geo-rev';\n\nconst revGeocoder = await createRevGeocoder();\nconst result = revGeocoder.lookup({latitude: 50.652576, longitude: 13.723918});\nconsole.log(result);\n```\n\n```\n{\n  record: {\n    name: 'Hrob',\n    latitude: 50.65919,\n    longitude: 13.72676,\n    countryCode: 'CZ'\n  },\n  distance: 0.7622437751065233  // [km]\n}\n```\n\nBy default the geocoder uses a bundled dataset.\n\n**OK, what if I need to update the dataset in the future?**\n\nThe latest dataset is bundled with each release, but you can always supply yours:\n\n```typescript\nconst revGeocoder = await createRevGeocoder({dataset: '/path/to/your/dataset.csv'});\n```\n\nWe use [a simple script](https://github.com/webkitty/geo-rev/blob/master/Makefile) to convert the\n[GeoNames.org dataset](https://download.geonames.org/export/dump/cities500.zip) to the supported format:\n\n```bash\nwget https://download.geonames.org/export/dump/cities500.zip -O /tmp/geonames.zip\nunzip /tmp/geonames.zip | cut -f2,5,6,9 -s --output-delimiter=';' \u003e cities500.csv\n```\n\n**But I have a _custom_ dataset!**\n\nNo problem, I can hear you. Just convert yours to the following format:\n\n- Cell delimiter is a semi-colon (`;`).\n- Row delimiter is a Unix LF (`\\n`).\n- There is no header row.\n- Cell values are not quoted.\n- Order of the columns is:\n  1. Name of the place (UTF8 `string`)\n  2. Latitude (float `number`)\n  3. Longitude (float `number`)\n  4. ISO Alpha-2 [country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) of the place (`string`)\n\nFor the sake of completeness the CSV should look as follows:\n\n```\nSoldeu;42.57688;1.66769;AD\nMusashino;35.70611;139.55944;JP\nÄngelholm;56.2428;12.86219;SE\n...\n```\n\n## 🛠️ Build\n\n```bash\nmake\n```\n\n## 🙇‍ Dependencies and attributions\n\n- https://github.com/mikolalysenko/static-kdtree - Static K-D tree data structure\n- https://geonames.org - The GeoNames geographical database\n\n## 📜 License\n\nCopyright © 2020 [stuchl4n3k](https://github.com/stuchl4n3k).\nThis project is [MIT](LICENSE) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetrixone%2Fgeo-rev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetrixone%2Fgeo-rev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetrixone%2Fgeo-rev/lists"}