A Rust implementation of the GeoArrow specification, including algorithms implemented on and returning these GeoArrow arrays.
Reading and writing
The [io] module has functions for reading and writing GeoArrow data from a variety of formats.
To use most format readers and writers, you must enable their corresponding feature.
For example, to convert between geojson and GeoArrow, enable the geozero feature in your Cargo.toml:
[]
= { = "*" }
Then:
#
See the [io] module for more information on the available formats and their features.
Constructing
You can build GeoArrow arrays all at once from [mod@geo] structures, or anything that implements geometry traits, e.g. PointTrait. Along with the GeoRust community, geoarrow-rs has been prototyping geometry access traits for a standardized way to access coordinate information, regardless of the storage format of the geometries. For now, we vendor an implementation of geo-traits (see [mod@geo_traits]), but this may be upstreamed to georust in the future.
use PointArray;
use Dimension;
let point = point!;
let array: PointArray = .into;
Or you can use builders, e.g. PointBuilder:
use PointBuilder;
use Dimension;
let mut builder = new;
builder.push_point;
let array = builder.finish;