gws.plugin.alkis.data.exporter

Export of Flurstuecke to CSV or GeoJSON.

Source code: gws.plugin.alkis.data.exporter

Module Contents

class gws.plugin.alkis.data.exporter.Args(*args, **kwargs)

Bases: gws.Data

Arguments for the export operation.

fsList: Iterable[gws.plugin.alkis.data.types.Flurstueck]

Iterable of Flurstuecke to export.

models: list[Model]

List of models to export.

path: str

Path to save the export.

progress: gws.lib.cli.ProgressIndicator | None

Progress indicator to update during export.

user: gws.User

User who requested the export.

class gws.plugin.alkis.data.exporter.Config(*args, **kwargs)

Bases: gws.ConfigWithAccess

Export of Flurstück data to CSV or GeoJSON.

model: gws.ext.config.model | None

Fields to export.

models: list[gws.ext.config.model] | None

Field sets the user can choose from.

title: str | None

Title to display in the UI.

type: str

Export type.

class gws.plugin.alkis.data.exporter.Model

Bases: gws.base.model.Object

Export model, a set of fields written to the export file.

The field names are flat Flurstueck keys, see index.flatten_fs.

withBuchung: bool

Whether the model has fields with land register (Buchung) data.

withEigentuemer: bool

Whether the model has fields with owner (Eigentuemer) data.

configure()
class gws.plugin.alkis.data.exporter.ModelProps(*args, **kwargs)

Bases: gws.Props

Object properties.

title: str
class gws.plugin.alkis.data.exporter.Object

Bases: gws.Node

ALKIS exporter.

Writes Flurstuecke to a CSV or GeoJSON file, using export models the user can choose from.

mimeType: str

Mime type of the export file.

models: list[Model]

Export models the user can choose from.

title: str

Title to display in the UI.

type: str

Export type, csv or geojson.

configure()

Configuration hook.

Called when the node is initialized. Raising an exception here aborts the creation of the node.

get_models(user: gws.User, uids: list[str] | None = None) → list[Model]

Return export models the user can use.

Unknown uids are logged and ignored.

Parameters:
  • user – The user.

  • uids – Model uids to select. If empty, all models are considered.

Returns:

A list of models.

props_with_flags(user: gws.User, withEigentuemer: bool, withBuchung: bool) → Props | None

Return exporter properties with the models available to the user.

Models with owner or land register fields are left out if the user has no access to that data.

Parameters:
  • user – The user.

  • withEigentuemer – Whether the user may see owner data.

  • withBuchung – Whether the user may see land register data.

Returns:

Exporter properties, or None if the user cannot use the exporter or no model is available.

run(args: Args)

Export a list of Flurstuecke to a file.

Parameters:

args – Export arguments, including the Flurstuecke, the models and the output path.

Raises:

gws.NotFoundError – If the export type is not supported.

class gws.plugin.alkis.data.exporter.Props(*args, **kwargs)

Bases: gws.Props

Object properties.

models: list[ModelProps]
title: str