Integration examples#

An integration example completes one task with two or more cuGeo libraries, such as transforming point coordinates with cugeo-proj and then joining the points to polygons with cugeo-geometry. A task that one library completes alone belongs in that library’s documentation, even when the library calls another one internally; the orthorectification in cugeo-raster, which uses cugeo-proj, is documented by cugeo-raster.

Reproject locations and join them to service areas transforms WGS 84 points to UTM zone 31N, materializes WKB in Arrow, and checks a point-polygon join against independent reference rows.

Add an example#

An example runs from a fresh clone of one committed repository revision. A reader who follows the page reaches the output it shows.

  1. Write the page as docs/site/integration-examples/<name>.md, where <name> names the task, for example reproject-then-join. Add <name> to the toctree at the end of this page.

  2. Start the page with a table of the libraries it uses: for each library, its name, the version in its pyproject.toml and a link to its documentation.

  3. Build each library with the recipe in its README, and link that README instead of copying its steps. Each library is its own Python project (cugeo-geometry/pyproject.toml, cugeo-proj/pyproject.toml, cugeo-raster/pyproject.toml), so state the commands that install every library the example imports into one environment.

  4. Show the inputs. Use data in the repository, or data the page downloads from a stable URL with a stated license. Name the CRS and units of every coordinate the example passes from one library to the next.

  5. Show the code and the output it prints. Keep code that does not fit on the page in a script beside it, in docs/site/integration-examples/, and link the script with the repo role, for example {repo}`docs/site/integration-examples/reproject-then-join.py` .

  6. Register the executable program in tools/docs_examples.json with a libraries list naming the cuGeo libraries it uses. Follow Check documentation examples to run it and check its output. Verify the page’s setup from a fresh clone at that same revision. Keep the commit, hardware and build identities in the execution receipts rather than the page.

  7. Build the site with the command in docs/site/README.md. The build fails on any warning and on any broken link between the site’s pages.