Skip to content
CUDA-accelerated GIS and spatiotemporal algorithms
Python Cuda C++ CMake Shell
Branch: branch-0.11
Clone or download
GPUtester Merge pull request #83 from rapidsai/branch-0.10
[gpuCI] Auto-merge branch-0.10 to branch-0.11 [skip ci]
Latest commit 4291f19 Oct 10, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add CODEOWNERS Sep 5, 2019
ci Added Oct 10, 2019
cpp DOC Update to v0.11 Sep 26, 2019
python/cuspatial [REVIEW] Improve documentation and return a hausdorff matrix. (#58) Oct 9, 2019
.gitignore test fix, .gitignore fix, changelog Sep 9, 2019
.pre-commit-config.yaml python and cython style cleanup, pre-commit hook Sep 9, 2019 Merge pull request #83 from rapidsai/branch-0.10 Oct 10, 2019 DOC Remove template references and update for cuSpatial Sep 4, 2019
LICENSE Initial commit Jul 30, 2019 Update Sep 11, 2019 Address various review concerns Sep 9, 2019
pyproject.toml Add cython headers to install, python / cmake packaging cleanup Sep 6, 2019
setup.cfg Add cython headers to install, python / cmake packaging cleanup Sep 6, 2019


GPU-Accelerated Spatial and Trajectory Data Management and Analytics Library

NOTE: cuSpatial depends on cuDF and RMM from RAPIDS.

Implemented 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

Future support is planned for the following operations.

  1. Temporal window query
  2. Temporal point query (year+month+day+hour+minute+second+millisecond)
  3. Point-to-polyline nearest neighbor distance
  4. Grid-based indexing for points and polygons
  5. Quadtree-based indexing for large-scale point data
  6. R-Tree-based indexing for Polygons/Polylines

Install from Conda

To install via conda: conda install -c rapidsai-nightly cuspatial

Install from Source

To build and install cuSpatial from source:

Install dependencies

Currently, building cuSpatial requires a source installation of cuDF. Install cuDF by following the instructions

The rest of steps assume the environment variable CUDF_HOME points to the root directory of your clone of the cuDF repo, and that the cudf_dev Anaconda environment created in step 3 is active.

Clone, build and install cuSpatial

  1. export CUSPATIAL_HOME=$(pwd)/cuspatial
  2. clone the cuSpatial repo
  1. Compile and install C++ backend
mkdir build
cd build
make # (or make -j [n])
make install

cuSpatial should now be installed at $CONDA_PREFIX. The cuspatial include path is $CONDA_PREFIX/include/cuspatial/ and the library path is $CONDA_PREFIX/lib/

  1. Compile and install cuSpatial Python wrapper and run Python test code
cd $CUSPATIAL_HOME/python/cuspatial
python build_ext --inplace
python install
  1. Run python test code

First, add the cuSpatial Python API path to PYTHONPATH (there are tools under tests subdir): export PYTHONPATH=$CUSPATIAL_HOME/python/cuspatial

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

python  $CUSPATIAL_HOME/python/cuspatial/cuspatial/tests/

However, many test code uses real data from an ITS (Intelligent Transportation System) application. You will need to follow instructions at data/ to generate data for these test code. Alternatively, you can download the preprocessed data ("locust.", "its_4326_roi.", "itsroi.ply" and "its_camera_2.csv") from here. Extract the files and put them directly under $CUSPATIAL_HOME/data for quick demos. A brief description of these data files and their semantic roles in the ITS application can be found here TODO THIS IS MISSING

After data are downloaded and/or pre-processed, you can run the python test code:

python  $CUSPATIAL_HOME/python/cuspatial/cuspatial/tests/
python  $CUSPATIAL_HOME/python/cuspatial/cuspatial/tests/
python  $CUSPATIAL_HOME/python/cuspatial/cuspatial/tests/

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

You can’t perform that action at this time.