Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some (but not all) docs for the Rust crate #696

Merged
merged 15 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ bench = false # TODO fix this benchmark
required-features = ["parquet_compression"]

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To see what this gets us, you can run:

RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features -F gdal/bindgen

That will get us feature flags in the output, which is how docs.rs presents stuff. E.g. on the io mod:

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I've been wondering how to get the feature flag badges in the docs! That looks great!

features = [
"csv",
"flatgeobuf",
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# `geoarrow-rs`
# geoarrow-rs

[![GitHub Workflow Status (CI)](https://img.shields.io/github/actions/workflow/status/geoarrow/geoarrow-rs/ci.yml?branch=main&style=for-the-badge)](https://github.com/geoarrow/geoarrow-rs/actions/workflows/ci.yml)
[![docs.rs](https://img.shields.io/docsrs/geoarrow?style=for-the-badge&label=docs.rs)](https://docs.rs/geoarrow/latest/geoarrow/)
[![Crates.io](https://img.shields.io/crates/v/geoarrow?style=for-the-badge)](https://crates.io/crates/geoarrow)
![Crates.io](https://img.shields.io/crates/l/geoarrow?style=for-the-badge)

gadomski marked this conversation as resolved.
Show resolved Hide resolved
A Rust implementation of the [GeoArrow](https://github.com/geoarrow/geoarrow) specification and bindings to [GeoRust algorithms](https://github.com/georust/geo) for efficient spatial operations on GeoArrow memory.

Expand All @@ -20,7 +25,7 @@ This repository also includes [Python bindings](https://github.com/geoarrow/geoa
Add this to your `Cargo.toml`:

```toml
geoarrow = "0.1"
geoarrow = "0.2"
```

## References
Expand Down
7 changes: 3 additions & 4 deletions js/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# `geoarrow-wasm`
# geoarrow-wasm

[![GitHub Workflow Status (WASM)](https://img.shields.io/github/actions/workflow/status/geoarrow/geoarrow-rs/wasm.yml?label=WASM&branch=main&style=for-the-badge)](https://github.com/geoarrow/geoarrow-rs/actions/workflows/wasm.yml)

gadomski marked this conversation as resolved.
Show resolved Hide resolved
Efficient, vectorized geospatial operations in WebAssembly.

Expand All @@ -21,7 +23,6 @@ I wrote a [blog post](https://kylebarron.dev/blog/geos-wasm) about this that goe

Most users will use this by installing the prebuilt JavaScript package. This is published to NPM as [`geoarrow-wasm`](https://npmjs.com/package/geoarrow-wasm).


### From Rust

Advanced users can also depend on these Rust-Wasm bindings directly, enabling you to add custom operations on top of these bindings and generating your own WebAssembly bundles. This means you can reuse all the binding between JavaScript and WebAssembly and focus on implementing your algorithms. This package is published to crates.io as [`geoarrow-wasm`](https://crates.io/crates/geoarrow-wasm).
Expand All @@ -31,5 +32,3 @@ Advanced users can also depend on these Rust-Wasm bindings directly, enabling yo
- [Prototyping GeoRust + GeoArrow in WebAssembly](https://observablehq.com/@kylebarron/prototyping-georust-geoarrow-in-webassembly)

## How it Works


4 changes: 3 additions & 1 deletion python/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# `geoarrow.rust`: Python bindings to `geoarrow-rs`
# geoarrow.rust

[![GitHub Workflow Status (Python)](https://img.shields.io/github/actions/workflow/status/geoarrow/geoarrow-rs/python.yml?branch=main&style=for-the-badge)](https://github.com/geoarrow/geoarrow-rs/actions/workflows/python.yml)

gadomski marked this conversation as resolved.
Show resolved Hide resolved
This folder contains Python bindings to the [GeoArrow Rust implementation](https://github.com/geoarrow/geoarrow-rs).

Expand Down
2 changes: 2 additions & 0 deletions src/algorithm/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Vectorized algorithms implemented on and returning GeoArrow arrays.

#![allow(missing_docs)] // FIXME

pub mod broadcasting;
pub mod geo;
pub mod geo_index;
Expand Down
3 changes: 3 additions & 0 deletions src/array/coord/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ pub use separated::{SeparatedCoordBuffer, SeparatedCoordBufferBuilder};
/// buffers as XXXX and YYYY.
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum CoordType {
/// Interleaved coordinates.
#[default]
Interleaved,

/// Separated coordinates.
Separated,
}
1 change: 0 additions & 1 deletion src/array/coord/separated/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub struct SeparatedCoordBuffer<const D: usize> {
}

fn check<const D: usize>(buffers: &[ScalarBuffer<f64>; D]) -> Result<()> {
dbg!(buffers);
if !buffers.windows(2).all(|w| w[0].len() == w[1].len()) {
return Err(GeoArrowError::General(
"all buffers must have the same length".to_string(),
Expand Down
1 change: 1 addition & 0 deletions src/array/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::error::GeoArrowError;
/// this value is omitted, edges will be interpreted as planar.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub enum Edges {
/// Follow a spherical path rather than a planar.
gadomski marked this conversation as resolved.
Show resolved Hide resolved
#[serde(rename = "spherical")]
Spherical,
}
Expand Down
2 changes: 2 additions & 0 deletions src/array/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Implementations of immutable GeoArrow arrays plus builders to more easily create arrays.

#![allow(missing_docs)] // FIXME

pub use binary::{WKBArray, WKBBuilder, WKBCapacity};
pub use cast::{AsChunkedGeometryArray, AsGeometryArray};
pub use coord::{
Expand Down
Loading
Loading