gws.base.metadata¶
OWS and ISO 19115 metadata.
Metadata describes an object (the application, a project, a layer, an OWS
service) for the client, for OWS capabilities documents and for CSW catalog
records. It is held in a flat gws.Metadata data object. The structure is
based on:
ISO 19115:2003 Geographic information – Metadata
ISO 19139 - Geographic Information - Metadata - XML Schema Implementation
OGC Web Services Common Standard OGC 06-121r9
Web Map Server Implementation Specification OGC 06-042
Web Feature Service 2.0 Interface Standard OGC 09-025r1
Submodules:
core: the metadataConfigandPropsand the functions that create, merge and convert metadata objects.newcreates an empty object;from_dict,from_config,from_propsandfrom_argscreate one from other sources;updatemerges values into an existing object;normalizereturns a cleaned copy;propsconverts metadata to client props;keyword_groupsgroups keywords by vocabulary for OWS output. Merging is done key by key: later sources override earlier ones, except forkeywordsandisoTopicCategories, which are combined. Date values are parsed todatetimeobjects, and the derived language codes and INSPIRE theme names are filled in on every update.inspire: INSPIRE code lists as enums and the names and definitions of INSPIRE data themes.iso: ISO 19115 code lists as enums.inspire_generate: a script that downloads the INSPIRE theme register and regenerates the theme part ofinspire. It is not imported.
Example:
metadata {
title "Roads"
abstract "Road network of the city"
keywords [ "roads" "transport" ]
language "en"
inspireTheme "tn"
isoTopicCategories [ "transportation" ]
}
Usage in Python:
md = gws.base.metadata.from_args(app_metadata, self.cfg('metadata'))
md = gws.base.metadata.update(md, title='Roads')
for kg in gws.base.metadata.keyword_groups(md):
print(kg.codeSpace, kg.keywords)
Source code: gws.base.metadata