gws.plugin.ows_server.csw

CSW service.

Basic implementation of the OGC Catalogue Service for the Web (CSW) 2.0.2. Only a small subset of the standard is supported: the operations GetCapabilities, DescribeRecord, GetRecords and GetRecordById, with records in the ISO 19115 profile. The profile option is not evaluated; the profile is always ISO.

The catalog is collected after the configuration: every object in the tree that has metadata with a catalogUid and is public becomes a record. A link to the GetRecordById URL of the record is added to its metaLinks. If the object or its map has an extent and a CRS, the WGS84 extent is added, and the initial scale of the closest map becomes the spatial resolution.

GetRecords supports an FES filter in Query/Constraint/Filter of an XML request; without a filter all records are returned. GetRecordById looks up a record by the id parameter.

Templates:

  • templates/iso/getCapabilities.cx.py: ows.GetCapabilities.

  • templates/iso/describeRecord.cx.py: ows.DescribeRecord.

  • templates/iso/getRecords.cx.py: ows.GetRecords.

  • templates/iso/getRecordById.cx.py: ows.GetRecordById.

References:

Example:

owsServices+ {
    type "csw"
    uid "my_csw"
    metadata {
        title "Catalog"
        abstract "Catalog of the geodata"
    }
}

projects+ {
    access "allow all"
    metadata.catalogUid "my_project"
}

Source code: gws.plugin.ows_server.csw

Subpackages

Package Contents

class gws.plugin.ows_server.csw.Config

Bases: gws.base.ows.server.service.Config

Catalogue service that publishes metadata records.

profile: Profile

Metadata profile.

class gws.plugin.ows_server.csw.Object

Bases: gws.base.ows.server.service.Object

CSW service that publishes the metadata of public objects as catalog records.

mdMap: dict[str, gws.Metadata]

Catalog records by catalog UID.

profile: Profile

Metadata profile of the records.

protocol
supportedVersions = ['2.0.2']
collect_metadata()

Collect the catalog records from all objects in the tree into mdMap.

configure()
configure_metadata()
configure_operations()
configure_templates()
handle_describe_record(sr: gws.base.ows.server.request.Object)

Handle the DescribeRecord operation.

Parameters:

sr – Service request.

Returns:

The record schema description.

handle_get_capabilities(sr: gws.base.ows.server.request.Object)

Handle the GetCapabilities operation.

Parameters:

sr – Service request.

Returns:

The capabilities document.

handle_get_record_by_id(sr: gws.base.ows.server.request.Object)

Handle the GetRecordById operation.

Parameters:

sr – Service request.

Returns:

A response with the record given by the id parameter, or with no records.

handle_get_records(sr: gws.base.ows.server.request.Object)

Handle the GetRecords operation.

Returns all records that match the filter of the request.

Parameters:

sr – Service request.

Returns:

The search results document.

init_request(req)
parse_xml_request(xml)
post_configure()
class gws.plugin.ows_server.csw.Profile

Bases: gws.Enum

Metadata profile for the CSW service.

DCMI = 'DCMI'

Dublin Core metadata profile.

ISO = 'ISO'

ISO 19115 metadata profile.