Skip to content
NVIDIAPublic

About

cuGeo is a monorepo of geospatial libraries for NVIDIA GPUs, currently in developer preview.

Topics

Resources

Security policy

Stars

29 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

cuGeo

cuGeo is a monorepo of geospatial libraries for NVIDIA GPUs, currently in developer preview. Use it to run vector geometry queries, process raster data, and transform coordinates. Our mission is to provide easy to implement and broad acceleration for anyone using NVIDIA GPUs working on geospatial problems.

While in developer preview we expect to find and fix bugs, add broad functionality, and break APIs and ABIs as necessary for the health of the project. Ideas, bug reports, and feature requests are extremely welcome.

Get started

From your local checkout, open your agent harness of choice and run the onboard skill for interactive setup. The onboarding skill helps you choose interfaces, check prerequisites, build the libraries, and run a small check.

To set up a library yourself, please follow its installation guide:

Libraries

Query planar vector geometry with familiar spatial SQL or Python dataframes. A command-line interface and a C/C++ CUDA SDK are also available.

Find points that intersect buildings using either API. Both examples use points.csv and buildings.csv, each with name and WKT shape columns in the same coordinate system.

SQL

import cugeo.geometry as geo

options = {"geometry": {"type": "wkt", "column": "shape"}}
tables = {name: geo.table_from_file(f"{name}.csv", options=options)
          for name in ("points", "buildings")}
result = geo.sql("""
    SELECT p.name AS name_left, b.name AS name_right
    FROM points p JOIN buildings b
    ON ST_Intersects(ST_GeomFromWKB(p.geometry), ST_GeomFromWKB(b.geometry))
""", tables=tables)
print(result.rows)

Dataframe (requires the eager cuDF interface)

import cugeo.geometry as geo

options = {"geometry": {"type": "wkt", "column": "shape"}}
points = geo.read_file("points.csv", options=options)
buildings = geo.read_file("buildings.csv", options=options)
joined = points.sjoin(buildings, predicate="intersects")
print(joined[["name_left", "name_right"]])

Spatial join tutorial

Transform coordinates using Python or native interfaces. Python accepts CuPy arrays for GPU execution and NumPy arrays for host execution.

Transform longitude and latitude to UTM coordinates on the GPU:

import cupy as cp
from cugeo.proj import Transformer

with Transformer.from_crs(4326, 32631, always_xy=True) as transformer:
    east, north, status = transformer.transform_device(
        cp.asarray([3.0, 6.0]), cp.asarray([0.0, 45.0]), return_status=True
    )
    print(east, north, status)

First GPU transform

Read, write, and process raster data, including GeoTIFF and JPEG 2000 imagery. Operations include resampling, orthorectification, and more.

Read a GeoTIFF into a CuPy array (requires a GPU build with nvTIFF):

import cugeo.raster as raster

with raster.open("image.tif") as src:
    pixels = src.read()
    print(pixels.shape)

Replace image.tif with a supported GeoTIFF. Read a file

Shared Concepts

Agent Infrastructure

cuGeo ships with an agent Infrastructure to make it easy for you to locally extend cuGeo in approximately the same way we build it.

Architecture

The libraries use a similar set of layers, with interfaces and execution paths suited to each library:

  • Python: Interfaces for working with geometry, coordinates, and raster data from Python.
  • Rust: Planning and orchestration for operations, including validation and resource management. Raster also exposes a Rust API.
  • C and C++: Native interfaces for integrating cuGeo into applications and other engines. Geometry also exposes its CUDA SDK directly.
  • CUDA: GPU kernels and supporting code for spatial computation. Proj and Raster also provide host execution paths.

We are actively experimenting with cuda-rust and plan to use it fully once it reaches v1.0.

More information

Contributing

cuGeo does not accept external code contributions. There is no contributor sign-off requirement. Ideas, bug reports and feature requests are welcome as issues in this repository's issue tracker; the maintainers implement the changes.

License

cuGeo is licensed under Apache-2.0; see LICENSE. Each library's own LICENSE and NOTICE cover that library: cugeo-geometry (NOTICE), cugeo-proj (NOTICE) and cugeo-raster (NOTICE).

LICENSING.md lists every license and notice file in the repository with what it covers, states how test data is licensed, and states that v0.1 releases the source repository only.

About

cuGeo is a monorepo of geospatial libraries for NVIDIA GPUs, currently in developer preview.

Topics

Resources

Security policy

Stars

29 stars

Watchers

0 watching

Forks

Contributors

Languages