Groups#
Groups
are effectively containers for other entities, such as Objects
(Points, Curve, Surface, etc.) and other Groups
. Groups are used to establish parent-child
relationships and to store information about a collection of entities.
RootGroup#
By default, the parent of any new Entity
is the workspace RootGroup
. It is the only entity in the Workspace
without a parent. Users rarely have to interect with the Root
group as it is mainly used to maintain the overall project hierarchy.
ContainerGroup#
A ContainerGroup
can easily be added to the workspace and can be assigned a name
and description
.
from geoh5py import Workspace
from geoh5py.groups import ContainerGroup
# Create a blank project
workspace = Workspace.create("my_project.geoh5")
# Add a group
group = ContainerGroup.create(workspace, name="myGroup")
At creation, "myGroup"
is written to the project geoh5
file and visible in the Analyst project tree.
Any entity can be accessed by its name
or uid
(unique identifier):
print(group.uid)
print(workspace.get_entity("myGroup")[0] == workspace.get_entity(group.uid)[0])
8b25a914-a3a0-4592-ab6e-01f0f3a7afc3
True