{"id":14529780,"url":"https://github.com/Placekey/placekey-js","last_synced_at":"2025-09-02T00:32:24.965Z","repository":{"id":39019415,"uuid":"294761515","full_name":"Placekey/placekey-js","owner":"Placekey","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-24T15:33:45.000Z","size":2465,"stargazers_count":22,"open_issues_count":9,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-12-29T10:30:41.327Z","etag":null,"topics":["geospatial","h3","javascript-library","placekey"],"latest_commit_sha":null,"homepage":"https://placekey.io","language":"JavaScript","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/Placekey.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}},"created_at":"2020-09-11T17:25:54.000Z","updated_at":"2024-09-24T15:33:21.000Z","dependencies_parsed_at":"2023-09-21T19:24:57.006Z","dependency_job_id":null,"html_url":"https://github.com/Placekey/placekey-js","commit_stats":{"total_commits":52,"total_committers":7,"mean_commits":7.428571428571429,"dds":0.5192307692307692,"last_synced_commit":"2dc2ce663e13207cd9bf62367bf0ce3c75991d5f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Placekey/placekey-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Placekey%2Fplacekey-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Placekey%2Fplacekey-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Placekey%2Fplacekey-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Placekey%2Fplacekey-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Placekey","download_url":"https://codeload.github.com/Placekey/placekey-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Placekey%2Fplacekey-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273213731,"owners_count":25065058,"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-01T02:00:09.058Z","response_time":120,"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":["geospatial","h3","javascript-library","placekey"],"created_at":"2024-09-05T00:01:02.287Z","updated_at":"2025-09-02T00:32:24.590Z","avatar_url":"https://github.com/Placekey.png","language":"JavaScript","funding_links":[],"categories":["Code"],"sub_categories":["Javascript"],"readme":"# @placekey/placekey\n\n[![npm version](https://badge.fury.io/js/%40placekey%2Fplacekey.svg)](https://badge.fury.io/js/%40placekey%2Fplacekey)\n\nA JavaScript library for working with [Placekeys](https://placekey.io).\n\nThe source code for this library can be found [here](https://github.com/placekey/placekey-js/), and documentation for the Placekey service API can be found [here](https://docs.placekey.io/). The Placekey design specification is available [here](https://docs.placekey.io/Placekey_Technical_White_Paper.pdf). The details in Placekey encoding is [here](https://docs.placekey.io/Placekey_Encoding_Specification%20White_Paper.pdf). We welcome your feedback.\n\nTo install:\n\n```\nnpm install @placekey/placekey\n```\n\nOr with yarn:\n\n```\nyarn add @placekey/placekey\n```\n\n## Usage\n\nNote: Be careful to note that like the [H3](https://h3geo.org/) API, the placekey-js API use `latitude`, `longitude` order.\n\nFailure to account of this order when interoperating with other geospatial software is a common source of errors, for more information see [lon lat lon lat](https://macwright.com/lonlat/).\n\n```js\nimport {geoToPlacekey} from '@placekey/placekey';\nconst [lat, long] = [0.0, 0.0];\ngeoToPlacekey(lat, long); // =\u003e '@dvt-smp-tvz';\n```\n\n```js\nimport {placekeyToGeo} from '@placekey/placekey';\nplacekeyToGeo('@qjk-m7r-whq'); // =\u003e [-46.0033934397115, -155.09988163615031]\n```\n\n```js\nimport {placekeyToH3} from '@placekey/placekey';\nplacekeyToH3('@dpr-6q6-73q'); // =\u003e '8a734e64992ffff'\n```\n\n```js\nimport {h3ToPlacekey} from '@placekey/placekey';\nh3ToPlacekey('8a734e64992ffff');\n('@dpr-6q6-73q');\n```\n\nAn upper bound on the maximal distance in meters between two Placekeys based on the length of their shared prefix is provided by `getPlacekeyPrefixDistanceDict()`.\n\n```json\n{\n  1: 12740000.0,\n  2: 2777000.0,\n  3: 1065000.0,\n  4: 152400.0,\n  5: 21770.0,\n  6: 8227.0,\n  7: 1176.0,\n  8: 444.3,\n  9: 63.47\n}\n```\n\n## Contributing\n\nTo build and test:\n\n```sh\nyarn bootstrap # install and build\nyarn test # run tests\n```\n\nTo run benchmarks:\n\n```sh\nyarn bench\n```\n\nPRs should include tests and, if necessary, documentation updates. To make sure non-trivial PRs will be accepted, consider opening an issue first and describe the changes you want to make before completing the work.\n\n## License and Attribution\n\nProvided as open source under the Apache 2 license.\n\nThe placekey-js JavaScript library is provided and maintained by [Unfolded, Inc](https://unfolded.ai).\n\n[![Unfolded](docs/unfolded-logo.png?raw=true)](https://unfolded.ai)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPlacekey%2Fplacekey-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPlacekey%2Fplacekey-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPlacekey%2Fplacekey-js/lists"}