ogstools.ogs6py.geo module#

class ogstools.ogs6py.geo.Geo[source]#

Bases: ReferencedFile

Class managing the geometry file (.gml) for an OGS project.

Tracks both the XML reference to the geometry and the actual file, enabling proper save/copy operations.

Initialize a StorageBase object.

Parameters:
  • class_id – Type identifier for this saveable object (e.g., “Model”, “Simulation”).

  • file_ext – File extension if this is a file (e.g., “yaml”, “prj”). Empty string for directories.

  • default_target – Default path for saving if none is specified.

  • id – Unique identifier. If None, generates a timestamp-based ID.

__init__(tree)[source]#

Initialize a StorageBase object.

Parameters:
  • class_id – Type identifier for this saveable object (e.g., “Model”, “Simulation”).

  • file_ext – File extension if this is a file (e.g., “yaml”, “prj”). Empty string for directories.

  • default_target – Default path for saving if none is specified.

  • id – Unique identifier. If None, generates a timestamp-based ID.

property has_geometry: bool#

Check if geometry is defined (either as file or inline in XML).

add_geometry(filename)[source]#

Add/set a geometry file.

Parameters:

filename (str | Path) – The file path and name of the gml file

Return type:

None