Module S.Random

type geometry =
| Point
| MultiPoint of int
| LineString of int
| MultiLineString of int * int
| Polygon of int
| MultiPolygon of int * int
| Collection of geometry list
type feature = {
properties : json option;
geometry : geometry;
}
type r =
| FC of feature list
| F of feature
| G of geometry

Generate random geojson

The random module provides a way of quickly constructing random, correct GeoJson. You provide the skeleton of the document using type t and tweaking some of the parameters. For example:

{ let random_structure = FC (List.init 100 (fun _ -> { properties = None; geometry = Point })) }

val random : f:(unit -> float) -> r -> t

random ~f r produces random GeoJson based on the structure provided by r and using the random float generator f. Note the random geometry maker will follow the rules of GeoJson (for making Polygons for example).