| Crates.io | geo-rand |
| lib.rs | geo-rand |
| version | 0.4.0 |
| created_at | 2019-07-03 10:42:40.104349+00 |
| updated_at | 2025-02-08 10:18:20.75186+00 |
| description | Generate random geometric shapes |
| homepage | |
| repository | https://github.com/lelongg/geo-offset |
| max_upload_size | |
| id | 145609 |
| size | 13,697 |
This crate contains algorithms to generate random geometric shapes such as polygons.
This code is a Rust port of this JS code.
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.