package topojsone

  1. Overview
  2. Docs

Module Topojson.GeometrySource

Sourcetype json = json
Sourcemodule Position : sig ... end
Sourcemodule Point : sig ... end
Sourcemodule Arc_index : sig ... end
Sourcemodule MultiPoint : sig ... end
Sourcemodule LineString : sig ... end
Sourcemodule MultiLineString : sig ... end
Sourcemodule Polygon : sig ... end
Sourcemodule MultiPolygon : sig ... end
Sourcetype geometry =
  1. | Point of Point.t
  2. | MultiPoint of MultiPoint.t
  3. | LineString of LineString.t
  4. | MultiLineString of MultiLineString.t
  5. | Polygon of Polygon.t
  6. | MultiPolygon of MultiPolygon.t
  7. | Collection of t list
Sourceand properties = [
  1. | `None
  2. | `Null
  3. | `Obj of (string * json) list
]

The properties associated with a Geometry object can be left out (`None), could be specifically a null value (`Null) or an object.

Sourceand t

Constructors

Sourceval point : Position.t -> geometry
Sourceval multipoint : Point.t array -> geometry
Sourceval linestring : Arc_index.t -> geometry
Sourceval multilinestring : LineString.t array -> geometry
Sourceval polygon : LineString.t array -> geometry
Sourceval multipolygon : Polygon.t array -> geometry
Sourceval collection : t list -> geometry

Conversion functions

Sourceval get_point : geometry -> (Point.t, [> `Msg of string ]) result
Sourceval get_point_exn : geometry -> Point.t
Sourceval get_multipoint : geometry -> (MultiPoint.t, [> `Msg of string ]) result
Sourceval get_multipoint_exn : geometry -> MultiPoint.t
Sourceval get_linestring : geometry -> (LineString.t, [> `Msg of string ]) result
Sourceval get_linestring_exn : geometry -> LineString.t
Sourceval get_multilinestring : geometry -> (MultiLineString.t, [> `Msg of string ]) result
Sourceval get_multilinestring_exn : geometry -> MultiLineString.t
Sourceval get_polygon : geometry -> (Polygon.t, [> `Msg of string ]) result
Sourceval get_polygon_exn : geometry -> Polygon.t
Sourceval get_multipolygon : geometry -> (MultiPolygon.t, [> `Msg of string ]) result
Sourceval get_multipolygon_exn : geometry -> MultiPolygon.t
Sourceval properties : t -> properties

properties t returns the properties associated with a given object. If there aren't any this returns `None. The empty list is the empty object {}.

Sourceval geometry : t -> geometry

geometry t returns the geometry associated with the object.

Sourceval foreign_members : t -> (string * json) list

foreign_members t will extract the name-value pairs from an object that are not a part of the TopoJSON specification.

Sourceval id : t -> json option

id t returns the id associated with a given object. If there aren't any this returns Nones.

Sourceval v : ?id:json -> ?properties:properties -> ?foreign_members:(string * json) list -> ?bbox:float array -> geometry -> t

Creates a new Geometry object.

Sourceval to_json : t -> json
Sourceval of_json : json -> (t, [ `Msg of string ]) result
OCaml

Innovation. Community. Security.