Cosmetyc.BasicThis module provides a simpler interface (without all its modular complexity) to the Cosmetyc library. It is not meant to be as expressive as the full library, but just to provide the minimal expected functions. Its source code can be an entry point on how to use the library in a more advanced manner.
type node = Repr.Raw.nodeA representation for OSM nodes.
val node_id : node -> Common.Id.tGet the identifier of a node.
val node_tags : node -> Common.Tags.tGet all the tags (key/value) of a node.
val node_position : node -> Common.Position.tThe position of a node, in spherical coordinates.
val create_node :
?id:Common.Id.t ->
?tags:Common.Tags.t ->
Common.Position.t ->
nodeSmart constructor for node. If no identifier is provided, a new one will be generated.
type way = Repr.Raw.wayA representation for OSM ways.
val way_id : way -> Common.Id.tGet the identifier of a way.
val way_tags : way -> Common.Tags.tGet all the tags (key/value) of a way.
val create_way : ?id:Common.Id.t -> ?tags:Common.Tags.t -> node list -> waySmart constructor for node. If no identifier is provided, a new one will be generated.
type relation = Repr.Raw.relationA representation for OSM relations.
val relation_id : relation -> Common.Id.tGet the identifier of a relation.
val relation_tags : relation -> Common.Tags.tGet all the tags (key/value) of a relation.
A type to represent objects, of whichever kind.
val relation_members : relation -> (role * object_type) listGet all the members of a relation, as well as their associated role.
val create_relation :
?id:Common.Id.t ->
?tags:Common.Tags.t ->
(role * object_type) list ->
relationSmart constructor for node. If no identifier is provided, a new one will be generated.
type flux = object_type Stdlib.Seq.tA flux of OSM objects
val read_GeoJson : Stdlib.in_channel -> fluxParse a GeoJson file in a channel. The channel will be closed by the function.
val read_GeoJson_string : string -> fluxParse a string representing the content of a GeoJson file.
val read_OSM_XML : Stdlib.in_channel -> fluxParse an OSM XML file in a channel. The channel will be closed by the function.
val read_OSM_XML_string : string -> fluxParse a string representing the content of an OSM XML file.
val write_OSM_XML : ?indent:bool -> Stdlib.out_channel -> flux -> unitOutput an OSM XML file into an out-channel.
val write_OSM_XML_string : ?indent:bool -> flux -> stringOutput an OSM XML file into a string. The optional argument states whether it should be indented.