Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple CLI Program for Comparing Spatial Indexing Methods

I gave a talk at the Italian C++ Community where I explain how spatial indices work, when they are useful, and the code I wrote.
Link to the video on youtube: link

How to Build

Dependencies

build with cmake

mkdir build && cd build
cmake ..
cmake --build .

If you have installed the dependency libraries in a non-standard path, you must specify the path before building with:

cmake .. -DGEOS_PATH:PATH=<your_path_to_geos>
cmake .. -DSHAPELIB_PATH:PATH=<your_path_to_shapelib>
cmake .. -DCLI_PATH:PATH=<your_path_to_cli>

Functionality

I created a CLI with several commands:

  • help
    Displays the list of commands and how to use them.

  • load [file.shp]
    Reads a shapefile containing geometries and saves them in memory.

  • build [kd-tree|quad-tree|r-tree|geohash]
    Builds the specified data structure with the previously loaded geometries.

  • search_range [kd-tree|quad-tree|r-tree|geohash] --x1 --y1 --x2 --y2
    Performs a query on the specified data structure using the rectangle defined by the given coordinates.

  • search_range [kd-tree|quad-tree|r-tree|geohash]
    Performs a query on the specified data structure using a randomly generated rectangle.

  • compare <iterations>
    Performs n queries on the already built data structures and prints the times.

  • compare --x1 --y1 --x2 --y2
    Performs a query on the already built data structures using the rectangle defined by the given coordinates and prints the times.

About

comparator of spatial indexing methods

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages