geo-rand

Crates.iogeo-rand
lib.rsgeo-rand
version0.3.0
sourcesrc
created_at2019-07-03 10:42:40.104349
updated_at2021-04-06 22:42:19.04657
descriptionGenerate random geometric shapes
homepage
repositoryhttps://github.com/lelongg/geo-offset
max_upload_size
id145609
size9,849
GĂ©rald Lelong (lelongg)

documentation

https://docs.rs/geo-offset/

README

geo-rand

This crate contains algorithms to generate random geometric shapes such as polygons.

crate.io docs.rs

This code is a Rust port of this JS code.

Example

The following example shows how to compute a random set of polygons. The rand method is provided by the GeoRand trait which is implemented for some geo-types.

use rand_core::SeedableRng;
use geo_rand::{GeoRand, GeoRandParameters};
let mut rng = rand_pcg::Pcg64::seed_from_u64(0);
let polygons = geo::MultiPolygon::rand(&mut rng, &GeoRandParameters::default());

GeoRandParameters contains fields to customize output.

Commit count: 37

cargo fmt