package gdal

  1. Overview
  2. Docs

Geometries

These functions come from OGR C API's OGR_G_* namespace.

exception Geometry_error

Exception raised on invalid geometry operations

type envelope_t = {
  1. min_x : float;
  2. max_x : float;
  3. min_y : float;
  4. max_y : float;
}

Bounding box type, used internally by other OGR modules

type wkb_t =
  1. | Unknown
  2. | Point
  3. | LineString
  4. | Polygon
  5. | MultiPoint
  6. | MultiLineString
  7. | MultiPolygon
  8. | GeometryCollection
  9. | None
  10. | LinearRing
  11. | Point25D
  12. | LineString25D
  13. | Polygon25D
  14. | MultiPoint25D
  15. | MultiLineString25D
  16. | MultiPolygon25D
  17. | GeometryCollection25D
    (*

    Geometry types

    *)
val wkb_of_nativeint : nativeint -> wkb_t
val nativeint_of_wkb : wkb_t -> nativeint

Conversion between wkb_t and the C API's integer values

type t

An OGR geometry

val get_name : t -> string

get_name t returns the WKT name for the geometry t.

val get_type : t -> wkb_t

get_type t returns the type of the given geometry t.

val get_point_count : t -> int

get_point_count t returns the number of points in t.

val get_x : t -> int -> float
val get_y : t -> int -> float
val get_z : t -> int -> float

get_* t i returns the position of the ith point in the geometry t.

val clone : t -> t

clone t returns a copy of t.

OCaml

Innovation. Community. Security.