{"id":21001130,"url":"https://github.com/j05u3/spatial-hash-table","last_synced_at":"2026-05-22T10:02:30.838Z","repository":{"id":57001828,"uuid":"86859917","full_name":"j05u3/spatial-hash-table","owner":"j05u3","description":"2D hash table for fast edges-or-points-touching-circle retrieval","archived":false,"fork":false,"pushed_at":"2019-02-10T02:56:00.000Z","size":75,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-08T09:07:05.098Z","etag":null,"topics":["2d-hash-table","2d-tile","hash","in-memory-database","in-memory-storage","nearby","nearby-locations","php","spatial","spatial-functions","spatial-index","table"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/j05u3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-31T20:58:37.000Z","updated_at":"2022-11-28T06:44:49.000Z","dependencies_parsed_at":"2022-08-21T14:10:40.502Z","dependency_job_id":null,"html_url":"https://github.com/j05u3/spatial-hash-table","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j05u3%2Fspatial-hash-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j05u3%2Fspatial-hash-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j05u3%2Fspatial-hash-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j05u3%2Fspatial-hash-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j05u3","download_url":"https://codeload.github.com/j05u3/spatial-hash-table/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243418694,"owners_count":20287798,"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":["2d-hash-table","2d-tile","hash","in-memory-database","in-memory-storage","nearby","nearby-locations","php","spatial","spatial-functions","spatial-index","table"],"created_at":"2024-11-19T08:13:53.554Z","updated_at":"2025-12-28T11:05:57.319Z","avatar_url":"https://github.com/j05u3.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## Installation\n\nUsing [Composer](https://getcomposer.org), just add it to your `composer.json` by running:\n\n```\ncomposer require josue/spatial-hash-table\n```\n\n## Description\n\nYou can throw edges and points at it and than make fast proximity queries in a fixed radius (set in the constructor).\n\n## Usage\n\nExample\n\n![Alt Test case graph](docs/sample.png?raw=true \"Test case\")\n\n```php\n\u003c?php\n\nuse SpatialHashTable\\BiHashTable;\nuse SpatialHashTable\\SupportedGeometries\\Edge;\nuse SpatialHashTable\\SupportedGeometries\\Point;\n\n$b = new BiHashTable(1);\n\n$b-\u003eaddElement(new Edge(new Point(-1.5, -1), new Point( -0.5, -0.5), 100));\n$b-\u003eaddElement(new Edge(new Point(1.25, 1.5), new Point( 0.5, 0.75), 200));\n$b-\u003eaddElement(new Edge(new Point(1.75, 1.75), new Point( 1.75, 1.25), 300));\n$b-\u003eaddElement(new Point(0.5, 0.5, 400));\n\n\necho json_encode($b-\u003egetAllElementsInCircle(new Point(0,0)));\n\n```\nAnd the output is: \n\n```json\n{\n  \"100\": {\n    \"id\": 100,\n    \"p1\": {\n      \"id\": 0,\n      \"x\": -1.5,\n      \"y\": -1\n    },\n    \"p2\": {\n      \"id\": 0,\n      \"x\": -0.5,\n      \"y\": -0.5\n    }\n  },\n  \"200\": {\n    \"id\": 200,\n    \"p1\": {\n      \"id\": 0,\n      \"x\": 1.25,\n      \"y\": 1.5\n    },\n    \"p2\": {\n      \"id\": 0,\n      \"x\": 0.5,\n      \"y\": 0.75\n    }\n  },\n  \"400\": {\n    \"id\": 400,\n    \"x\": 0.5,\n    \"y\": 0.5\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj05u3%2Fspatial-hash-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj05u3%2Fspatial-hash-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj05u3%2Fspatial-hash-table/lists"}