gws.base.model.default_model

Default model.

Source code: gws.base.model.default_model

Module Contents

class gws.base.model.default_model.Config

Bases: gws.base.model.core.Config

Default model configuration.

class gws.base.model.default_model.Object

Bases: gws.base.model.core.Object

Default model.

Used when no model is configured. Copies all attributes between records, features and props as they are, converting the geometry between shapes and shape props.

configure()
feature_from_props(props, mc)
feature_from_record(record: gws.FeatureRecord, mc: gws.ModelContext) → gws.Feature

Create a feature from a record.

The record attributes become the feature attributes. The record uid and shape, if present, are stored under the uid and geometry names, and the layerName from the record metadata becomes the feature category.

Parameters:
  • record – The source record.

  • mc – The model context.

Returns:

A new feature of this model.

feature_to_props(feature: gws.Feature, mc)