This project is a Java-based implementation of an R*-tree spatial index designed to handle OpenStreetMap (OSM) data. Developed as a university project for Database Technologies, it focuses on efficient spatial data management by organizing data into blocks stored within a datafile.
The system supports advanced spatial queries and includes a Python-based visualization module to analyze query performance and structure.
- R*-Tree Indexing: Efficient handling of spatial data using the R*-tree data structure.
- Block Storage: Organizes OSM data into blocks for optimized disk storage and retrieval.
- Spatial Queries:
- Range Queries: Find all objects within a specific rectangular area.
- k-Nearest Neighbors (k-NN): Find the k closest objects to a given point.
- Skyline Queries: Identify interesting points based on multi-dimensional dominance.
- Visualization: Python scripts to visualize the R*-tree structure and query results.
- Performance Analysis: capabilities to record and compare query execution times.
src/- Contains the Java source code for the R*-tree implementation and query logic.Python Visualization/- Contains Python scripts for generating graphs and visualizing spatial data.database_tech.iml- IntelliJ IDEA module file.
- Java Development Kit (JDK): Version 8 or higher.
- Python: Version 3.x (for visualization).
- IntelliJ IDEA: Recommended for opening and running the project (configuration files included).
- Python Libraries:
matplotlib(and potentiallynumpy/pandasdepending on the scripts).
-
Clone the repository:
git clone [https://github.com/NikKliaf/r-tree-java-implementation.git](https://github.com/NikKliaf/r-tree-java-implementation.git) cd r-tree-java-implementation -
Open in IntelliJ IDEA:
- Launch IntelliJ IDEA.
- Select Open and choose the cloned project folder.
- The IDE should automatically detect the source roots and dependencies based on the
.imlfile.
-
Setup Python Environment (Optional for Visualization):
cd "Python Visualization" pip install matplotlib
- Locate the main entry point in the
srcfolder (e.g.,Main.javaor similar). - Ensure you have the required OpenStreetMap (OSM) data file available (referenced in the code as the source for the block storage).
- Run the class via IntelliJ or command line.
To visualize the R*-tree or query results:
- Navigate to the visualization folder:
cd "Python Visualization"
- Run the python script:
(Note: Replace
python <script_name>.py
<script_name>.pywith the actual name of the python file in that directory, e.g.,plot.pyormain.py)
This project is designed to ingest OpenStreetMap XML data. You may need to place your .osm file in the project root or specify its path in the main configuration/code before running the ingestion process.
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
This project is open-source. Please check the repository for specific license details.