{"id":13500549,"url":"https://github.com/stephenlb/geohash-chat-by-proximity","last_synced_at":"2026-01-08T13:06:43.050Z","repository":{"id":15682307,"uuid":"18419899","full_name":"stephenlb/geohash-chat-by-proximity","owner":"stephenlb","description":"Geo Hashing Chat by Proximity to connect two or more users to a group chat.","archived":false,"fork":false,"pushed_at":"2022-12-09T20:39:49.000Z","size":19,"stargazers_count":44,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"gh-pages","last_synced_at":"2025-02-05T00:46:34.482Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://stephenlb.github.io/geohash-chat-by-proximity/","language":"HTML","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/stephenlb.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":"2014-04-03T22:14:41.000Z","updated_at":"2024-01-07T18:38:09.000Z","dependencies_parsed_at":"2023-01-11T20:23:47.628Z","dependency_job_id":null,"html_url":"https://github.com/stephenlb/geohash-chat-by-proximity","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenlb%2Fgeohash-chat-by-proximity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenlb%2Fgeohash-chat-by-proximity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenlb%2Fgeohash-chat-by-proximity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephenlb%2Fgeohash-chat-by-proximity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephenlb","download_url":"https://codeload.github.com/stephenlb/geohash-chat-by-proximity/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246258134,"owners_count":20748521,"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":[],"created_at":"2024-07-31T22:01:04.866Z","updated_at":"2026-01-08T13:06:43.034Z","avatar_url":"https://github.com/stephenlb.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# Geohashing Chat by Proximity UPDATED\n\n\u003e 💡 [NEW PubNub GitHub repository for New Geo Chat](https://github.com/PubNubDevelopers/Geohashing-Chat-by-Proximity)\n\nUse the above link to find the latest Geo Powered Chat.\nBelow is the older version.\n\n# Geohashing Chat by Proximity\n\n### Try it now: [Geohash Chat by Proximity][1]\n\nTo connect groups of two or more people by location, you will take lat/long values and reduce the resolution of accuracy, and by doing this you can expand the coverage of proximity.  You can use multiple resolutions at once or a fixed resolution.  \n\n\u003e Get Source Code: [GitHub Repository for Geo Chat by Proximity][2]\n\n![Geohashing Chat Conversations based on Proximity Zoom Level][3]\n\n## Basics of Geo Hashing\n\nNext we'll cover some source code snippet for geo hashing lat/long coords. It is fairly simple to increase the radius of lat/long position by reducing the accuracy of the float values.  Using this you can expand the circle and collect a Lat/Long.\n\n    // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n    // Geo Hash\n    // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n    function geohash( coord, resolution ) {\n        var rez = Math.pow( 10, resolution || 0 );\n        return Math.floor(coord * rez) / rez;\n    }\n\n![Acquire Lat Long Chat Proximity Location][4]\n\n## Geo Hashing Resolution \"Zoom\"\n\n\"Zoom\" levels, basically several different cartesian grids with larger and smaller granularity.  Once a Geofencing event fires, you will publish to a set of channels corresponding with each zoom level.  Zoom levels are important as that is how we actually construct the link between Geofencing and PubNub.  Zoom level is the resolution/de-resolution of the Cartesian coordinates Lat/Long (think X,Y coord).  By reducing the resolution of the lat/long coord we can construct a channel name that hits 1 box of the grid.  Less resolution means larger the boxes and is required to determine a PubNub Channel that is associated.\n\n    // Create Proximity Channel\n    channel = geohash( pos.latitude, 0 ) + '' + geohash( pos.longitude, 0 );\n\nThis will create a very wide circle and generate a channel name used to connect.  Next connect to PubNub with this channel name.\n\n    // Connect to Proximity Channel\n    pubnub.subscribe({\n         channel : channel,\n         message : receive,\n         connect : ready,\n        presence : presence\n    });\n\n![Acquired Latitude Longitude Chat Proximity Group][5]\n\n## Multiplexing 9 Boxes\n\nYou will calculate the surrounding squares to extend the taper and radius in a way that provides more accuracy. This will remove the \"fencing\" effect.\n\n## Geo Hashing with PubNub Conclusion\n\nThat's it! You simply reduce the resolution of a geo coordinate and use that as a channel name on PubNub.  Also check out the browser's `navigator.geolocation.getCurrentPosition(...)` method to acquire lat/long in a chrome/firefox/ie/opera/mobile/safari browser.\n\n\u003e Also checkout the [PubNub Connected Car Solution Kit][7]\n\n![Geohashing Chat Conversations based on Proximity Nearby][6]\n\n\n  [1]: http://stephenlb.github.io/geohash-chat-by-proximity/\n  [2]: https://github.com/stephenlb/geohash-chat-by-proximity\n  [3]: http://i.stack.imgur.com/tV9S7.jpg\n  [4]: http://i.stack.imgur.com/LUAvv.png\n  [5]: http://i.stack.imgur.com/GQD3n.png\n  [6]: http://i.stack.imgur.com/u0uE0.png\n  [7]: http://www.pubnub.com/developers/connected-car/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenlb%2Fgeohash-chat-by-proximity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephenlb%2Fgeohash-chat-by-proximity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephenlb%2Fgeohash-chat-by-proximity/lists"}