{"id":13721578,"url":"https://github.com/armon/erl-rstar","last_synced_at":"2025-08-31T17:35:00.487Z","repository":{"id":5528225,"uuid":"6730369","full_name":"armon/erl-rstar","owner":"armon","description":"An Erlang implementation of the R*-tree spacial data structure","archived":false,"fork":false,"pushed_at":"2018-07-11T00:56:37.000Z","size":308,"stargazers_count":59,"open_issues_count":0,"forks_count":18,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-04T19:32:25.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/armon.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":"2012-11-17T00:31:35.000Z","updated_at":"2024-02-21T16:00:41.000Z","dependencies_parsed_at":"2022-07-06T23:33:52.755Z","dependency_job_id":null,"html_url":"https://github.com/armon/erl-rstar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/armon/erl-rstar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armon%2Ferl-rstar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armon%2Ferl-rstar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armon%2Ferl-rstar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armon%2Ferl-rstar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armon","download_url":"https://codeload.github.com/armon/erl-rstar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armon%2Ferl-rstar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273015620,"owners_count":25031320,"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-08-31T02:00:09.071Z","response_time":79,"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":[],"created_at":"2024-08-03T01:01:18.849Z","updated_at":"2025-08-31T17:35:00.429Z","avatar_url":"https://github.com/armon.png","language":"Erlang","funding_links":[],"categories":["Geolocation","General Libraries"],"sub_categories":[],"readme":"Erlang Rstar [![Build Status](https://travis-ci.org/armon/erl-rstar.png)](https://travis-ci.org/armon/erl-rstar)\n=========\n\nThis application provides a pure Erlang implementation of the R*-tree\ndata structure. The R*-tree structure is particularly suited for indexing\nmulti-dimensional data, with relatively low dimensionality. It is a commonly\nused data structure for geo-spacial data for this reason. In addition to\nefficiently supporting window queries, it can also quickly find the nearest\nneighbors of a point.\n\nThis implementation is in-memory only and does not provide builtin support\nfor disk-backed usaged.\n\n\nModules\n-----\n\n* rstar : The primary top level module used to manipulate the tree\n* rstar_geometry : Used to modify the geometry type associated with trees\n* rstar_util: Contains a various utility methods that may be useful\n\n\nUsage\n-----\n\nBelow are some examples of usage.\nSimple creation of trees and population of points:\n\n    % Creates a two dimensional R-tree\n    Tree = rstar:new(2),\n\n    % Create a point, at X:1, Y:3, opaque value foo\n    Point = rstar_geometry:point2d(1, 3, foo),\n\n    % Insert into the tree, returning a new tree\n    T2 = rstar:insert(Tree, Point),\n\n    % Delete the point\n    T3 = rstar:delete(T2, Point).\n\n\nCreating various geometries:\n\n    % Create a 2D box from the origin to 2,2\n    Box = rstar_geometry:new(2, [{0, 2}, {0, 2}], small_box),\n\n    % Create a 3D box\n    Box3D = rstar_geometry:new(3, [{2, 3}, {2, 3}, {2, 3}], three_d_box),\n\n    % Create a 3D point\n    Point3D = rstar_geometry:point3d(0, 1, 2, point3d),\n\n    % Create a 4D point at the origin\n    Origin4D = rstar_geometry:origin(4).\n\n\nVarious queries:\n\n    % Create a tree and populate it\n    T = rstar:new(2),\n    ....\n    TFinal = rstar:insert(...),\n\n    % Do box query\n    Box = rstar_geometry:new(2, [{0, 2}, {0, 2}], small_box),\n    Matching = rstar:search_within(TFinal, Box),\n\n    % Do a circular query around a point within a distance of 10 units\n    % Distance is Euclidean distance\n    Point = rstar_geometry:point2d(1, 3, undefined),\n    Matching = rstar:search_around(TFinal, Point, 10.0),\n\n    % Find the nearest 20 points\n    Matching = rstar:search_nearest(TFinal, Point, 20),\n\nDependencies\n------------\n\nRequires Erlang 18.0 or higher.\n\nReferences\n----------\n\nRelated works:\n\n* [R-trees: A dynamic index structure for spacial searching](http://www.cs.jhu.edu/~misha/ReadingSeminar/Papers/Guttman84.pdf)\n* [The R*-tree: An Efficient and Robust Access Method for Points and Rectangles](http://www.cs.ucr.edu/~tsotras/cs236/F11/rstar.pdf)\n* [Nearest Neighbor Queries](http://postgis.refractions.net/support/nearestneighbor.pdf)\n* [Enhanced Nearest Neighbor Search on the R-tree](http://www.cse.cuhk.edu.hk/~adafu/Pub/rtree.ps)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmon%2Ferl-rstar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmon%2Ferl-rstar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmon%2Ferl-rstar/lists"}