{"id":31932481,"url":"https://github.com/filipecorrea/vicinityhash","last_synced_at":"2025-10-14T05:02:29.567Z","repository":{"id":39451208,"uuid":"506562219","full_name":"filipecorrea/vicinityhash","owner":"filipecorrea","description":"Geohashes based on latitude, longitude and radius","archived":false,"fork":false,"pushed_at":"2025-10-08T07:14:25.000Z","size":4526,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T09:12:12.928Z","etag":null,"topics":["circle","geofence","geohash","geolocation","javascript","latitude","longitude","proximity","radius","typescript","vicinity"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vicinityhash","language":"TypeScript","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/filipecorrea.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"filipecorrea"}},"created_at":"2022-06-23T08:43:24.000Z","updated_at":"2025-10-08T07:14:28.000Z","dependencies_parsed_at":"2024-06-12T10:18:11.723Z","dependency_job_id":"81a558f6-f2ac-4ab4-94c5-587a860dc713","html_url":"https://github.com/filipecorrea/vicinityhash","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/filipecorrea/vicinityhash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipecorrea%2Fvicinityhash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipecorrea%2Fvicinityhash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipecorrea%2Fvicinityhash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipecorrea%2Fvicinityhash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/filipecorrea","download_url":"https://codeload.github.com/filipecorrea/vicinityhash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/filipecorrea%2Fvicinityhash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017995,"owners_count":26086236,"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-10-14T02:00:06.444Z","response_time":60,"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":["circle","geofence","geohash","geolocation","javascript","latitude","longitude","proximity","radius","typescript","vicinity"],"created_at":"2025-10-14T05:02:00.209Z","updated_at":"2025-10-14T05:02:29.552Z","avatar_url":"https://github.com/filipecorrea.png","language":"TypeScript","funding_links":["https://github.com/sponsors/filipecorrea"],"categories":[],"sub_categories":[],"readme":"# vicinityhash\n\nGiven latitude, longitude and radius, this library converts a circular [geofence](https://en.wikipedia.org/wiki/Geo-fence) into a set of [geohashes](https://en.wikipedia.org/wiki/Geohash).\n\nThis code was developed based on [Ashwin Nair's algorithm](https://github.com/ashwin711/proximityhash).\n\n## Install\n\nVia npm:\n\n```bash\nnpm install --save vicinityhash\n```\n\nVia yarn:\n\n```bash\nyarn add vicinityhash\n```\n\n## Use\n\nWith JavaScript:\n\n```javascript\nconst vicinityhash = require('vicinityhash')\n\nconst geofence = {\n  latitude: 51.51,\n  longitude: -0.07,\n  radius: 10000 // in meters\n}\n\nconst geohashes = vicinityhash.convert(geofence)\n```\n\nWith TypeScript:\n\n```typescript\nimport * as vicinityhash from 'vicinityhash'\n\nconst geofence = {\n  latitude: 51.51,\n  longitude: -0.07,\n  radius: 10000 // in meters\n}\n\nconst geohashes: string[] = vicinityhash.convert(geofence)\n```\n\nVisual representation of the geohashes created based on the geofence:\n\n![Geohashes](./docs/images/geohashes.png)\n\n### Optional configuration\n\n#### Precision\n\n```javascript\nconst geofence = {\n  latitude: 51.51,\n  longitude: -0.07,\n  radius: 20000\n}\n\nconst config = {\n  precision: 8 // 7 by default, accepts 1 to 12\n}\n\nconst geohashes = vicinityhash.convert(geofence, config)\n```\n\n#### Compression\n\n```javascript\nconst geofence = {\n  latitude: 51.51,\n  longitude: -0.07,\n  radius: 20000\n}\n\nconst config = {\n  compress: true // false by default\n}\n\nconst geohashes = vicinityhash.convert(geofence, config)\n```\n\nVisual representation of the geohashes created based on the geofence:\n\n![Geohashes compressed](./docs/images/compression.png)\n\n#### Compression levels\n\n```javascript\nconst geofence = {\n  latitude: 51.51,\n  longitude: -0.07,\n  radius: 20000\n}\n\nconst config = {\n  compress: true,\n  compressMin: 3, // 1 by default, accepts 1 to 12\n  compressMax: 6 // 12 by default, accepts 1 to 12de\n}\n\nconst geohashes = vicinityhash.convert(geofence, config)\n```\n\nVisual representation of the geohashes created based on the geofence:\n\n![Geohashes with custom compression levels](./docs/images/compression_levels.png)\n\n## Development\n\n### Prerequisites\n\n- [Node.js \u003e= 18](https://nodejs.org/en/download/releases)\n\n### Test\n\nRun this command to start unit tests:\n\n```bash\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipecorrea%2Fvicinityhash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffilipecorrea%2Fvicinityhash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffilipecorrea%2Fvicinityhash/lists"}