{"id":21896830,"url":"https://github.com/dscyrescotti/rtree","last_synced_at":"2025-09-07T23:43:09.816Z","repository":{"id":264759117,"uuid":"809088869","full_name":"dscyrescotti/RTree","owner":"dscyrescotti","description":"A Swift implementation of R-Tree data structure for spatial indexing.","archived":false,"fork":false,"pushed_at":"2024-11-26T07:19:09.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T05:15:53.381Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","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/dscyrescotti.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":"2024-06-01T16:48:17.000Z","updated_at":"2024-11-26T07:16:41.000Z","dependencies_parsed_at":"2024-11-26T07:38:06.708Z","dependency_job_id":null,"html_url":"https://github.com/dscyrescotti/RTree","commit_stats":null,"previous_names":["dscyrescotti/rtree"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dscyrescotti/RTree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dscyrescotti%2FRTree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dscyrescotti%2FRTree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dscyrescotti%2FRTree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dscyrescotti%2FRTree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dscyrescotti","download_url":"https://codeload.github.com/dscyrescotti/RTree/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dscyrescotti%2FRTree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274112814,"owners_count":25224331,"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-09-07T02:00:09.463Z","response_time":67,"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-11-28T14:14:25.706Z","updated_at":"2025-09-07T23:43:09.761Z","avatar_url":"https://github.com/dscyrescotti.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌲 RTree\n\n**RTree** implements [R-tree](https://en.wikipedia.org/wiki/R-tree) data structure in Swift for spatial indexing in a two-dimentional coordinate space.\n\n## 💡 Features\n**RTree** currently supports the following methods to manage 2D spatial data.\n- [Retrieval](#retrieval)\n- [Insertion](#insertion)\n- [Removal](#removal)\n- [Search](#search)\n\n### Retrieval \u003ca id=\"retrieval\"\u003e\u003c/a\u003e\n`traverse()` retrieves an array with all spatial data stored in the R-tree.\n```swift\nlet rTree = RTree\u003cInt\u003e()\nrTree.retrieve() // an array of integers\n```\n\u003e Note: Please be aware that `traverse()` does not guarantee that the result will maintain the order of your insertion.\n\n### Insertion \u003ca id=\"insertion\"\u003e\u003c/a\u003e\nA spatial data can be inserted into the R-tree using `insert(_:in:)`. It requires you to specify a bounding box as the spatial index.\n```swift\nlet rTree = RTree\u003cInt\u003e()\nlet box = Box(minX: -10, minY: -10, maxX: 10, maxY: 10) // a bounding box\nrTree.insert(0, in: box) // inserted at the spatial coordinate of (0, 0)\n```\n\n### Removal \u003ca id=\"removal\"\u003e\u003c/a\u003e\nA spatial data can be removed from the R-tree using `remove(_:in:)` which returns the removed data if it is found in a specified boundary.\n```swift\nlet rTree = RTree\u003cInt\u003e()\nlet box = Box(minX: -10, minY: -10, maxX: 10, maxY: 10) // a bounding box\nrTree.remove(0, in: box) // removed\n```\n\n### Search \u003ca id=\"search\"\u003e\u003c/a\u003e\n`search(box:)` retrieves an array of some spatial data inside a specific bounding box within the R-tree.\n```swift\nlet rTree = RTree\u003cInt\u003e()\nlet box = Box(minX: -10, minY: -10, maxX: 10, maxY: 10) // a bounding box\nrTree.search(box: box) // an array of some spatial data\n```\n\n## 🛠 Installation \n### 📦 Using Swift Package Manager\nAdd it as a dependency within your Package.swift.\n```swift\ndependencies: [\n    .package(url: \"https://github.com/dscyrescotti/RTree.git\", from: \"1.0.0\")\n]\n```\n\n## © License\n**RTree** is available under the MIT license. See the  [LICENSE](/LICENSE)  file for more info.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdscyrescotti%2Frtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdscyrescotti%2Frtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdscyrescotti%2Frtree/lists"}