gws.base.exporter.core

Base exporter.

Source code: gws.base.exporter.core

Module Contents

class gws.base.exporter.core.Config(*args, **kwargs)

Bases: gws.ConfigWithAccess

Exporter configuration.

options: dict

Format-specific options, passed to the GDAL driver.

target: gws.ExportTarget

Where the export result goes.

targetPath: str | None

Target export path (if applicable).

title: str

Exporter title, shown in the client.

withMixedCrs: bool = False

Allow different CRS in one layer instead of skipping features.

withMixedGeometry: bool = False

Allow different geometry types in one layer instead of skipping features.

withMultiLayer: bool = False

Write all layers to one file if the format supports it.

withNoGeometry: bool = False

Export features without geometry instead of skipping them.

class gws.base.exporter.core.Object

Bases: gws.Exporter

Base exporter.

Writes features to files in one format. Provides subclasses with the common export options, the client props and event notification.

Subclasses set supportsVector, supportsRaster and supportsMultiLayer and implement run.

configure()

Configuration hook.

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

notify(ea: gws.ExportArgs, event: str)

Pass an export event to the notification callback of the export arguments.

Parameters:
  • ea – Export arguments.

  • event – Event name.

props(user) → Props

Generate a Props struct for this object.

Do not call this method directly, use gws.props_of instead, which also checks permissions.

Parameters:

user – The user for which the props should be generated.

Returns:

A Props object or a dict. Nested objects are converted to props as well.

class gws.base.exporter.core.Props(*args, **kwargs)

Bases: gws.Props

Exporter properties.

supportsRaster: bool

Whether exporter supports raster features.

supportsVector: bool

Whether exporter supports vector features.

title: str

Exporter title.