{"id":13553316,"url":"https://github.com/leon-win/geohex","last_synced_at":"2025-07-29T10:10:31.147Z","repository":{"id":42059938,"uuid":"270448896","full_name":"leon-win/geohex","owner":"leon-win","description":"Hexagonal geocoding system","archived":false,"fork":false,"pushed_at":"2024-09-02T20:09:00.000Z","size":693,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T00:48:30.385Z","etag":null,"topics":["converting","coordinate-systems","geocoding","geohex","hexagon","hexagonal","hexagonal-grids"],"latest_commit_sha":null,"homepage":"https://leon-win.github.io/geohex","language":"JavaScript","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/leon-win.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-06-07T22:22:28.000Z","updated_at":"2025-02-05T08:36:20.000Z","dependencies_parsed_at":"2023-02-07T21:45:21.479Z","dependency_job_id":"48a4aaec-b8a2-4f3a-8aba-46e53cb4e6a7","html_url":"https://github.com/leon-win/geohex","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":0.4,"last_synced_commit":"7f99853847c4f7d36748c8c383610867878a3c14"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/leon-win/geohex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon-win%2Fgeohex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon-win%2Fgeohex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon-win%2Fgeohex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon-win%2Fgeohex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leon-win","download_url":"https://codeload.github.com/leon-win/geohex/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leon-win%2Fgeohex/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267637274,"owners_count":24119608,"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-07-29T02:00:12.549Z","response_time":2574,"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":["converting","coordinate-systems","geocoding","geohex","hexagon","hexagonal","hexagonal-grids"],"created_at":"2024-08-01T12:02:22.007Z","updated_at":"2025-07-29T10:10:31.122Z","avatar_url":"https://github.com/leon-win.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"# Geohex\n\n[![npm](https://img.shields.io/npm/v/geohex?logo=npm\u0026style=flat-square)](https://www.npmjs.com/package/geohex)\n[![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?logo=prettier\u0026style=flat-square)](https://prettier.io)\n[![License: MIT](https://img.shields.io/github/license/leon-win/geohex?style=flat-square)](http://opensource.org/licenses/MIT)\n\nHexagonal geocoding system, library for converting geographic coordinates to hexagonal grid cells and vice versa.\n\nThis is ECMAScript 2015 fork of [GeoHex library](http://geohex.net) which was originally made by [@sa2da](http://twitter.com/sa2da).\n\n## Installation\n\n```sh\nnpm install geohex --save\n```\n\nOr grab from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/geohex):\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/geohex@0.0.7/lib/geohex.min.js\"\u003e\u003c/script\u003e\n```\n\nOr from [unpkg CDN](https://unpkg.com/geohex/):\n\n```html\n\u003cscript src=\"https://unpkg.com/geohex@0.0.7/lib/geohex.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n### ES6 Modules\n\n```js\nimport Geohex from \"geohex\";\n// or import { getCellByCode } from 'geohex'\n```\n\n### CommonJS\n\n```js\nconst Geohex = require(\"geohex\");\n// or const { getCellByCode } = require('geohex')\n```\n\n### JS modules:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import Geohex from \"geohex/src/index.js\";\n  // or import { getCellByCode } from 'geohex/src/index.js'\n\u003c/script\u003e\n```\n\n### Global variable\n\n```html\n\u003cscript src=\"geohex/lib/geohex.min.js\"\u003e\u003c/script\u003e\n```\n\n## Examples\n\n[Online demo of Geohex usage](https://leon-win.github.io/geohex-examples/)\n\n```javascript\n// Get Geohex cell instance by code\nconst geohexCell = Geohex.getCellByCode('QH3360')\n\n// Get Geohex cell instance by geographic coordinates and zoom level\nconst geohexCell = Geohex.getCellByLocation(59.943201, 30.324086, 4)\n\n// Get Geohex cell instance by cell coordinates and zoomLevel\nconst geohexCell = Geohex.getCellByXY(326, 203, 4)\n\n// Get Geohex cell coordinates by geographic coordinates and zoom level\nGeohex.getXYByLocation(59.943201, 30.324086, 4):\n// { x: 326, y: 203 }\n\n// Get Geohex cell coordinates by code\nGeohex.getXYByCode('QH3360')\n// { x: 326, y: 203 }\n```\n\n### Geohex cell instance\n\nGeohex cell instance is hexagon grid cell with properties and methods:\n\n```javascript\nconsole.log(JSON.stringify(geohexCell, null, 2))\n// {\n//   \"lat\": 59.97788999458348,\n//   \"lon\": 30.37037037037038,\n//   \"x\": 326,\n//   \"y\": 203,\n//   \"code\": \"QH3360\"\n// }\n\n// Cell zoom level\ngeohexCell.getZoomLevel()\n// 4\n\n// Cell side length in degrees\ngeohexCell.getHexSize():\n// 9162.098006401464\n\n// Geographic coordinates of hexagon corners\ngeohexCell.getHexCoords():\n// [\n//   { lat: 59.97788999458348, lon: 30.205761316872437 },\n//   { lat: 60.0491386517641, lon: 30.288065843621407 },\n//   { lat: 60.0491386517641, lon: 30.45267489711935 },\n//   { lat: 59.97788999458348, lon: 30.53497942386832 },\n//   { lat: 59.90648768479527, lon: 30.45267489711935 },\n//   { lat: 59.90648768479527, lon: 30.288065843621407 }\n// ]\n```\n\n## Other implementations\n\n- [Original GeoHex library](http://www.geohex.org)\n- [GeoHex TypeScript implementation](https://github.com/uupaa/GeoHex)\n- [GeoHex Dart implementation](https://github.com/NiKoTron/geohex)\n- [GeoHex Swift implementation](https://github.com/nekowen/GeoHex3.swift)\n- [GeoHex Scala implementation](https://github.com/teralytics/geohex)\n- [GeoHex Java implementation](https://github.com/chsh/geohex4j)\n- [GeoHex C# implementation](https://github.com/mattak/GeoHex.cs)\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT)\n\n© 2009 @sa2da (http://twitter.com/sa2da) http://www.geohex.org\n\n© 2020 Leonid Vinogradov\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleon-win%2Fgeohex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleon-win%2Fgeohex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleon-win%2Fgeohex/lists"}