gws.plugin.alkis.action

The alkis action, the backend for the Flurstückssuche (cadastre parcel search).

Source code: gws.plugin.alkis.action

Module Contents

class gws.plugin.alkis.action.BuchungConfig

Bases: gws.ConfigWithAccess

Access to the Grundbuch (register) information.

class gws.plugin.alkis.action.BuchungOptions

Bases: gws.Node

Access options for the Grundbuch (register) data.

Holds the read permissions for register data.

class gws.plugin.alkis.action.Config

Bases: gws.ConfigWithAccess

Parcel search in ALKIS data.

buchung: BuchungConfig | None

Access to the land register information.

buchungsblattSearchOptions: gws.TextSearchOptions | None

How book and page numbers are matched.

crs: gws.CrsName

CRS for the ALKIS data.

dataSchema: str = 'public'

Schema where ALKIS tables are stored.

dbUid: str = ''

UID of the PostgreSQL database provider with the ALKIS data.

eigentuemer: EigentuemerConfig | None

Access to the owner information.

excludeGemarkung: list[str] | None

Gemarkung (Administrative Unit) IDs to exclude from indexing.

exporters: list[gws.plugin.alkis.data.exporter.Config] | None

Export formats for parcel data.

gemarkungFilter: list[str] | None

Gemarkung IDs to restrict the search to.

indexSchema: str = 'gws8'

Schema for the GWS search indexes built from the ALKIS data.

limit: int = 100

Maximum number of parcels returned by a search.

nameSearchOptions: gws.TextSearchOptions | None

How person names are matched.

printers: list[gws.base.printer.Config] | None

Print templates for parcels.

storage: gws.base.storage.Config | None

Storage for saved parcel selections.

strasseSearchOptions: gws.TextSearchOptions | None

How street names are matched.

templates: list[gws.ext.config.template] | None

Templates for parcel details.

ui: Ui | None

User interface options for the search form and results.

class gws.plugin.alkis.action.EigentuemerConfig

Bases: gws.ConfigWithAccess

Access to the Eigentümer (owner) information.

controlMode: bool = False

Require a control input before owner data is shown.

controlRules: list[str] | None

Regular expressions the control input must match.

logTable: str = ''

Table for logging access to owner data.

class gws.plugin.alkis.action.EigentuemerOptions

Bases: gws.Node

Access options for owner (Eigentuemer) data.

Holds the read permissions for owner data, the control mode and the table for logging access to owner data.

controlMode: bool

Require a control input before owner data is shown.

controlRules: list[str]

Regular expressions the control input must match.

logTable: gws.lib.sa.Table | None

Table for logging access to owner data, set by the action.

logTableName: str

Name of the table for logging access to owner data.

configure()
class gws.plugin.alkis.action.ExportFlurstueckRequest

Bases: gws.Request

Request to export found parcels.

exporterUid: str

Exporter uid, the first usable exporter if empty.

findRequest: FindFlurstueckRequest

The parcel search to run.

modelUids: list[str] | None

Uids of the export models to use.

class gws.plugin.alkis.action.ExportFlurstueckResponse

Bases: gws.Response

Response of a parcel export.

content: str

Exported data.

mimeType: str

Mime type of the exported data.

class gws.plugin.alkis.action.FindAdresseRequest

Bases: gws.Request

Request for an Adresse (address) search.

bisHausnummer: str | None

Upper bound of a house number range, inclusive; hausnummer is the lower bound.

combinedAdresseCode: str | None

Combined code strasse_hausnummer_plz_gemeinde_bisHausnummer; empty and 0 parts are ignored.

crs: gws.CrsName | None

CRS for the returned features, defaults to the project map CRS.

gemarkung: str | None

Gemarkung (district) name.

gemarkungCode: str | None

Gemarkung code.

gemeinde: str | None

Gemeinde (municipality) name.

gemeindeCode: str | None

Gemeinde code.

hausnummer: str | None

House number.

hausnummerNotNull: bool | None

Return only addresses with a house number.

kreis: str | None

Kreis (county) name.

kreisCode: str | None

Kreis code.

land: str | None

Land (state) name.

landCode: str | None

Land code.

regierungsbezirk: str | None

Regierungsbezirk (administrative region) name.

regierungsbezirkCode: str | None

Regierungsbezirk code.

strasse: str | None

Street name.

wantHistorySearch: bool | None

Include historic addresses in the search.

class gws.plugin.alkis.action.FindAdresseResponse

Bases: gws.Response

Response of an Adresse (address) search.

features: list[gws.FeatureProps]

Found addresses as features.

total: int

Number of found addresses.

class gws.plugin.alkis.action.FindFlurstueckRequest

Bases: gws.Request

Request for a Flurstück (parcel) search.

bblatt: str | None

Buchungsblatt (register sheet) numbers, separated by spaces, commas or semicolons.

combinedFlurstueckCode: str | None

Combined code land_gemarkung_flur_zaehler_nenner_folge; empty and 0 parts are ignored.

crs: gws.CrsName | None

CRS for the returned features, defaults to the project map CRS.

displayThemes: list[gws.plugin.alkis.data.types.DisplayTheme] | None

Themes to include in the parcel details.

eigentuemerControlInput: str | None

Control input for owner data access in control mode.

flaecheBis: float | None

Maximum parcel area.

flaecheVon: float | None

Minimum parcel area.

flurnummer: str | None

Flur number.

flurstuecksfolge: str | None

Flurstücksfolge (parcel sequence number).

fsnummer: str | None

a DE... gml id, a Flurstückskennzeichen or a compound parcel number.

Type:

Parcel identifier

gemarkung: str | None

Gemarkung (district) name.

gemarkungCode: str | None

Gemarkung code.

gemeinde: str | None

Gemeinde (municipality) name.

gemeindeCode: str | None

Gemeinde code.

hausnummer: str | None

House number.

kreis: str | None

Kreis (county) name.

kreisCode: str | None

Kreis code.

land: str | None

Land (state) name.

landCode: str | None

Land code.

limit: int | None

Maximum number of results, capped by the action limit.

nenner: str | None

Denominator of the parcel number.

personName: str | None

Last name of the owner.

personVorname: str | None

First name of the owner.

regierungsbezirk: str | None

Regierungsbezirk (administrative region) name.

regierungsbezirkCode: str | None

Regierungsbezirk code.

shapes: list[gws.lib.shape.Props] | None

Search area; several shapes are merged.

strasse: str | None

Street name.

uids: list[str] | None

Parcel uids.

wantEigentuemer: bool | None

Request owner data.

wantHistoryDisplay: bool | None

Include history in the parcel details.

wantHistorySearch: bool | None

Include historic parcels in the search.

zaehler: str | None

Numerator of the parcel number.

class gws.plugin.alkis.action.FindFlurstueckResponse

Bases: gws.Response

Response of a Flurstück (parcel) search.

features: list[gws.FeatureProps]

Found parcels as features, sorted by title.

total: int

Number of found parcels.

class gws.plugin.alkis.action.FindFlurstueckResult

Bases: gws.Data

Result of a Flurstück (parcel) search.

flurstueckList: list[gws.plugin.alkis.data.types.Flurstueck]

Found parcels.

query: gws.plugin.alkis.data.types.FlurstueckQuery

The query that was run.

total: int

Number of found parcels.

class gws.plugin.alkis.action.GemarkungListMode

Bases: gws.Enum

How the Gemarkung list is shown.

combined = 'combined'

Show ‘Gemarkung (Gemeinde)’.

none = 'none'

Do not show the list.

plain = 'plain'

Show only the Gemarkung.

tree = 'tree'

A tree with level 1 = Gemeinde and level 2 = Gemarkung.

class gws.plugin.alkis.action.GetToponymsRequest

Bases: gws.Request

Request for the alkisGetToponyms command.

class gws.plugin.alkis.action.GetToponymsResponse

Bases: gws.Response

Response of the alkisGetToponyms command.

gemarkung: list[list[str]]

Gemarkungen (districts) as [name, code, gemeindeCode] lists, sorted.

gemeinde: list[list[str]]

Gemeinden (municipalities) as [name, code] pairs, sorted.

strasse: list[list[str]]

Streets as [name, gemeindeCode, gemarkungCode] lists, sorted.

class gws.plugin.alkis.action.Model

Bases: gws.base.model.default_model.Object

Model for the parcel and address features returned by the action.

configure()
class gws.plugin.alkis.action.Object

Bases: gws.base.action.Object

The alkis action.

Searches parcels and addresses in the ALKIS index, returns them with owner and register data where the user may read it, and prints, exports and stores selections of parcels.

ADRESSE_QUERY_FIELDS = ['gemarkung', 'gemarkungCode', 'gemeinde', 'gemeindeCode', 'kreis', 'kreisCode', 'land',...

Request fields copied into an address query.

buchung: BuchungOptions

Access options for register data.

buchungsblattSearchOptions: gws.TextSearchOptions

How register sheet numbers are matched.

COMBINED_ADRESSE_FIELDS = ['strasse', 'hausnummer', 'plz', 'gemeinde', 'bisHausnummer']

Query fields for the parts of a combined address code, in order.

COMBINED_FLURSTUECK_FIELDS = ['landCode', 'gemarkungCode', 'flurnummer', 'zaehler', 'nenner', 'flurstuecksfolge']

Query fields for the parts of a combined parcel code, in order.

dataSchema: str

Schema with the ALKIS source tables.

db: gws.DatabaseProvider

Database provider with the ALKIS data.

eigentuemer: EigentuemerOptions

Access options for owner data.

exporters: list[gws.plugin.alkis.data.exporter.Object]

Exporters for parcel data.

FLURSTUECK_QUERY_FIELDS = ['flurnummer', 'flurstuecksfolge', 'zaehler', 'nenner', 'flaecheBis', 'flaecheVon', 'gemarkung',...

Request fields copied into a parcel query.

indexSchema: str

Schema with the index tables.

ix: gws.plugin.alkis.data.index.Object

The ALKIS index.

ixStatus: gws.plugin.alkis.data.types.IndexStatus

Index status, set on activation.

limit: int

Maximum number of parcels returned by a search.

model: gws.Model

Model for the returned features.

nameSearchOptions: gws.TextSearchOptions

How person names are matched.

printers: list[gws.Printer]

Printers for parcels.

storage: gws.base.storage.Object | None

Storage for saved parcel selections.

strasseSearchOptions: gws.TextSearchOptions

How street names are matched.

templates: list[gws.Template]

Templates for parcel and address views.

ui: Ui

User interface options.

activate()
configure()
export_flurstueck(req: gws.WebRequester, p: ExportFlurstueckRequest) → ExportFlurstueckResponse

Search for parcels and export them.

find_adresse(req: gws.WebRequester, p: FindAdresseRequest) → FindAdresseResponse

Search for addresses.

find_adresse_objects(req: gws.WebRequester, p: FindAdresseRequest) → tuple[list[gws.plugin.alkis.data.types.Adresse], gws.plugin.alkis.data.types.AdresseQuery]

Run an address search in the index.

Parameters:
  • req – Web requester.

  • p – Search parameters.

Returns:

A tuple of the found addresses and the query.

find_flurstueck(req: gws.WebRequester, p: FindFlurstueckRequest) → FindFlurstueckResponse

Search for parcels.

find_flurstueck_objects(req: gws.WebRequester, p: FindFlurstueckRequest) → tuple[list[gws.plugin.alkis.data.types.Flurstueck], gws.plugin.alkis.data.types.FlurstueckQuery]

Run a parcel search in the index.

Checks access to owner and register data if requested, and logs owner data access.

Parameters:
  • req – Web requester.

  • p – Search parameters.

Returns:

A tuple of the found parcels and the query.

:raises gws.ForbiddenError` if owner or register data is requested without access.: :raises `gws.BadRequestError` if the parcel number is invalid:

get_exporter(uid: str | None, user: gws.User) → gws.plugin.alkis.data.exporter.Object | None

Find an exporter the user can use.

Parameters:
  • uid – Exporter uid. If empty, the first usable exporter is returned.

  • user – The user.

Returns:

The exporter, or None if not found.

get_toponyms(req: gws.WebRequester, p: GetToponymsRequest) → GetToponymsResponse

Return all toponyms (Gemeinde, Gemarkung, Strasse) in the index.

handle_storage(req: gws.WebRequester, p: gws.base.storage.Request) → gws.base.storage.Response

Read or write saved parcel selections.

print_flurstueck(req: gws.WebRequester, p: PrintFlurstueckRequest) → gws.JobStatusResponse

Search for parcels and start a print job for them.

props(user)
class gws.plugin.alkis.action.PrintFlurstueckRequest

Bases: gws.Request

Request to print found parcels.

featureStyle: gws.StyleProps

Style for the parcel features.

findRequest: FindFlurstueckRequest

The parcel search to run.

printRequest: gws.PrintRequest

The print request; its first map is used as the base map for each parcel.

class gws.plugin.alkis.action.Props

Bases: gws.base.action.Props

buchungsblattSearchOptions: gws.TextSearchOptions | None
exporters: list[gws.plugin.alkis.data.exporter.Props]
limit: int
nameSearchOptions: gws.TextSearchOptions | None
printer: gws.base.printer.Props | None
storage: gws.base.storage.Props | None
strasseSearchOptions: gws.TextSearchOptions | None
ui: Ui
withBuchung: bool
withEigentuemer: bool
withEigentuemerControl: bool
withFlurnummer: bool
class gws.plugin.alkis.action.StrasseListMode

Bases: gws.Enum

Strasse (street) list entry format.

plain = 'plain'

Show only the street name.

withGemarkung = 'withGemarkung'

Show ‘Strasse (Gemarkung)’.

withGemarkungIfRepeated = 'withGemarkungIfRepeated'

Show ‘Strasse (Gemarkung)’ when needed for disambiguation.

withGemeinde = 'withGemeinde'

Show ‘Strasse (Gemeinde)’.

withGemeindeIfRepeated = 'withGemeindeIfRepeated'

Show ‘Strasse (Gemeinde)’ when needed for disambiguation.

class gws.plugin.alkis.action.Ui

Bases: gws.Config

User interface options for the Flurstückssuche.

autoSpatialSearch: bool = False

Start the spatial search tool after a form search.

gemarkungListMode: GemarkungListMode = 'combined'

How the Gemarkung list is shown in the search form.

searchSelection: bool = False

Enable searching within the geometries of the current map selection.

searchSpatial: bool = False

Enable spatial search with a search area drawn in the map.

strasseListMode: StrasseListMode = 'plain'

How entries in the street list are shown.

useExport: bool = False

Enable the export of search results.

useHistory: bool = False

Enable options to search and display historic parcels.

usePick: bool = False

Enable picking single parcels in the map.

useSelect: bool = False

Enable the selection storage for parcels.