dicogis.export.to_iso19139 module

ISO 19139 serializer: one XML metadata file per dataset.

class dicogis.export.to_iso19139.MetadatasetSerializerIso19139(settings=None, localized_strings=None, output_path=None, opt_size_prettify=True)

Bases: MetadatasetSerializerBase

Export to ISO 19139 XML files.

__init__(settings=None, localized_strings=None, output_path=None, opt_size_prettify=True)

Store metadata into ISO 19139 XML files.

Parameters:
  • settings (CatalogRecordSettings | None) – settings of the records. Defaults to the ones of the environment.

  • localized_strings (dict | None) – localized texts

  • output_path (Path | None) – folder where to write the files, created if needed

  • opt_size_prettify (bool) – option to prettify size in octets

Raises:

ValueError – if output_path is not set

serialize_metadaset(metadataset)

Serialize input metadataset as an XML file stored in output_path.

A dataset that couldn’t even be opened makes no record: it would have nothing to tell a catalog. Not based on processing_succeeded, which is also False for a readable dataset, because of an empty layer of a database for example.

Parameters:

metadataset (MetaDataset) – metadataset to serialize

Return type:

Path | None

Returns:

path to the generated file, or None if the dataset couldn’t be read

dicogis.export.to_iso19139.record_to_iso19139(record)

Build the ISO 19139 document of a catalog record.

Parameters:

record (CatalogRecord) – catalog record

Returns:

MD_Metadata). Its children and the ones of the elements in ISO19139_SEQUENCES come in the order of the XSD.

Return type:

root element (gmd