{"id":13607541,"url":"https://github.com/Willyham/hashfill","last_synced_at":"2025-04-12T11:32:56.955Z","repository":{"id":57490575,"uuid":"110242094","full_name":"Willyham/hashfill","owner":"Willyham","description":"Fill geofences with geohashes","archived":false,"fork":false,"pushed_at":"2024-01-27T05:33:34.000Z","size":1261,"stargazers_count":41,"open_issues_count":3,"forks_count":12,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-11-07T12:45:23.306Z","etag":null,"topics":["geofences","geohash","golang","golang-package"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Willyham.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":"2017-11-10T11:56:58.000Z","updated_at":"2024-06-18T13:23:30.000Z","dependencies_parsed_at":"2024-06-20T01:34:16.746Z","dependency_job_id":"6ab2a88f-7799-4c69-860a-9e50722dc823","html_url":"https://github.com/Willyham/hashfill","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Willyham%2Fhashfill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Willyham%2Fhashfill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Willyham%2Fhashfill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Willyham%2Fhashfill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Willyham","download_url":"https://codeload.github.com/Willyham/hashfill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248560315,"owners_count":21124630,"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":["geofences","geohash","golang","golang-package"],"created_at":"2024-08-01T19:01:19.525Z","updated_at":"2025-04-12T11:32:56.054Z","avatar_url":"https://github.com/Willyham.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"[![GoDoc](http://godoc.org/github.com/Willyham/hashfill?status.png)](http://godoc.org/github.com/Willyham/hashfill) [![Go Report Card](https://goreportcard.com/badge/github.com/Willyham/hashfill)](https://goreportcard.com/report/github.com/Willyham/hashfill)\n\n## Usage\n\nHashfill is a library for computing the set of geohashes which are contained by a geofence. It can either produce a set\nof hashes which are completely contained or one which also includes where the boundaries intersect. It currently operates on\n`geom.Polygon` objects from the [https://github.com/twpayne/go-geom](go-geom) pacakge. Converting from geojson is simple and this\npackage may offer a utility in the future.\n\n```golang\nfunc readFileAsGeometry(t *testing.T, file string) (*geom.Polygon, error) {\n\tdata, err := ioutil.ReadFile(file)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tpoly := new(geom.T)\n\terr = geojson.Unmarshal(data, poly)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn nil, (*poly).(*geom.Polygon)\n}\n\ngeofence := readFileAsGeometry(\"testdata/regents.geojson\")\nfiller := hashfill.NewRecursiveFiller(\n  hashfill.WithMaxPrecision(8),\n)\n\nhashes, err := filler.Fill(geofence, hashfill.FillIntersects)\n```\n\nWould result in something that could be visualized as:\n\n![](./doc/fill.png)\n\n### Installation\n\nThis library depends on headers from the `geos` library. You can install with `brew install geos` or `dnf install geos-devel` on RPM based linux distros.\n\n### Options\n- `WithMaxPrecision` - Sets the max hash precision the algorithm will generate hashes for.\n- `WithFixedPrecision` - Causes the fully contained geohashes to still be divided into the hashes of the max precision.\n- `WithPredicates` - Can be used to supply your own functions for `Intersect` and `Contains` rather than the built in ones.\n\n\n### Improvements\n\nTODO:\n\n- [] Fix bug in geofences with holes.\n- [] Corner based check optimisations (+ hybrid)\n- [] Cache poly to geom operation in predicates.\n- [] Add benchmarks\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWillyham%2Fhashfill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWillyham%2Fhashfill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWillyham%2Fhashfill/lists"}