diff --git a/cpp/cuproj/README.md b/cpp/cuproj/README.md index 2ce105ec5..414104ebf 100644 --- a/cpp/cuproj/README.md +++ b/cpp/cuproj/README.md @@ -46,20 +46,15 @@ The C++ API also supports transforming coordinate in CUDA device code. Create a be passed to a kernel launch. Here's an example kernel. ```cpp -template -using coordinate = typename cuproj::vec_2d; +using device_projection = cuproj::device_projection>; -template -using device_projection = cuproj::device_projection>; - -__global__ -void example_kernel(device_projection const d_proj, - cuproj::vec_2d const* in, - cuproj::vec_2d* out, - size_t n) +__global__ void example_kernel(device_projection const d_proj, + cuproj::vec_2d const* in, + cuproj::vec_2d* out, + size_t n) { for (size_t i = blockIdx.x * blockDim.x + threadIdx.x; - i < n; + i < n; i += gridDim.x * blockDim.x) { out[i] = d_proj.transform(in[i]); } diff --git a/cpp/cuproj/doxygen/main_page.md b/cpp/cuproj/doxygen/main_page.md index 000a63c4f..d60818cb0 100644 --- a/cpp/cuproj/doxygen/main_page.md +++ b/cpp/cuproj/doxygen/main_page.md @@ -13,26 +13,10 @@ transformations are supported: - WGS84 to/from UTM -## Example - -The C++ API is designed to be easy to use. The following example shows how to transform a point in -Sydney, Australia from WGS84 (lat, lon) coordinates to UTM zone 56S (x, y) coordinates. - -```cpp -#include -#include - -// Make a projection to convert WGS84 (lat, lon) coordinates to UTM zone 56S (x, y) coordinates -auto proj = cuproj::make_projection>("EPSG:4326", "EPSG:32756"); - -cuproj::vec_2d sydney{-33.858700, 151.214000}; // Sydney, NSW, Australia -thrust::device_vector> d_in{1, sydney}; -thrust::device_vector> d_out(d_in.size()); - -// Convert the coordinates. Works the same with a vector of many coordinates. -proj.transform(d_in.begin(), d_in.end(), d_out.begin(), cuproj::direction::FORWARD); -``` +There are some basic examples of using the libcuproj C++ API in the +[cuProj README](https://github.com/rapidsai/cuspatial/cpp/cuproj/README.md). ## Useful Links - [RAPIDS Home Page](https://rapids.ai) + - [cuSpatial Github](https://github.com/rapidsai/cuspatial) diff --git a/cpp/cuproj/tests/wgs_to_utm_test.cu b/cpp/cuproj/tests/wgs_to_utm_test.cu index 6d91135a4..1b55e18c7 100644 --- a/cpp/cuproj/tests/wgs_to_utm_test.cu +++ b/cpp/cuproj/tests/wgs_to_utm_test.cu @@ -324,7 +324,9 @@ TYPED_TEST(ProjectionTest, readme_example) proj->transform(d_in.begin(), d_in.end(), d_out.begin(), cuproj::direction::FORWARD); } -__global__ void example_kernel(cuproj::device_projection> const d_proj, +using device_projection = cuproj::device_projection>; + +__global__ void example_kernel(device_projection const d_proj, cuproj::vec_2d const* in, cuproj::vec_2d* out, size_t n)