Skip to content

rapidsai/cuspatial

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Oct 25, 2022
Sep 30, 2022
Oct 25, 2022
Oct 28, 2022
Sep 2, 2019
Oct 4, 2022
Sep 27, 2022
Aug 4, 2022
Oct 25, 2022
Nov 6, 2019
Jul 7, 2022
Aug 23, 2022
Oct 18, 2022
Sep 8, 2022
Jul 30, 2019
Oct 25, 2022
Jul 21, 2022
Sep 23, 2022
Jun 17, 2022
Sep 6, 2019

Repository files navigation

 cuSpatial - GPU-Accelerated Spatial and Trajectory Data Management and Analytics Library

Build Status

NOTE: cuSpatial depends on cuDF and RMM from RAPIDS.

Operations

cuSpatial supports the following operations on spatial and trajectory data:

  1. Spatial window query
  2. Point-in-polygon test
  3. Haversine distance
  4. Hausdorff distance
  5. Deriving trajectories from point location data
  6. Computing distance/speed of trajectories
  7. Computing spatial bounding boxes of trajectories
  8. Quadtree-based indexing for large-scale point data
  9. Quadtree-based point-in-polygon spatial join
  10. Quadtree-based point-to-polyline nearest neighbor distance
  11. Distance computation (point-point, point-linestring, linestring-linestring)
  12. Finding nearest points between point and linestring

Future support is planned for the following operations:

  1. Temporal window query
  2. Temporal point query (year+month+day+hour+minute+second+millisecond)
  3. Grid-based indexing for points and polygons
  4. R-Tree-based indexing for Polygons/Polylines

Install from Conda

To install via conda:

conda install -c conda-forge -c rapidsai-nightly cuspatial

Install from Source

To build and install cuSpatial from source:

Pre-requisite

  • gcc >= 7.5
  • cmake >= 3.23
  • miniconda

Fetch cuSpatial repository

export `CUSPATIAL_HOME=$(pwd)/cuspatial` && \
git clone https://github.com/rapidsai/cuspatial.git $CUSPATIAL_HOME

Install dependencies

  1. export CUSPATIAL_HOME=$(pwd)/cuspatial
  2. clone the cuSpatial repo
conda env update --file conda/environments/cuspatial_dev_cuda11.5.yml

Build and install cuSpatial

  1. Compile and install

    cd $CUSPATIAL_HOME && \
    chmod +x ./build.sh && \
    ./build.sh
  2. Run C++/Python test code

    Some tests using inline data can be run directly, e.g.:

    $CUSPATIAL_HOME/cpp/build/gtests/LEGACY_HAUSDORFF_TEST
    $CUSPATIAL_HOME/cpp/build/gtests/POINT_IN_POLYGON_TEST
    python python/cuspatial/cuspatial/tests/legacy/test_hausdorff_distance.py
    python python/cuspatial/cuspatial/tests/test_pip.py

    Some other tests involve I/O from data files under $CUSPATIAL_HOME/test_fixtures. For example, $CUSPATIAL_HOME/cpp/build/gtests/SHAPEFILE_READER_TEST requires three pre-generated polygon shapefiles that contain 0, 1 and 2 polygons, respectively. They are available at $CUSPATIAL_HOME/test_fixtures/shapefiles

NOTE: Currently, cuSpatial supports reading point/polyine/polygon data using Structure of Array (SoA) format and a shapefile reader to read polygon data from a shapefile. Alternatively, python users can read any point/polyine/polygon data using existing python packages, e.g., Shapely and Fiona,to generate numpy arrays and feed them to cuSpatial python APIs.