Module Repr.Object

include Cosmetyc.Signatures.ObjectCommon with type t = object_type with type object_type = object_type
type t = object_type

Identifier

Object identifier.

val compare : t -> t -> int

Comparison function.

Tags manipuation

Get all the tags of an object.

val compare_tags : t -> t -> int
val has_key : Cosmetyc.Common.Tags.key -> t -> bool

Check if a key is present.

Value associated to a key

val has_tag_with : Cosmetyc.Common.Tags.key -> value:Cosmetyc.Common.Tags.value -> t -> bool

Check if a tag has the provided value.

val has_tag_contains : Cosmetyc.Common.Tags.key -> values:Cosmetyc.Common.Tags.value list -> t -> bool

Check if a tag has one of the provided values.

Hints

If stored or inferred, these functions return the hints provided to the create function (see type object_create above).

val version : t -> int option

Object version.

val changeset : t -> Cosmetyc.Common.Id.changeset option

The last changeset that changed the object.

val visible : t -> bool option

Whether it should be visible when editing.

val uid : t -> Cosmetyc.Common.Id.user option

The identifier of the last user who edited this object.

val user : t -> string option

The UTF-8-encoded name of this last user.

val timestamp : t -> CalendarLib.Calendar.t option

The last time when this object was modified.

val area : t -> bool option
val has_changed : t -> bool option

Conversion from and to objects

type object_type = object_type
val to_object : t -> object_type

Convert a node to an object.

val of_object : object_type -> t option

Synonym of Object.to_node.

type node = Node.t
type way = Way.t
type relation = Relation.t
val get_kind : t -> Cosmetyc.Common.Id.kind

Return the kind of an object (Node/Way/Relation).

val to_node : t -> node option

Convert an object to a node (or None if it isn't a node).

val to_way : t -> way option

Convert an object to a way (or None if it isn't a way).

val to_relation : t -> relation option

Convert an object to a relation (or None if it isn't a relation).

val is_node : t -> bool

Whether an object can be converted into a node with to_node.

val is_way : t -> bool

Whether an object can be converted into a way with to_way.

val is_relation : t -> bool

Whether an object can be converted into a relation with to_relation.