These are bindings and wrappers around the OGR_DS_*
API.
val get_driver_by_name : string ‑> driver_t option
val get_driver_by_name_exn : string ‑> driver_t
get_driver_by_name name
returns the driver associated with name
.
val of_source : ?write:bool ‑> string ‑> [ `Invalid_source | `Ok of t ]
of_source ?write name
opens the source name
for access.
name
does not represent a valid data source.val of_source_exn : ?write:bool ‑> string ‑> t
Like of_source but raises Invalid_source if there is an error with the data source.
val with_source : ?write:bool ‑> string ‑> (t ‑> 'a) ‑> [ `Invalid_source | `Ok of 'a ]
with_source ?write name f
opens name
and calls f src
if name
is a
valid data source. The data source passed to f
will be closed if f
returns normally or raises an exception.
This is a wrapper around of_source. See its documentation for a description of the expected arguments.
val with_source_exn : ?write:bool ‑> string ‑> (t ‑> 'a) ‑> 'a
Like with_source but raises Invalid_source if there is an error with the data source.
val create_layer : ?spatial_reference:Spatial_reference.t ‑> ?geometry_type:Geometry.wkb_t ‑> ?options:string list ‑> t ‑> string ‑> Layer.t option
create_layer ?spatial_reference ?geometry_type ?options ds name
creates a
layer named name
in ds
.
Some layer
on success or None
if the layer could not be
created.val create_layer_exn : ?spatial_reference:Spatial_reference.t ‑> ?geometry_type:Geometry.wkb_t ‑> ?options:string list ‑> t ‑> string ‑> Layer.t
create_layer_exn ?spatial_reference ?geometry_type ?options ds name
is
like create_layer except that it raises Data_source_error if the
layer can not be created.
copy_layer ?options ds src name
copies src
to a layer named name
in
ds
.
Some layer
on success or None
if the layer could not be
copied/created.copy_layer_exn ?options ds src name
is like copy_layer except that it
raises Data_source_error if the layer can not be copied.