{"id":15056397,"url":"https://github.com/g-andrade/erlquad","last_synced_at":"2025-10-04T16:30:53.707Z","repository":{"id":57496693,"uuid":"55189478","full_name":"g-andrade/erlquad","owner":"g-andrade","description":"Simple quadtrees","archived":true,"fork":false,"pushed_at":"2019-01-19T18:32:34.000Z","size":25,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-29T13:21:34.301Z","etag":null,"topics":["erlang","quadtree"],"latest_commit_sha":null,"homepage":"","language":"Erlang","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/g-andrade.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}},"created_at":"2016-03-31T23:23:36.000Z","updated_at":"2023-07-28T05:42:10.000Z","dependencies_parsed_at":"2022-09-02T01:21:51.458Z","dependency_job_id":null,"html_url":"https://github.com/g-andrade/erlquad","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Ferlquad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Ferlquad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Ferlquad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-andrade%2Ferlquad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g-andrade","download_url":"https://codeload.github.com/g-andrade/erlquad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235274287,"owners_count":18963889,"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":["erlang","quadtree"],"created_at":"2024-09-24T21:50:47.816Z","updated_at":"2025-10-04T16:30:48.385Z","avatar_url":"https://github.com/g-andrade.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# erlquad #\n\nCopyright (c) 2016 Guilherme Andrade\n\n__Version:__ 1.1.2\n\n__Authors:__ Guilherme Andrade ([`erlquad(at)gandrade(dot)net`](mailto:erlquad(at)gandrade(dot)net)).\n\n`erlquad`: A simple Erlang quadtree implementation\n\n\n---------\n\n`erlquad` is a straightforward Erlang implementation of [quadtrees](https://en.wikipedia.org/wiki/Quadtree), supporting both bounding-box outlines as well as precise coordinates for small enough objects.\n\nIt exposes functions for fetching, folding and any'ing (with boolean predicate) particular areas of interest as well as all contained objects. Deeplist versions of fetching methods are also included for when there's no need to concatenate the intermediate results and thus avoid the overhead of doing so.\n\nBuckets have unlimited capacity and depth is fixed on initialization.\n\n```erlang\n\nObject1 = #big_square{ x = 1000, y = 750,  side = 10 },\nObject2 = #tiny_circle{ x = 3000, y = 1000 },\nObject3 = #tiny_circle{ x = 3000, y = 2000 },\n\nGetOutline = fun (#tiny_circle{ x = X, y = Y }) -\u003e\n                    {X, Y};\n                 (#big_square{ x = X, y = Y, side = S }) -\u003e\n                    {X - S/2, Y - S/2, X + S/2, Y + S/2}\n             end,\n\nIsSquare = fun (#tiny_circle{}) -\u003e false;\n               (#big_square{})  -\u003e true\n           end,\n\nCountCirclesFold = fun (#tiny_circle{}, Acc) -\u003e Acc + 1;\n                       (#big_square{}, Acc)  -\u003e Acc\n                   end,\n\nQ1 = erlquad:new(0, 0, 4000, 3000, 3), % Left, Bottom, Right, Top, Depth\nQ2 = erlquad:objects_add([Object1, Object2, Object3], GetOutline, Q1),\n\nerlquad:area_query(0, 0, 1999, 2999, Q2),       % [#big_square{...}]\nerlquad:area_query(2000, 0, 3999, 2999, Q2),    % [#tiny_circle{...}, #tiny_circle{...}]\nerlquad:area_query(0, 0, 3999, 2999, Q2),       % [#big_square{...}, #tiny_circle{...}, #tiny_circle{...}]\n\nerlquad:area_query_deep(0, 0, 3999, 2999, Q2),  % [[], [[#big_square{...}, [[], [], ...]], [[[], ...[]]]]]\n\nerlquad:area_query_any(IsSquare, 0, 0, 1999, 1499, Q2),       % true\nerlquad:area_query_any(IsSquare, 2000, 1500, 3999, 2999, Q2), % false\n\nerlquad:area_query_fold(CountCirclesFold, 0, 2000, 0, 3999, 2999, Q2), % 2\nerlquad:area_query_fold(CountCirclesFold, 0, 2000, 0, 3999, 1499, Q2), % 1\nerlquad:area_query_fold(CountCirclesFold, 0, 2000, 0, 3999, 749, Q2),  % 0\n\nerlquad:objects_any(IsSquare, Q2), % true\n\nerlquad:objects_fold(CountCirclesFold, 0, Q2), % 2\n\nerlquad:objects_all(Q2), % [#big_square{...}, #tiny_circle{...}, #tiny_circle{...}]\n\nerlquad:objects_deep_all(Q2), % [[], [[#big_square{...}, [[], [], ...]], [[[], ...[]]]]]\n\n```\nDefine 'COMPILE_NATIVE_ERLQUAD' (e.g. \"rebar compile -DCOMPILE_NATIVE_ERLQUAD\") for HiPE compilation.\n\n\n## Modules ##\n\n\n\u003ctable width=\"100%\" border=\"0\" summary=\"list of modules\"\u003e\n\u003ctr\u003e\u003ctd\u003e\u003ca href=\"https://github.com/g-andrade/erlquad/blob/master/doc/erlquad.md\" class=\"module\"\u003eerlquad\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-andrade%2Ferlquad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg-andrade%2Ferlquad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-andrade%2Ferlquad/lists"}