https://github.com/thegeekyasian/geo-assist Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} thegeekyasian / geo-assist Public * Notifications * Fork 5 * Star 76 Geo Assist is a spatial library that allows you to manage spatial data in-memory. License Apache-2.0 license 76 stars 5 forks Star Notifications * Code * Issues 1 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights thegeekyasian/geo-assist This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 2 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/t] Use Git or checkout with SVN using the web URL. [gh repo clone thegee] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @thegeekyasian thegeekyasian Merge pull request #3 from thegeekyasian/feature/ balancing-support ... c2c1682 Feb 17, 2023 Merge pull request #3 from thegeekyasian/feature/balancing-support adding a feature to balance the unbalanced tree c2c1682 Git stats * 11 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time src adding a feature to balance the unbalanced tree February 17, 2023 02:47 .gitignore Initial commit February 5, 2023 06:59 LICENSE Updating pom.xml for maven release changes February 11, 2023 03:30 README.md Update README.me with release version February 13, 2023 15:11 pom.xml Enhancements in NN search. February 13, 2023 06:15 View code [ ] Geo Assist What is it? How to? Install: K-d Tree: Insert Find Nearest Neighbors Delete README.md Geo Assist What is it? Geo assist is library that allows users to perform insertion and query operations on the spatial data. It enables users to create a spatial engine by loading objects with spatial references, such as latitude/longitude, in-memory. The goal of this project is to enable the use of complex search algorithms, by tweaking them for geo-spatial operations. How to? Install: Geo-assist is available on maven repository and can be imported to your project. com.thegeekyasian geo-assist 1.0.1 K-d Tree: K-d Tree, formally called K-Dimensional Trees, are one of the best options when storing and retrieving objects based on geospatial parameters. I have provided an implementation of storing objects in a K-d tree using the coordinates and searching nearest neighbors for the provided location (latitude/longitude) and the distance. Insert Here is how to initialize your data: KDTree kdTree = new KDTree<>(); kdTree.insert(new KDTreeObject.Builder() .id(5) .latitude(25.2002450) .longitude(55.2734184) .build()); Find Nearest Neighbors Once you have inserted your object(s) in the tree, here is how you can search for the nearest neighbors for a provided location: Point point = new Point.Builder() .latitude(25.2012544) .longitude(55.2569389) .build(); List> nearestNeighbors = kdTree.findNearestNeighbor(point, 2); // 2 kilometers based on haversine distance. Delete You can delete the object based on the custom identifier ID: boolean ok = kdTree.delete(5); This is how simple it has been made to query your geo-spatial data. Feel free to contact me or write me an email at hello@thegeekyasian.com About Geo Assist is a spatial library that allows you to manage spatial data in-memory. Topics java location geospatial kd-tree gis tree-structure spatial-data geo-spatial k-d-tree Resources Readme License Apache-2.0 license Stars 76 stars Watchers 4 watching Forks 5 forks Releases 2 v1.0.1 Latest Feb 13, 2023 + 1 release Contributors 2 * @thegeekyasian thegeekyasian Safeer Ansari * @jenspapenhagen jenspapenhagen Jens Papenhagen Languages * Java 100.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.