Geometry

1D Geometry

For all geometries and locations we try to use a single Point class.

In 1D applications it’s only used to specify, for example height, other fields left None.

For profiles used in 1D applications, see ProfileLayer

class geolib.geometry.one.Point(**data)

A single Point Class.

Parameters:

data (Any)

id: Optional[int]
label: Optional[str]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'id': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'label': FieldInfo(annotation=Union[str, NoneType], required=False, default=''), 'tolerance': FieldInfo(annotation=float, required=False, default=0.0001), 'x': FieldInfo(annotation=float, required=False, default=-999.0), 'y': FieldInfo(annotation=float, required=False, default=-999.0), 'z': FieldInfo(annotation=float, required=False, default=-999.0)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

tolerance: float
x: float
y: float
z: float

2D Geometry

Two-dimensional geometry is handled differently by the two programs using this geometry, namely D-Settlement and D-Stability.

In our API we use the D-Settlement approach::
  • add_point(Point) -> point_id:int

  • add_layer(List[point_id]) -> layer_id:int

Where we use references to previously added points to ensure topological consistency. This is why we have not introduced a LineString object as of yet.

Note however that for D-Settlement this List of points should form a LineString (ordered in X), while for D-Stability they should form an ordered Ring (Polygon).