<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FTmszi</id>
	<title>GRASS-Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FTmszi"/>
	<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/wiki/Special:Contributions/%E2%9A%A0%EF%B8%8FTmszi"/>
	<updated>2026-05-25T17:59:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=ISO/INSPIRE_Metadata_Support&amp;diff=27144</id>
		<title>ISO/INSPIRE Metadata Support</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=ISO/INSPIRE_Metadata_Support&amp;diff=27144"/>
		<updated>2023-07-19T19:14:45Z</updated>

		<summary type="html">&lt;p&gt;⚠️Tmszi: Update install additional Python packages under Gentoo GNU/Linux and update dependency.py file URL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== ISO 19115:2003- Geographic information -- Metadata ==&lt;br /&gt;
[http://www.iso.org/iso/catalogue_detail.htm?csnumber=26020 ISO 19115:2003] defines the scheme required for description of geographic information and services. It provides information about the identification, the extent, the quality, the spatial and temporal scheme, spatial reference, and distribution of digital geographic data.&lt;br /&gt;
&lt;br /&gt;
== Catalogue Service for the Web ==&lt;br /&gt;
[http://www.opengeospatial.org/standards/cat OGC Catalogue Services] support the ability to publish and search collections of descriptive information (metadata) for data, services, and related information objects. Metadata in catalogues represent resource characteristics that can be queried and presented for evaluation and further processing by both humans and software. Catalogue services are required to support the discovery and binding to registered information resources within an information community. &lt;br /&gt;
&lt;br /&gt;
= About =&lt;br /&gt;
Wx.metadata which was developed during Google Summer of Code 2014/2015 is currently available in GRASS 7 add-ons: https://github.com/OSGeo/grass-addons/tree/master/grass7/gui/wxpython/wx.metadata&lt;br /&gt;
* The package for creating and editing metadata according to EN ISO 19115, described here, consists of few modules. The modules {{AddonCmd|r.info.iso}}, {{AddonCmd|v.info.iso}} and {{AddonCmd|t.info.iso}} are command line based and support the conversion from the current native metadata management ({{cmd|r.info}}, {{cmd|v.info}}, {{cmd|t.info}}) into ISO based metadata. The GUI based module - {{AddonCmd|g.gui.metadata}} - offers advanced tools for management of metadata. &lt;br /&gt;
&lt;br /&gt;
[[Image:Wxmetadata-editing.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
* The package also includes the module {{AddonCmd|g.gui.cswbrowser}} for searching and browsing metadata catalog (csw). For advanced users there are a few modules for establishing and handling pycsw server:&lt;br /&gt;
 * {{AddonCmd|db.csw.admin}} - module for administration of pycsw server&lt;br /&gt;
 * {{AddonCmd|db.csw.run}} - module for starting server on localhost&lt;br /&gt;
 * {{AddonCmd|db.csw.harvest}} - module for harvesting metadata between two CSW.&lt;br /&gt;
&lt;br /&gt;
= Requirements and installation =&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
'''Fedora Linux + Centos:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# install dependencies&lt;br /&gt;
pip3 install jinja2 lxml owslib pycsw pyexcel_ods3 pygments reportlab sqlalchemy validators&lt;br /&gt;
&lt;br /&gt;
# osmsm JavaScript lib map static image generator which use OpenStreetMap data&lt;br /&gt;
# https://github.com/jperelli/osm-static-maps&lt;br /&gt;
sudo npm i -g osm-static-maps&lt;br /&gt;
osmsm --help&lt;br /&gt;
&lt;br /&gt;
# verify dependencies&lt;br /&gt;
wget https://raw.githubusercontent.com/OSGeo/grass-addons/grass8/src/gui/wxpython/wx.metadata/mdlib/dependency.py&lt;br /&gt;
python3 dependency.py&lt;br /&gt;
rm -f dependency.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Gentoo GNU/Linux:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo emerge -av dev-python/jinja dev-python/lxml dev-python/owslib dev-python/pygments dev-python/reportlab dev-python/sqlalchemy dev-python/validators&lt;br /&gt;
# Create Python virtual enviroment&lt;br /&gt;
python -m venv --system-site-packages $HOME/venvs/wx_metadata&lt;br /&gt;
# Activate created Python environment&lt;br /&gt;
source $HOME/venvs/wx_metadata/bin/activate &lt;br /&gt;
# Install additional Python packages&lt;br /&gt;
pip install pycsw pyexcel_ods3&lt;br /&gt;
&lt;br /&gt;
# osmsm JavaScript lib map static image generator which use OpenStreetMap data&lt;br /&gt;
# https://github.com/jperelli/osm-static-maps&lt;br /&gt;
sudo npm i -g osm-static-maps&lt;br /&gt;
osmsm --help&lt;br /&gt;
&lt;br /&gt;
# verify dependencies&lt;br /&gt;
wget https://raw.githubusercontent.com/OSGeo/grass-addons/grass8/src/gui/wxpython/wx.metadata/mdlib/dependency.py&lt;br /&gt;
python3 dependency.py&lt;br /&gt;
rm -f dependency.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 20.04 LTS Focal Fossa GNU/Linux:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install python3-jinja2 python3-lxml python3-owslib python3-pycsw python3-pygments python3-reportlab python3-sqlalchemy&lt;br /&gt;
pip3 install --user pyexcel_ods3 validators&lt;br /&gt;
&lt;br /&gt;
# osmsm JavaScript lib map static image generator which use OpenStreetMap data&lt;br /&gt;
# https://github.com/jperelli/osm-static-maps&lt;br /&gt;
sudo npm i -g osm-static-maps&lt;br /&gt;
osmsm --help&lt;br /&gt;
&lt;br /&gt;
# verify dependencies&lt;br /&gt;
wget https://raw.githubusercontent.com/OSGeo/grass-addons/grass8/src/gui/wxpython/wx.metadata/mdlib/dependency.py&lt;br /&gt;
python3 dependency.py&lt;br /&gt;
rm -f dependency.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Dependencies, from source code:'''&lt;br /&gt;
* Of course, have [https://grass.osgeo.org/download/ GRASS GIS 7.x]&lt;br /&gt;
&lt;br /&gt;
wx.metadata package has several dependencies on external libraries:&lt;br /&gt;
&lt;br /&gt;
* [https://pycsw.org/ pycsw] package - development version(OGC CSW server implementation written in Python):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/geopython/pycsw.git &amp;amp;&amp;amp; cd pycsw&lt;br /&gt;
sudo pip install -e . &amp;amp;&amp;amp; sudo pip install -r requirements-standalone.txt &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://geopython.github.io/OWSLib/ OWSLib] package - development version (OGC CSW client implementation written in Python):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone git://github.com/geopython/OWSLib.git&lt;br /&gt;
cd OWSLib &amp;amp;&amp;amp; sudo python setup.py install &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://jinja.pocoo.org/docs/dev/ Jinja2] (one of the most used template engines for Python)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/mitsuhiko/jinja2.git&lt;br /&gt;
cd jinja2 &amp;amp;&amp;amp; sudo python setup.py install &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://pygments.org/ Pygments] for highlighting text(for Ubuntu below)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install python-pygments&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Additionally, python-reportlab is required. The name of the package could vary for your distro.&lt;br /&gt;
&lt;br /&gt;
== Addon installation ==&lt;br /&gt;
&lt;br /&gt;
To install the addon, run in a GRASS GIS session: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.extension wx.metadata&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Creating and editing metadata =&lt;br /&gt;
== Naming of metadata files and storage ==&lt;br /&gt;
The default location for exported metadata files is ''metadata'' directory in the map's mapset. For raster maps, the prefix derived from the current nomenclature is ''cell'', for vector maps ''vector''. File ends with .xml suffix.&lt;br /&gt;
&lt;br /&gt;
For example, the default metadata file name for vector map &amp;quot;roads&amp;quot; is ''vector_roads.xml''.&lt;br /&gt;
&lt;br /&gt;
== Metadata profile ==&lt;br /&gt;
The metadata profile defines attributes, which can be edited in this editor. The editor offers the already mentioned two profiles (Basic and [https://inspire.ec.europa.eu/index.cfm INSPIRE]). The editor also supports loading of customized profiles. See Creation of custom ISO based profile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Currently there are three build-in ISO profiles available: &amp;lt;/big&amp;gt;&lt;br /&gt;
* '''The basic profile''' is substituted from intersection between items stored in GRASS native metadata format and INSPIRE profile. The intersect (subset) includes all available GRASS metadata. Metadata which cannot be assigned to ISO based attributes are stored in metadata attribute ''sabstractact''. &lt;br /&gt;
&lt;br /&gt;
* '''The INSPIRE profile''' fulfills the [https://inspire.ec.europa.eu/index.cfm/pageid/101 criteria of INSPIRE profile]. In case if is not possible to get the values from native GRASS metadata, these are filled with text string '$NULL'. This rule is applied for both profiles.&lt;br /&gt;
&lt;br /&gt;
* '''The temporal profile''' is based on the GRASS basic profile and includes additional specific attributes for Temporal framework.&lt;br /&gt;
&lt;br /&gt;
== Modules r.info.iso, v.info.iso t.info.iso ==&lt;br /&gt;
Command line based modules implements  conversion of native GRASS metadata to ISO based XML metadata files. Identical configuration applies for both modules. Products of these modules differ partly in certain metadata attributes related  to differences between  raster ({{cmd|r.info}}) and vector ({{cmd|v.info}}) maps metadata. &lt;br /&gt;
&lt;br /&gt;
'''Parameters of modules:'''&lt;br /&gt;
* map - selection of map for metadata creation&lt;br /&gt;
* profile - selection of metadata profile (basic or inspire)&lt;br /&gt;
* output - path to output XML metadata file.  Default = according to naming &amp;amp; storage rules&lt;br /&gt;
	&lt;br /&gt;
== Metadata editor: g.gui.metadata  ==&lt;br /&gt;
The metadata editor ([https://github.com/OSGeo/grass-addons/blob/master/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.html addon on GitHub]) includes a graphical interface for converting metadata from {{cmd|r.info}} and {{cmd|v.info}} to ISO based metadata, editing metadata files and creating metadata templates. In addition, the graphical module allows validating of INSPIRE and Basic profile.&lt;br /&gt;
&lt;br /&gt;
=== Information about metadata item ===&lt;br /&gt;
Tooltip function helps to fill in the form correctly.&lt;br /&gt;
[[Image:Wxmetadata-tooltip.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
=== Creation of metadata ===&lt;br /&gt;
The editor offers two editing modes. The first one allows to create metadata from selected GRASS maps from an active location. The second one allows editing of external metadata file. &lt;br /&gt;
&lt;br /&gt;
=== Fetching values from database backend ===&lt;br /&gt;
The editor automatically fetches keywords from SQLite GRASS GIS backend. Three well know dictionaries are added by default. The user can manually add dictionaries by SQL commands. &lt;br /&gt;
Dictionaries are stored in the table ''metadata_themes''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ table metadata_themes&lt;br /&gt;
! Attribute&lt;br /&gt;
| title&lt;br /&gt;
| keyword&lt;br /&gt;
| date_iso&lt;br /&gt;
| date_type&lt;br /&gt;
|-&lt;br /&gt;
! Date type&lt;br /&gt;
| TEXT || TEXT|| TEXT|| TEXT&lt;br /&gt;
|-&lt;br /&gt;
! Example&lt;br /&gt;
|Example || GEMET - Concepts, version || 2010-01-13 || publication&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Image:Keywords.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
=== Exporting metadata reports to format PDF ===&lt;br /&gt;
This function allows to export metadata of GRASS maps to report in PDF format. The report template is based on INSPIRE profile. Unknown values of metadata attributes are filled by text $UNKNOWN.&lt;br /&gt;
[[Image:Pdfexp.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
{{YouTube|V7tgOOuRyuA}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GRASS metadata map editor ===&lt;br /&gt;
[[Image:Wxmetadata-mapEdit.png|center|150px]]&lt;br /&gt;
&lt;br /&gt;
Combo box for selection of ISO profile:&lt;br /&gt;
* basic&lt;br /&gt;
* inspire&lt;br /&gt;
* load custom –  allows to load metadata profile from file. For example in case of using predefined template. The intersection of GRASS Basic profile (all available metadata for selected map) and loaded custom profile will proceed with this selection.&lt;br /&gt;
&lt;br /&gt;
{{YouTube|7V5NyVdO05o}}&lt;br /&gt;
&lt;br /&gt;
=== External metadata editor ===&lt;br /&gt;
[[Image:Wxmetadata-externalEdit.png|center|150]]&lt;br /&gt;
This editor mode allows to load own template and xml file for editing. This option does not support any connection with GRASS maps metadata.&lt;br /&gt;
&lt;br /&gt;
{{YouTube|npMAavbwfi0}}&lt;br /&gt;
&lt;br /&gt;
=== Defining templates ===&lt;br /&gt;
This function allows to create pattern of metadata profile. In other words it support defining fixed values to template. With using created template, the editor does not initialize texts inputs of defined values. These attributes is able to see only in Tree Browser in editor. Direct link on this function is multiple editing mode (see below).&lt;br /&gt;
* If check-box of metadata attribute is checked, the OWSLib object in template will be replaced by value. Unchecked attributes will not change this 'part' of the template.&lt;br /&gt;
* The yellow background of text fields indicates metadata attributes, which are not possible get from GRASS map information.&lt;br /&gt;
[[Image:Wxmetadata-template.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* If the check-box of metadata attribute is checked, the OWSLib object in template will be replaced by value. Unchecked attributes will not change this 'part' of the template.&lt;br /&gt;
&lt;br /&gt;
example: Template result of attribute which is checked &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:dateStamp&amp;gt;&lt;br /&gt;
        &amp;lt;gco:Date&amp;gt;2013-01-01&amp;lt;/gco:Date&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:dateStamp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: Template result of attribute which is unchecked &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:dateStamp&amp;gt;&lt;br /&gt;
        &amp;lt;gco:Date&amp;gt;{{ md.datestamp }}{# tag=&amp;quot;md.datestamp&amp;quot; , name=&amp;quot;Metadata date&amp;quot; ,\&lt;br /&gt;
 ref= &amp;quot;Part B 10.2&amp;quot; , desc= &amp;quot;Date that the metadata was created.&amp;quot;,type = &amp;quot;date&amp;quot; ,&lt;br /&gt;
 example = &amp;quot;2005-03-27&amp;quot; , multi= 0 , group= &amp;quot;Metadata&amp;quot; , multiline= False #}&amp;lt;/gco:Date&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:dateStamp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video shows record of simple practice of defining custom template&lt;br /&gt;
{{YouTube|Pu2sQoAJXfo}}&lt;br /&gt;
&lt;br /&gt;
=== Editing metadata of multiple map selection ===&lt;br /&gt;
The advantages of this editing mode is in work using of defined template. This option can be used by selection of multiple maps in data catalog.  &lt;br /&gt;
&lt;br /&gt;
=== Validation of metadata profile ===&lt;br /&gt;
On the right side of editor is a validator of metadata. Currently, validator is able to validate two build-in profiles. For selection of profile “Load custom” is set by default the inspire profile.&lt;br /&gt;
&lt;br /&gt;
=== Updating GRASS native metadata ===&lt;br /&gt;
The {{AddonCmd|g.gui.metadata}} module allows updating native GRASS metadata with using modules {{cmd|r.support}} and {{cmd|v.support}}. The intersection between ISO based metadata and r|v.support is limited by available parameters for these modules.&lt;br /&gt;
&lt;br /&gt;
=== Publishing to csw server ===&lt;br /&gt;
Editor allows direct publishing of edited metadata by CSW(Catalog Service for Web) standard to remote catalogue server. Note that the remote catalogue must allows transaction.&lt;br /&gt;
[[File:Csw publisher.png|650px|center|publishing of metadata directly to remote csw server]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* EPSG code must by added in url format. Information of projection is added only if EPSG code is known or if GDAL function for identifying from WKT is successful.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gmd:referenceSystemInfo&amp;gt;&lt;br /&gt;
  &amp;lt;gmd:MD_ReferenceSystem&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:referenceSystemIdentifier&amp;gt;&lt;br /&gt;
      &amp;lt;gmd:RS_Identifier&amp;gt;&lt;br /&gt;
        &amp;lt;gmd:code&amp;gt;&lt;br /&gt;
          &amp;lt;gco:CharacterString&amp;gt;http://www.opengis.net/def/crs/EPSG/0/3035&amp;lt;/gco:CharacterString&amp;gt;&lt;br /&gt;
        &amp;lt;/gmd:code&amp;gt;&lt;br /&gt;
        &amp;lt;gmd:codeSpace&amp;gt;&lt;br /&gt;
          &amp;lt;gco:CharacterString&amp;gt;INSPIRE RS registry&amp;lt;/gco:CharacterString&amp;gt;&lt;br /&gt;
        &amp;lt;/gmd:codeSpace&amp;gt;&lt;br /&gt;
      &amp;lt;/gmd:RS_Identifier&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:referenceSystemIdentifier&amp;gt;&lt;br /&gt;
  &amp;lt;/gmd:MD_ReferenceSystem&amp;gt;&lt;br /&gt;
&amp;lt;/gmd:referenceSystemInfo&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Creation of custom ISO based profile =&lt;br /&gt;
Creation of own custom ISO based profile is with using Jinja template syntax and some addition rules.&lt;br /&gt;
The main item of template is composite from two braces.&lt;br /&gt;
Both of them are fully according to syntax of Jinja template. First holds information about statements of loop or condition and also simple Python object.  Second braces according to Jinja template syntax is represented by comment {# #}. In this braces additional information for generating graphical interface of editor are stored. In addition also  information about individual metadata attributes (name, example, description, multiplicity, etc) is included.&lt;br /&gt;
&lt;br /&gt;
== The first braces ==&lt;br /&gt;
Contain object of OWSLib which holds the metadata value. This values can be object which is  describing  single variable or list of variables.  Value of some attribute can be defined￹ many times (according to ISO). This attributes must be defined in block of template with starting statements and ending mark of block. Only allowed loop statement is FOR (see jinja2 manual). The XML based text of block will by duplicated according to number of items in the list.&lt;br /&gt;
&lt;br /&gt;
== Initialize of OWSLib objects ==&lt;br /&gt;
Most object are initialized in configuration of file which is stored in wx.metadat/config/init_md.txt&lt;br /&gt;
&lt;br /&gt;
example: Default configuration file for the build-in Basic and Inspire profile:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self.md.identification = MD_DataIdentification() &lt;br /&gt;
self.md.dataquality = DQ_DataQuality() &lt;br /&gt;
self.md.distribution = MD_Distribution() &lt;br /&gt;
self.md.identification.extent = EX_Extent() &lt;br /&gt;
self.md.identification.extent.boundingBox = EX_GeographicBoundingBox()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on the left side of equation is obligatory prefix 'self.md'. Postfix (name of variable) is open. On right side is OWSLib object&lt;br /&gt;
&lt;br /&gt;
== Single element ==&lt;br /&gt;
In case if the value of metadata element is  declared only once: &lt;br /&gt;
example: Identifier&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{ md.identifier }}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: Lineage&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{ md.dataquality.lineage }}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loop or Condition statements ==&lt;br /&gt;
Loops and condition are defined in by starting braces and ending braces '{%  -%}' .&lt;br /&gt;
&lt;br /&gt;
Start of block:&lt;br /&gt;
&lt;br /&gt;
example: for statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for co in md.contact -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Editor allows to use Python 'zip' function and 'len' function. Note- in Jinja syntax is Python len(length) function defined specifically.&lt;br /&gt;
&lt;br /&gt;
example: zip&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for (u,d) in zip(md.identification.uom,md.identification.distance) -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: len&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% if md.identification.denominators|length &amp;gt; 0 -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
End of block is defined by:&lt;br /&gt;
&lt;br /&gt;
example: if statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% endif -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: for statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% endfor -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The second braces ==&lt;br /&gt;
The second braces (by Jinja syntax comment) contains these parameters:&lt;br /&gt;
* tag - just copy of string from first braces&lt;br /&gt;
* object – for reading and holding metadata in python objects is used OWSLib library.&lt;br /&gt;
&lt;br /&gt;
Most of object are initialized by configuration file wx.metadata/config/init_md.txt. Some metadata attributes are necessary initialized directly in this (object) parameter. Best example is the metadata contact object(organization,email)  which can be initialized for many times.&lt;br /&gt;
&lt;br /&gt;
example: responsible party&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for co in md.contact -%}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.organization }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.email }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.role }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{% endfor -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* name – free text string describing the name of metadata item&lt;br /&gt;
* ref – free additional information. By default should be reference of ISO attributes&lt;br /&gt;
* type – data type characteristic. Input text field validator for 'email' and 'date' is implemented. &lt;br /&gt;
* desc – free text which should describe or define the characteristic of metadata item&lt;br /&gt;
* example – free text with example of the value for metadata item&lt;br /&gt;
* group- label of the notebook list(tab) in editor.&lt;br /&gt;
* inbox- label of the box which includes attributes from the block of Jinja template. All items from one block of Jinja template must be in same box(same name).&lt;br /&gt;
* multi- 0 or 1. In case 0, the item cannot be duplicated= text field widget does not contain  button for duplicating itself. Note that only OWSLib list based variables can be used with duplication button.&lt;br /&gt;
* inboxmulti- 0 or 1. In case 0, the items in box cannot be duplicated = box with items  not dispose with button for cloning self.   &lt;br /&gt;
* multiline – True = initialize text field with multilines editing. Suitable for longer texts input&lt;br /&gt;
&lt;br /&gt;
example of second braces:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{# tag=&amp;quot;md.dataquality.lineage&amp;quot; , name=&amp;quot;Lineage&amp;quot; , ref= &amp;quot;Part B 6.1&amp;quot; ,/&lt;br /&gt;
 desc= &amp;quot;General explanation of the data producers knowledge about the lineage of a dataset.&amp;quot;/&lt;br /&gt;
 ,example = &amp;quot;Product 1 scenes correspond to the path/row of the Landsat orbit..&amp;quot; ,/&lt;br /&gt;
 type =&amp;quot;string&amp;quot; , group= &amp;quot;Quality and Validity&amp;quot; ,  multiline= True #}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Syntax of Jinja template system and editor custom parser ==&lt;br /&gt;
* both of braces of one metadata element must be on same line&lt;br /&gt;
* after '{# ','{%' must be white space. Also before '#}' '-%}'&lt;br /&gt;
&lt;br /&gt;
== Examples of template ==&lt;br /&gt;
&lt;br /&gt;
This video tutorial shows practice of creation custom ISO profile.&lt;br /&gt;
{{YouTube|ahl41mFD5w0}}&lt;br /&gt;
&lt;br /&gt;
= Tools for working with metadata catalogue (csw) =&lt;br /&gt;
== Browsing and searching- g.gui.cswbrowser ==&lt;br /&gt;
Module {{AddonCmd|g.gui.cswbrowser}} (Browser) based graphical interface allows managing csw connections, setting filter and searching, browsing results and adding services to GRASS GIS.&lt;br /&gt;
&lt;br /&gt;
=== Connection manager ===&lt;br /&gt;
Connection manager allows: &lt;br /&gt;
* adding&lt;br /&gt;
* removing&lt;br /&gt;
* loading list of connections from file.&lt;br /&gt;
&lt;br /&gt;
By default the Browser is initialized by list of few well known csw providers of csw. Button &amp;quot;Service info&amp;quot; shows metadata of the service.&lt;br /&gt;
&lt;br /&gt;
User can manage connection in two ways:&lt;br /&gt;
* First one is with using hidden storage provided by [http://wxpython.org/Phoenix/docs/html/ConfigBase.html ​wx.Config]. This case is without accessing default connection file.&lt;br /&gt;
* After prompt user also can add/remove connection from default .xml file.&lt;br /&gt;
[[File:ConnectionMgr.png|center|600px|Connection manager in g.gui.cswbrowser]] &lt;br /&gt;
&lt;br /&gt;
=== Searching ===&lt;br /&gt;
Before fetching data from selected csw server is proper to set up searching filter. Searching can be restricted by:&lt;br /&gt;
* DCMI Type (Collection , Dataset , Event , Image , InteractiveResource , MovingImage , PhysicalObject , Service , Software , Sound , StillImage , Text)&lt;br /&gt;
* Area(bounding box)&lt;br /&gt;
** current GRASS GIS computation region&lt;br /&gt;
** manually &lt;br /&gt;
* Keywords&lt;br /&gt;
** basic filter allows to use basic or advance keyword filtering. In the simple case user can define single keywords or multiple keywords with button &amp;quot;+&amp;quot;. Logic operator between keywords is AND(&amp;amp;).&lt;br /&gt;
** second, advanced is based on OGC list of expressions which means that can be set filter with logic relations between keywords or sets of keywords. Dialogue for settings keywords text string is under &amp;quot;Advanced&amp;quot; check-box. Syntax of constraints is based on python list syntax. Each keywords must be in braces&lt;br /&gt;
[[File:Find1.png|center|600px|g.gui.cswbrowser, searching page]]&lt;br /&gt;
&lt;br /&gt;
==== Advanced keywords filtering ====&lt;br /&gt;
On the left panel of Browser is placed check-box named &amp;quot;Advance&amp;quot;. The keywords advanced dialogue allows to use basic bool operations.&lt;br /&gt;
&lt;br /&gt;
*OR condition&lt;br /&gt;
     a || b || c&lt;br /&gt;
     [&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;]&lt;br /&gt;
*AND condition&lt;br /&gt;
     a &amp;amp;&amp;amp; b &amp;amp;&amp;amp; c&lt;br /&gt;
     [ [&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;] ]&lt;br /&gt;
*composition&lt;br /&gt;
     (a &amp;amp;&amp;amp; b) || c || d || e&lt;br /&gt;
     [[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;],[&amp;quot;c&amp;quot;],[&amp;quot;d&amp;quot;],[&amp;quot;e&amp;quot;]] or [[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;],&amp;quot;c&amp;quot;,&amp;quot;d&amp;quot;,&amp;quot;e&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
=== Browsing results===&lt;br /&gt;
On the bottom of Browser is a controller for browsing results. The data from server are fetched by number of items per one transaction. Default is a 20 items. After selection of item in the result table, metadata of record should be displayed. Browser automatically enables buttons on the top of Browser if WMS, WCS or WFS services are available.&lt;br /&gt;
&lt;br /&gt;
=== Setting up csw server ===&lt;br /&gt;
&lt;br /&gt;
== CSW server management ==&lt;br /&gt;
wx.metadata package includes tools for establishing and handling pycsw server. Pycsw stuff consists of:&lt;br /&gt;
* {{AddonCmd|db.csw.admin}}&lt;br /&gt;
* {{AddonCmd|db.csw.run}}&lt;br /&gt;
* {{AddonCmd|db.csw.harvest}}&lt;br /&gt;
&lt;br /&gt;
For handling pycsw server can be use standard pythons scripts from pycsw install directory or mentioned three modules.&lt;br /&gt;
&lt;br /&gt;
== Installation and configuration csw server ==&lt;br /&gt;
* Installation pycsw package - development version(OGC CSW server implementation written in Python):&lt;br /&gt;
e.g.to default path taken from configure file&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /var/www/pycsw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*deploying pycsw&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone https://github.com/geopython/pycsw.git &amp;amp;&amp;amp; cd pycsw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ pip install -e . &amp;amp;&amp;amp; pip install -r requirements-standalone.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Create and adjust a configuration file:&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cp default-sample.cfg default.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* adjust parameters in ''default.cfg''&lt;br /&gt;
** '''server.home''' - path to installation directory&lt;br /&gt;
** '''repository.database''' - path to SQLite database e.g. $GISDBASE/WGS84/PERMANENT/sqlite/sqlite.db&lt;br /&gt;
** set '''server.url''' to: http://localhost:8000/&lt;br /&gt;
&lt;br /&gt;
*Setup the database(creates tables, indexes, etc.)&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ pycsw-admin.py -c load_records -f default.cfg -p /path/to/xml/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**with module db.csw.admin from GRASS GIS. Flag -s and parameter configure with path to configure file. Path to database is automatically taken from configure file.&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.admin -s configure=/var/www/html/pycsw/default.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Load records:&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pycsw-admin.py -c load_records -f default.cfg -p /path/to/xml/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**db.csw.admin module with parameter -r for load recursively&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.admin -r configure=/var/www/html/pycsw/default.cfg load_records=path/to/xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Run the server&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python csw.wsgi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**db.csw.admin module with parameter path and port&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.run path=/var/www/html/pycsw port=8000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Harvesting csw catalogue ==&lt;br /&gt;
Module {{AddonCmd|db.csw.harvest}} allows to copy data from source csw server to destination csw server.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[GRASS Metadata Management]]&lt;br /&gt;
* [http://trac.osgeo.org/grass/wiki/GSoC/2014/MetadataForGRASS Development page 2014]&lt;br /&gt;
* [https://trac.osgeo.org/grass/wiki/GSoC/2015/ImprovedMetadata Development page 2015]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Metadata]]&lt;br /&gt;
[[Category:INSPIRE]]&lt;/div&gt;</summary>
		<author><name>⚠️Tmszi</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=ISO/INSPIRE_Metadata_Support&amp;diff=26921</id>
		<title>ISO/INSPIRE Metadata Support</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=ISO/INSPIRE_Metadata_Support&amp;diff=26921"/>
		<updated>2023-05-01T18:11:10Z</updated>

		<summary type="html">&lt;p&gt;⚠️Tmszi: Add osmsm JavaScript lib map static image generator which use OpenStreetMap data as dependency for installation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== ISO 19115:2003- Geographic information -- Metadata ==&lt;br /&gt;
[http://www.iso.org/iso/catalogue_detail.htm?csnumber=26020 ISO 19115:2003] defines the scheme required for description of geographic information and services. It provides information about the identification, the extent, the quality, the spatial and temporal scheme, spatial reference, and distribution of digital geographic data.&lt;br /&gt;
&lt;br /&gt;
== Catalogue Service for the Web ==&lt;br /&gt;
[http://www.opengeospatial.org/standards/cat OGC Catalogue Services] support the ability to publish and search collections of descriptive information (metadata) for data, services, and related information objects. Metadata in catalogues represent resource characteristics that can be queried and presented for evaluation and further processing by both humans and software. Catalogue services are required to support the discovery and binding to registered information resources within an information community. &lt;br /&gt;
&lt;br /&gt;
= About =&lt;br /&gt;
Wx.metadata which was developed during Google Summer of Code 2014/2015 is currently available in GRASS 7 add-ons: https://github.com/OSGeo/grass-addons/tree/master/grass7/gui/wxpython/wx.metadata&lt;br /&gt;
* The package for creating and editing metadata according to EN ISO 19115, described here, consists of few modules. The modules {{AddonCmd|r.info.iso}}, {{AddonCmd|v.info.iso}} and {{AddonCmd|t.info.iso}} are command line based and support the conversion from the current native metadata management ({{cmd|r.info}}, {{cmd|v.info}}, {{cmd|t.info}}) into ISO based metadata. The GUI based module - {{AddonCmd|g.gui.metadata}} - offers advanced tools for management of metadata. &lt;br /&gt;
&lt;br /&gt;
[[Image:Wxmetadata-editing.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
* The package also includes the module {{AddonCmd|g.gui.cswbrowser}} for searching and browsing metadata catalog (csw). For advanced users there are a few modules for establishing and handling pycsw server:&lt;br /&gt;
 * {{AddonCmd|db.csw.admin}} - module for administration of pycsw server&lt;br /&gt;
 * {{AddonCmd|db.csw.run}} - module for starting server on localhost&lt;br /&gt;
 * {{AddonCmd|db.csw.harvest}} - module for harvesting metadata between two CSW.&lt;br /&gt;
&lt;br /&gt;
= Requirements and installation =&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
'''Fedora Linux + Centos:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# install dependencies&lt;br /&gt;
pip3 install jinja2 lxml owslib pycsw pyexcel_ods3 pygments reportlab sqlalchemy validators&lt;br /&gt;
&lt;br /&gt;
# osmsm JavaScript lib map static image generator which use OpenStreetMap data&lt;br /&gt;
# https://github.com/jperelli/osm-static-maps&lt;br /&gt;
sudo npm i -g osm-static-maps&lt;br /&gt;
osmsm --help&lt;br /&gt;
&lt;br /&gt;
# verify dependencies&lt;br /&gt;
wget https://raw.githubusercontent.com/OSGeo/grass-addons/master/grass7/gui/wxpython/wx.metadata/mdlib/dependency.py&lt;br /&gt;
python3 dependency.py&lt;br /&gt;
rm -f dependency.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Gentoo GNU/Linux:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo emerge -av dev-python/jinja dev-python/lxml dev-python/owslib dev-python/pygments dev-python/reportlab dev-python/sqlalchemy&lt;br /&gt;
pip install --user pycsw pyexcel_ods3 validators&lt;br /&gt;
&lt;br /&gt;
# osmsm JavaScript lib map static image generator which use OpenStreetMap data&lt;br /&gt;
# https://github.com/jperelli/osm-static-maps&lt;br /&gt;
sudo npm i -g osm-static-maps&lt;br /&gt;
osmsm --help&lt;br /&gt;
&lt;br /&gt;
# verify dependencies&lt;br /&gt;
wget https://raw.githubusercontent.com/OSGeo/grass-addons/master/grass7/gui/wxpython/wx.metadata/mdlib/dependency.py&lt;br /&gt;
python3 dependency.py&lt;br /&gt;
rm -f dependency.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 20.04 LTS Focal Fossa GNU/Linux:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install python3-jinja2 python3-lxml python3-owslib python3-pycsw python3-pygments python3-reportlab python3-sqlalchemy&lt;br /&gt;
pip3 install --user pyexcel_ods3 validators&lt;br /&gt;
&lt;br /&gt;
# osmsm JavaScript lib map static image generator which use OpenStreetMap data&lt;br /&gt;
# https://github.com/jperelli/osm-static-maps&lt;br /&gt;
sudo npm i -g osm-static-maps&lt;br /&gt;
osmsm --help&lt;br /&gt;
&lt;br /&gt;
# verify dependencies&lt;br /&gt;
wget https://raw.githubusercontent.com/OSGeo/grass-addons/master/grass7/gui/wxpython/wx.metadata/mdlib/dependency.py&lt;br /&gt;
python3 dependency.py&lt;br /&gt;
rm -f dependency.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Dependencies, from source code:'''&lt;br /&gt;
* Of course, have [https://grass.osgeo.org/download/ GRASS GIS 7.x]&lt;br /&gt;
&lt;br /&gt;
wx.metadata package has several dependencies on external libraries:&lt;br /&gt;
&lt;br /&gt;
* [https://pycsw.org/ pycsw] package - development version(OGC CSW server implementation written in Python):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/geopython/pycsw.git &amp;amp;&amp;amp; cd pycsw&lt;br /&gt;
sudo pip install -e . &amp;amp;&amp;amp; sudo pip install -r requirements-standalone.txt &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://geopython.github.io/OWSLib/ OWSLib] package - development version (OGC CSW client implementation written in Python):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone git://github.com/geopython/OWSLib.git&lt;br /&gt;
cd OWSLib &amp;amp;&amp;amp; sudo python setup.py install &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://jinja.pocoo.org/docs/dev/ Jinja2] (one of the most used template engines for Python)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/mitsuhiko/jinja2.git&lt;br /&gt;
cd jinja2 &amp;amp;&amp;amp; sudo python setup.py install &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://pygments.org/ Pygments] for highlighting text(for Ubuntu below)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install python-pygments&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Additionally, python-reportlab is required. The name of the package could vary for your distro.&lt;br /&gt;
&lt;br /&gt;
== Addon installation ==&lt;br /&gt;
&lt;br /&gt;
To install the addon, run in a GRASS GIS session: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.extension wx.metadata&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Creating and editing metadata =&lt;br /&gt;
== Naming of metadata files and storage ==&lt;br /&gt;
The default location for exported metadata files is ''metadata'' directory in the map's mapset. For raster maps, the prefix derived from the current nomenclature is ''cell'', for vector maps ''vector''. File ends with .xml suffix.&lt;br /&gt;
&lt;br /&gt;
For example, the default metadata file name for vector map &amp;quot;roads&amp;quot; is ''vector_roads.xml''.&lt;br /&gt;
&lt;br /&gt;
== Metadata profile ==&lt;br /&gt;
The metadata profile defines attributes, which can be edited in this editor. The editor offers the already mentioned two profiles (Basic and [https://inspire.ec.europa.eu/index.cfm INSPIRE]). The editor also supports loading of customized profiles. See Creation of custom ISO based profile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Currently there are three build-in ISO profiles available: &amp;lt;/big&amp;gt;&lt;br /&gt;
* '''The basic profile''' is substituted from intersection between items stored in GRASS native metadata format and INSPIRE profile. The intersect (subset) includes all available GRASS metadata. Metadata which cannot be assigned to ISO based attributes are stored in metadata attribute ''sabstractact''. &lt;br /&gt;
&lt;br /&gt;
* '''The INSPIRE profile''' fulfills the [https://inspire.ec.europa.eu/index.cfm/pageid/101 criteria of INSPIRE profile]. In case if is not possible to get the values from native GRASS metadata, these are filled with text string '$NULL'. This rule is applied for both profiles.&lt;br /&gt;
&lt;br /&gt;
* '''The temporal profile''' is based on the GRASS basic profile and includes additional specific attributes for Temporal framework.&lt;br /&gt;
&lt;br /&gt;
== Modules r.info.iso, v.info.iso t.info.iso ==&lt;br /&gt;
Command line based modules implements  conversion of native GRASS metadata to ISO based XML metadata files. Identical configuration applies for both modules. Products of these modules differ partly in certain metadata attributes related  to differences between  raster ({{cmd|r.info}}) and vector ({{cmd|v.info}}) maps metadata. &lt;br /&gt;
&lt;br /&gt;
'''Parameters of modules:'''&lt;br /&gt;
* map - selection of map for metadata creation&lt;br /&gt;
* profile - selection of metadata profile (basic or inspire)&lt;br /&gt;
* output - path to output XML metadata file.  Default = according to naming &amp;amp; storage rules&lt;br /&gt;
	&lt;br /&gt;
== Metadata editor: g.gui.metadata  ==&lt;br /&gt;
The metadata editor ([https://github.com/OSGeo/grass-addons/blob/master/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.html addon on GitHub]) includes a graphical interface for converting metadata from {{cmd|r.info}} and {{cmd|v.info}} to ISO based metadata, editing metadata files and creating metadata templates. In addition, the graphical module allows validating of INSPIRE and Basic profile.&lt;br /&gt;
&lt;br /&gt;
=== Information about metadata item ===&lt;br /&gt;
Tooltip function helps to fill in the form correctly.&lt;br /&gt;
[[Image:Wxmetadata-tooltip.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
=== Creation of metadata ===&lt;br /&gt;
The editor offers two editing modes. The first one allows to create metadata from selected GRASS maps from an active location. The second one allows editing of external metadata file. &lt;br /&gt;
&lt;br /&gt;
=== Fetching values from database backend ===&lt;br /&gt;
The editor automatically fetches keywords from SQLite GRASS GIS backend. Three well know dictionaries are added by default. The user can manually add dictionaries by SQL commands. &lt;br /&gt;
Dictionaries are stored in the table ''metadata_themes''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ table metadata_themes&lt;br /&gt;
! Attribute&lt;br /&gt;
| title&lt;br /&gt;
| keyword&lt;br /&gt;
| date_iso&lt;br /&gt;
| date_type&lt;br /&gt;
|-&lt;br /&gt;
! Date type&lt;br /&gt;
| TEXT || TEXT|| TEXT|| TEXT&lt;br /&gt;
|-&lt;br /&gt;
! Example&lt;br /&gt;
|Example || GEMET - Concepts, version || 2010-01-13 || publication&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Image:Keywords.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
=== Exporting metadata reports to format PDF ===&lt;br /&gt;
This function allows to export metadata of GRASS maps to report in PDF format. The report template is based on INSPIRE profile. Unknown values of metadata attributes are filled by text $UNKNOWN.&lt;br /&gt;
[[Image:Pdfexp.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
{{YouTube|V7tgOOuRyuA}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GRASS metadata map editor ===&lt;br /&gt;
[[Image:Wxmetadata-mapEdit.png|center|150px]]&lt;br /&gt;
&lt;br /&gt;
Combo box for selection of ISO profile:&lt;br /&gt;
* basic&lt;br /&gt;
* inspire&lt;br /&gt;
* load custom –  allows to load metadata profile from file. For example in case of using predefined template. The intersection of GRASS Basic profile (all available metadata for selected map) and loaded custom profile will proceed with this selection.&lt;br /&gt;
&lt;br /&gt;
{{YouTube|7V5NyVdO05o}}&lt;br /&gt;
&lt;br /&gt;
=== External metadata editor ===&lt;br /&gt;
[[Image:Wxmetadata-externalEdit.png|center|150]]&lt;br /&gt;
This editor mode allows to load own template and xml file for editing. This option does not support any connection with GRASS maps metadata.&lt;br /&gt;
&lt;br /&gt;
{{YouTube|npMAavbwfi0}}&lt;br /&gt;
&lt;br /&gt;
=== Defining templates ===&lt;br /&gt;
This function allows to create pattern of metadata profile. In other words it support defining fixed values to template. With using created template, the editor does not initialize texts inputs of defined values. These attributes is able to see only in Tree Browser in editor. Direct link on this function is multiple editing mode (see below).&lt;br /&gt;
* If check-box of metadata attribute is checked, the OWSLib object in template will be replaced by value. Unchecked attributes will not change this 'part' of the template.&lt;br /&gt;
* The yellow background of text fields indicates metadata attributes, which are not possible get from GRASS map information.&lt;br /&gt;
[[Image:Wxmetadata-template.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* If the check-box of metadata attribute is checked, the OWSLib object in template will be replaced by value. Unchecked attributes will not change this 'part' of the template.&lt;br /&gt;
&lt;br /&gt;
example: Template result of attribute which is checked &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:dateStamp&amp;gt;&lt;br /&gt;
        &amp;lt;gco:Date&amp;gt;2013-01-01&amp;lt;/gco:Date&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:dateStamp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: Template result of attribute which is unchecked &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:dateStamp&amp;gt;&lt;br /&gt;
        &amp;lt;gco:Date&amp;gt;{{ md.datestamp }}{# tag=&amp;quot;md.datestamp&amp;quot; , name=&amp;quot;Metadata date&amp;quot; ,\&lt;br /&gt;
 ref= &amp;quot;Part B 10.2&amp;quot; , desc= &amp;quot;Date that the metadata was created.&amp;quot;,type = &amp;quot;date&amp;quot; ,&lt;br /&gt;
 example = &amp;quot;2005-03-27&amp;quot; , multi= 0 , group= &amp;quot;Metadata&amp;quot; , multiline= False #}&amp;lt;/gco:Date&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:dateStamp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video shows record of simple practice of defining custom template&lt;br /&gt;
{{YouTube|Pu2sQoAJXfo}}&lt;br /&gt;
&lt;br /&gt;
=== Editing metadata of multiple map selection ===&lt;br /&gt;
The advantages of this editing mode is in work using of defined template. This option can be used by selection of multiple maps in data catalog.  &lt;br /&gt;
&lt;br /&gt;
=== Validation of metadata profile ===&lt;br /&gt;
On the right side of editor is a validator of metadata. Currently, validator is able to validate two build-in profiles. For selection of profile “Load custom” is set by default the inspire profile.&lt;br /&gt;
&lt;br /&gt;
=== Updating GRASS native metadata ===&lt;br /&gt;
The {{AddonCmd|g.gui.metadata}} module allows updating native GRASS metadata with using modules {{cmd|r.support}} and {{cmd|v.support}}. The intersection between ISO based metadata and r|v.support is limited by available parameters for these modules.&lt;br /&gt;
&lt;br /&gt;
=== Publishing to csw server ===&lt;br /&gt;
Editor allows direct publishing of edited metadata by CSW(Catalog Service for Web) standard to remote catalogue server. Note that the remote catalogue must allows transaction.&lt;br /&gt;
[[File:Csw publisher.png|650px|center|publishing of metadata directly to remote csw server]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* EPSG code must by added in url format. Information of projection is added only if EPSG code is known or if GDAL function for identifying from WKT is successful.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gmd:referenceSystemInfo&amp;gt;&lt;br /&gt;
  &amp;lt;gmd:MD_ReferenceSystem&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:referenceSystemIdentifier&amp;gt;&lt;br /&gt;
      &amp;lt;gmd:RS_Identifier&amp;gt;&lt;br /&gt;
        &amp;lt;gmd:code&amp;gt;&lt;br /&gt;
          &amp;lt;gco:CharacterString&amp;gt;http://www.opengis.net/def/crs/EPSG/0/3035&amp;lt;/gco:CharacterString&amp;gt;&lt;br /&gt;
        &amp;lt;/gmd:code&amp;gt;&lt;br /&gt;
        &amp;lt;gmd:codeSpace&amp;gt;&lt;br /&gt;
          &amp;lt;gco:CharacterString&amp;gt;INSPIRE RS registry&amp;lt;/gco:CharacterString&amp;gt;&lt;br /&gt;
        &amp;lt;/gmd:codeSpace&amp;gt;&lt;br /&gt;
      &amp;lt;/gmd:RS_Identifier&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:referenceSystemIdentifier&amp;gt;&lt;br /&gt;
  &amp;lt;/gmd:MD_ReferenceSystem&amp;gt;&lt;br /&gt;
&amp;lt;/gmd:referenceSystemInfo&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Creation of custom ISO based profile =&lt;br /&gt;
Creation of own custom ISO based profile is with using Jinja template syntax and some addition rules.&lt;br /&gt;
The main item of template is composite from two braces.&lt;br /&gt;
Both of them are fully according to syntax of Jinja template. First holds information about statements of loop or condition and also simple Python object.  Second braces according to Jinja template syntax is represented by comment {# #}. In this braces additional information for generating graphical interface of editor are stored. In addition also  information about individual metadata attributes (name, example, description, multiplicity, etc) is included.&lt;br /&gt;
&lt;br /&gt;
== The first braces ==&lt;br /&gt;
Contain object of OWSLib which holds the metadata value. This values can be object which is  describing  single variable or list of variables.  Value of some attribute can be defined￹ many times (according to ISO). This attributes must be defined in block of template with starting statements and ending mark of block. Only allowed loop statement is FOR (see jinja2 manual). The XML based text of block will by duplicated according to number of items in the list.&lt;br /&gt;
&lt;br /&gt;
== Initialize of OWSLib objects ==&lt;br /&gt;
Most object are initialized in configuration of file which is stored in wx.metadat/config/init_md.txt&lt;br /&gt;
&lt;br /&gt;
example: Default configuration file for the build-in Basic and Inspire profile:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self.md.identification = MD_DataIdentification() &lt;br /&gt;
self.md.dataquality = DQ_DataQuality() &lt;br /&gt;
self.md.distribution = MD_Distribution() &lt;br /&gt;
self.md.identification.extent = EX_Extent() &lt;br /&gt;
self.md.identification.extent.boundingBox = EX_GeographicBoundingBox()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on the left side of equation is obligatory prefix 'self.md'. Postfix (name of variable) is open. On right side is OWSLib object&lt;br /&gt;
&lt;br /&gt;
== Single element ==&lt;br /&gt;
In case if the value of metadata element is  declared only once: &lt;br /&gt;
example: Identifier&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{ md.identifier }}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: Lineage&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{ md.dataquality.lineage }}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loop or Condition statements ==&lt;br /&gt;
Loops and condition are defined in by starting braces and ending braces '{%  -%}' .&lt;br /&gt;
&lt;br /&gt;
Start of block:&lt;br /&gt;
&lt;br /&gt;
example: for statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for co in md.contact -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Editor allows to use Python 'zip' function and 'len' function. Note- in Jinja syntax is Python len(length) function defined specifically.&lt;br /&gt;
&lt;br /&gt;
example: zip&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for (u,d) in zip(md.identification.uom,md.identification.distance) -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: len&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% if md.identification.denominators|length &amp;gt; 0 -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
End of block is defined by:&lt;br /&gt;
&lt;br /&gt;
example: if statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% endif -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: for statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% endfor -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The second braces ==&lt;br /&gt;
The second braces (by Jinja syntax comment) contains these parameters:&lt;br /&gt;
* tag - just copy of string from first braces&lt;br /&gt;
* object – for reading and holding metadata in python objects is used OWSLib library.&lt;br /&gt;
&lt;br /&gt;
Most of object are initialized by configuration file wx.metadata/config/init_md.txt. Some metadata attributes are necessary initialized directly in this (object) parameter. Best example is the metadata contact object(organization,email)  which can be initialized for many times.&lt;br /&gt;
&lt;br /&gt;
example: responsible party&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for co in md.contact -%}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.organization }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.email }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.role }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{% endfor -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* name – free text string describing the name of metadata item&lt;br /&gt;
* ref – free additional information. By default should be reference of ISO attributes&lt;br /&gt;
* type – data type characteristic. Input text field validator for 'email' and 'date' is implemented. &lt;br /&gt;
* desc – free text which should describe or define the characteristic of metadata item&lt;br /&gt;
* example – free text with example of the value for metadata item&lt;br /&gt;
* group- label of the notebook list(tab) in editor.&lt;br /&gt;
* inbox- label of the box which includes attributes from the block of Jinja template. All items from one block of Jinja template must be in same box(same name).&lt;br /&gt;
* multi- 0 or 1. In case 0, the item cannot be duplicated= text field widget does not contain  button for duplicating itself. Note that only OWSLib list based variables can be used with duplication button.&lt;br /&gt;
* inboxmulti- 0 or 1. In case 0, the items in box cannot be duplicated = box with items  not dispose with button for cloning self.   &lt;br /&gt;
* multiline – True = initialize text field with multilines editing. Suitable for longer texts input&lt;br /&gt;
&lt;br /&gt;
example of second braces:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{# tag=&amp;quot;md.dataquality.lineage&amp;quot; , name=&amp;quot;Lineage&amp;quot; , ref= &amp;quot;Part B 6.1&amp;quot; ,/&lt;br /&gt;
 desc= &amp;quot;General explanation of the data producers knowledge about the lineage of a dataset.&amp;quot;/&lt;br /&gt;
 ,example = &amp;quot;Product 1 scenes correspond to the path/row of the Landsat orbit..&amp;quot; ,/&lt;br /&gt;
 type =&amp;quot;string&amp;quot; , group= &amp;quot;Quality and Validity&amp;quot; ,  multiline= True #}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Syntax of Jinja template system and editor custom parser ==&lt;br /&gt;
* both of braces of one metadata element must be on same line&lt;br /&gt;
* after '{# ','{%' must be white space. Also before '#}' '-%}'&lt;br /&gt;
&lt;br /&gt;
== Examples of template ==&lt;br /&gt;
&lt;br /&gt;
This video tutorial shows practice of creation custom ISO profile.&lt;br /&gt;
{{YouTube|ahl41mFD5w0}}&lt;br /&gt;
&lt;br /&gt;
= Tools for working with metadata catalogue (csw) =&lt;br /&gt;
== Browsing and searching- g.gui.cswbrowser ==&lt;br /&gt;
Module {{AddonCmd|g.gui.cswbrowser}} (Browser) based graphical interface allows managing csw connections, setting filter and searching, browsing results and adding services to GRASS GIS.&lt;br /&gt;
&lt;br /&gt;
=== Connection manager ===&lt;br /&gt;
Connection manager allows: &lt;br /&gt;
* adding&lt;br /&gt;
* removing&lt;br /&gt;
* loading list of connections from file.&lt;br /&gt;
&lt;br /&gt;
By default the Browser is initialized by list of few well known csw providers of csw. Button &amp;quot;Service info&amp;quot; shows metadata of the service.&lt;br /&gt;
&lt;br /&gt;
User can manage connection in two ways:&lt;br /&gt;
* First one is with using hidden storage provided by [http://wxpython.org/Phoenix/docs/html/ConfigBase.html ​wx.Config]. This case is without accessing default connection file.&lt;br /&gt;
* After prompt user also can add/remove connection from default .xml file.&lt;br /&gt;
[[File:ConnectionMgr.png|center|600px|Connection manager in g.gui.cswbrowser]] &lt;br /&gt;
&lt;br /&gt;
=== Searching ===&lt;br /&gt;
Before fetching data from selected csw server is proper to set up searching filter. Searching can be restricted by:&lt;br /&gt;
* DCMI Type (Collection , Dataset , Event , Image , InteractiveResource , MovingImage , PhysicalObject , Service , Software , Sound , StillImage , Text)&lt;br /&gt;
* Area(bounding box)&lt;br /&gt;
** current GRASS GIS computation region&lt;br /&gt;
** manually &lt;br /&gt;
* Keywords&lt;br /&gt;
** basic filter allows to use basic or advance keyword filtering. In the simple case user can define single keywords or multiple keywords with button &amp;quot;+&amp;quot;. Logic operator between keywords is AND(&amp;amp;).&lt;br /&gt;
** second, advanced is based on OGC list of expressions which means that can be set filter with logic relations between keywords or sets of keywords. Dialogue for settings keywords text string is under &amp;quot;Advanced&amp;quot; check-box. Syntax of constraints is based on python list syntax. Each keywords must be in braces&lt;br /&gt;
[[File:Find1.png|center|600px|g.gui.cswbrowser, searching page]]&lt;br /&gt;
&lt;br /&gt;
==== Advanced keywords filtering ====&lt;br /&gt;
On the left panel of Browser is placed check-box named &amp;quot;Advance&amp;quot;. The keywords advanced dialogue allows to use basic bool operations.&lt;br /&gt;
&lt;br /&gt;
*OR condition&lt;br /&gt;
     a || b || c&lt;br /&gt;
     [&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;]&lt;br /&gt;
*AND condition&lt;br /&gt;
     a &amp;amp;&amp;amp; b &amp;amp;&amp;amp; c&lt;br /&gt;
     [ [&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;] ]&lt;br /&gt;
*composition&lt;br /&gt;
     (a &amp;amp;&amp;amp; b) || c || d || e&lt;br /&gt;
     [[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;],[&amp;quot;c&amp;quot;],[&amp;quot;d&amp;quot;],[&amp;quot;e&amp;quot;]] or [[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;],&amp;quot;c&amp;quot;,&amp;quot;d&amp;quot;,&amp;quot;e&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
=== Browsing results===&lt;br /&gt;
On the bottom of Browser is a controller for browsing results. The data from server are fetched by number of items per one transaction. Default is a 20 items. After selection of item in the result table, metadata of record should be displayed. Browser automatically enables buttons on the top of Browser if WMS, WCS or WFS services are available.&lt;br /&gt;
&lt;br /&gt;
=== Setting up csw server ===&lt;br /&gt;
&lt;br /&gt;
== CSW server management ==&lt;br /&gt;
wx.metadata package includes tools for establishing and handling pycsw server. Pycsw stuff consists of:&lt;br /&gt;
* {{AddonCmd|db.csw.admin}}&lt;br /&gt;
* {{AddonCmd|db.csw.run}}&lt;br /&gt;
* {{AddonCmd|db.csw.harvest}}&lt;br /&gt;
&lt;br /&gt;
For handling pycsw server can be use standard pythons scripts from pycsw install directory or mentioned three modules.&lt;br /&gt;
&lt;br /&gt;
== Installation and configuration csw server ==&lt;br /&gt;
* Installation pycsw package - development version(OGC CSW server implementation written in Python):&lt;br /&gt;
e.g.to default path taken from configure file&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /var/www/pycsw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*deploying pycsw&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone https://github.com/geopython/pycsw.git &amp;amp;&amp;amp; cd pycsw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ pip install -e . &amp;amp;&amp;amp; pip install -r requirements-standalone.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Create and adjust a configuration file:&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cp default-sample.cfg default.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* adjust parameters in ''default.cfg''&lt;br /&gt;
** '''server.home''' - path to installation directory&lt;br /&gt;
** '''repository.database''' - path to SQLite database e.g. $GISDBASE/WGS84/PERMANENT/sqlite/sqlite.db&lt;br /&gt;
** set '''server.url''' to: http://localhost:8000/&lt;br /&gt;
&lt;br /&gt;
*Setup the database(creates tables, indexes, etc.)&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ pycsw-admin.py -c load_records -f default.cfg -p /path/to/xml/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**with module db.csw.admin from GRASS GIS. Flag -s and parameter configure with path to configure file. Path to database is automatically taken from configure file.&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.admin -s configure=/var/www/html/pycsw/default.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Load records:&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pycsw-admin.py -c load_records -f default.cfg -p /path/to/xml/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**db.csw.admin module with parameter -r for load recursively&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.admin -r configure=/var/www/html/pycsw/default.cfg load_records=path/to/xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Run the server&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python csw.wsgi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**db.csw.admin module with parameter path and port&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.run path=/var/www/html/pycsw port=8000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Harvesting csw catalogue ==&lt;br /&gt;
Module {{AddonCmd|db.csw.harvest}} allows to copy data from source csw server to destination csw server.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[GRASS Metadata Management]]&lt;br /&gt;
* [http://trac.osgeo.org/grass/wiki/GSoC/2014/MetadataForGRASS Development page 2014]&lt;br /&gt;
* [https://trac.osgeo.org/grass/wiki/GSoC/2015/ImprovedMetadata Development page 2015]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Metadata]]&lt;br /&gt;
[[Category:INSPIRE]]&lt;/div&gt;</summary>
		<author><name>⚠️Tmszi</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_Debugging&amp;diff=26406</id>
		<title>GRASS Debugging</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_Debugging&amp;diff=26406"/>
		<updated>2020-11-26T16:36:11Z</updated>

		<summary type="html">&lt;p&gt;⚠️Tmszi: Extend wxPython GUI debugging subsection with gdb debugger example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following hints assume to work on a working-copy of the {{twiki|DownloadSource#SubversionGRASSmainsourcecoderepository|GRASS GIS source code} directory.&lt;br /&gt;
&lt;br /&gt;
Additionally it is good to have set the debugging symbols during compile-time. Do not strip the libraries or use optimization in the compile. see {{src|INSTALL}} and {{src|doc/debugging.txt}} in the source code for more information.&lt;br /&gt;
&lt;br /&gt;
== Reporting bugs ==&lt;br /&gt;
&lt;br /&gt;
* Bugs should be reported in the GRASS GIS [https://github.com/OSGeo/grass/issues bug and wish tracker].&lt;br /&gt;
&lt;br /&gt;
* Please use [[GRASS_messages_translation#How_to_change_the_language|untranslated messages]] in your bug reports. The following command will disable the use of translated messages:&lt;br /&gt;
  export LC_ALL=C&lt;br /&gt;
&lt;br /&gt;
* Users should read the [[Mailing list etiquette]] page before posting questions to the &amp;lt;tt&amp;gt;grass-dev&amp;lt;/tt&amp;gt; mailing list.&lt;br /&gt;
&lt;br /&gt;
== Patches ==&lt;br /&gt;
&lt;br /&gt;
* For instructions on creating and applying patches the see [[Patches]] wiki page.&lt;br /&gt;
&lt;br /&gt;
== Setting GRASS-environment variables (numbers: 1-5) ==&lt;br /&gt;
&lt;br /&gt;
 {{cmd|g.gisenv}} set=&amp;quot;DEBUG=1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* A higher debug level means you see more messages.&lt;br /&gt;
* These messages are always present regardless of compiler settings.&lt;br /&gt;
* A setting of &amp;quot;5&amp;quot; is the most verbose, &amp;quot;0&amp;quot; is no debug messages.&lt;br /&gt;
&lt;br /&gt;
== Common problems ==&lt;br /&gt;
&lt;br /&gt;
* Check that the region settings are not totally overwhelming for the raster engine. While there is no set upper limit, anything bigger than 20000x20000 is considered large, and anything an order of mangnitude bigger than that will most likely end with out of memory or large file problems, especially on 32-bit platforms built without LFS support. Many modules ''will'' continue to work on these huge datasets, but processing time may make it not worth the while. See [[Memory issues]] for more tips.&lt;br /&gt;
 {{cmd|g.region}} -p&lt;br /&gt;
&lt;br /&gt;
== Watching top ==&lt;br /&gt;
&lt;br /&gt;
''top'' is a nice command line utility for watching a process's progression. While it won't give you many hard metrics it will give you an idea of what is happening.&lt;br /&gt;
To make the view a little more stable, with ''top'' running from the command line press &amp;quot;M&amp;quot; to sort by memory usage.&lt;br /&gt;
&lt;br /&gt;
== Return codes ==&lt;br /&gt;
&lt;br /&gt;
All GRASS modules send out a return code of &amp;quot;0&amp;quot; if they exit successfully and &amp;quot;1&amp;quot; if they have exited with an error. This is typically accompanied by an &amp;quot;ERROR: &amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
On UNIX (Linux, Mac OS, and [[Cygwin]]) directly after a command line module ends you can type &amp;quot;&amp;lt;tt&amp;gt;echo $?&amp;lt;/tt&amp;gt;&amp;quot; and it will tell you the exit code. In a MS-Windows DOS box the equivalent command is &amp;quot;&amp;lt;tt&amp;gt;echo %errorlevel%&amp;lt;/tt&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Note that some modules (like {{cmd|g.findfile}}) exit with a status of 1 if it (for example) could not find a file, which may be exactly the test the module was run to perform. In that way the return code can be used in script logic.  Thus the exit code only reports EXIT_SUCCESS or EXIT_FAILURE, but a failure can happen for any number of reasons, expected or unexpected, and is not a reason to panic in and of itself.&lt;br /&gt;
&lt;br /&gt;
== Using a C debugger on MS Windows ==&lt;br /&gt;
&lt;br /&gt;
You'll need binaries built with debugging symbols [todo], then you can use tools like [http://support.microsoft.com/default.aspx?scid=kb;EN-US;308538 Dr. Watson] and [http://msdn.microsoft.com/en-us/windows/hardware/gg463016 windbg.exe] from Microsoft.&lt;br /&gt;
Some hints for how this could work can be found [http://www.cruisersforum.com/forums/f134/opencpn-version-2-4-beta-build-423-a-59409-4.html#post677590 here].&lt;br /&gt;
&lt;br /&gt;
== DLL dependencies ==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is needed to disentangle DLL dependencies. A reasonable tool is &amp;quot;Dependency Walker&amp;quot; (free as in free lunch, not software libero): http://www.dependencywalker.com&lt;br /&gt;
&lt;br /&gt;
== Using GDB ==&lt;br /&gt;
&lt;br /&gt;
The [https://www.gnu.org/software/gdb/ GNU Debugger] may be used to diagnose '''&amp;lt;tt&amp;gt;Segmentation Faults&amp;lt;/tt&amp;gt;''' and other weirdness.&lt;br /&gt;
&lt;br /&gt;
=== Compile Time Setup ===&lt;br /&gt;
&lt;br /&gt;
To add debugging information into the built binary, first run&lt;br /&gt;
 make distclean&lt;br /&gt;
&lt;br /&gt;
Then configure the source code with ''-g'' being added to the CFLAGS arguments:&lt;br /&gt;
&lt;br /&gt;
 CFLAGS=&amp;quot;-ggdb -Wall -Werror-implicit-function-declaration&amp;quot; ./configure ...&lt;br /&gt;
&lt;br /&gt;
Do '''not''' use ''-O'' for optimization and do '''not''' strip the binaries with LDFLAGS=&amp;quot;-s&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Eventually compile the source code and start the GRSS GIS session for debugging (see below).&lt;br /&gt;
&lt;br /&gt;
=== Using gdb on command line ===&lt;br /&gt;
&lt;br /&gt;
* Running a program inside [https://en.wikipedia.org/wiki/Gdb GDB] works (installation of GDB required :-)&lt;br /&gt;
: (e.g. on [https://www.debian.org Debian GNU/Linux]: apt-get install gdb)&lt;br /&gt;
&lt;br /&gt;
* Use the exact module name on the command line (at the GRASS prompt) without arguments. Put any command line arguments on the &amp;lt;tt&amp;gt;(gdb)&amp;lt;/tt&amp;gt; command line after the word ''run''.&lt;br /&gt;
&lt;br /&gt;
  gdb `which v.in.ogr`&lt;br /&gt;
  run  out=some_map dsn=&amp;quot;PG:dbname=postgis user=me&amp;quot; olayer=postgislayer&lt;br /&gt;
&lt;br /&gt;
* when it crashes, type &amp;quot;&amp;lt;tt&amp;gt;bt full&amp;lt;/tt&amp;gt;&amp;quot; for a full backtrace&lt;br /&gt;
* type &amp;quot;&amp;lt;tt&amp;gt;l&amp;lt;/tt&amp;gt;&amp;quot; to list where in the source code it got to&lt;br /&gt;
* type &amp;quot;&amp;lt;tt&amp;gt;frame 2&amp;lt;/tt&amp;gt;&amp;quot; to switch to the second level function (see the backtrace), there you can again type &amp;quot;&amp;lt;tt&amp;gt;l&amp;lt;/tt&amp;gt;&amp;quot; to see where it got up to.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can add arguments to gdb directly on the command line:&lt;br /&gt;
&lt;br /&gt;
  gdb --args v.in.ogr out=bla dsn=&amp;quot;PG:dbname=postgis user=me&amp;quot; olayer=postgislayer&lt;br /&gt;
&lt;br /&gt;
Additionally, you can tell it to run the process right away:&lt;br /&gt;
&lt;br /&gt;
  gdb -ex run --args v.in.ogr out=bla dsn=&amp;quot;PG:dbname=postgis user=me&amp;quot; olayer=postgislayer&lt;br /&gt;
&lt;br /&gt;
* ''Attaching to child process'':&lt;br /&gt;
: use &amp;quot;&amp;lt;tt&amp;gt;attach &amp;amp;lt;pid&amp;amp;gt;&amp;lt;/tt&amp;gt;&amp;quot; to attach to an existing process (needed for DBMI debugging etc).&lt;br /&gt;
: For details, see this [http://lists.osgeo.org/pipermail/grass-dev/2007-October/033732.html hint]&lt;br /&gt;
&lt;br /&gt;
=== Saving a core dump for later analysis ===&lt;br /&gt;
&lt;br /&gt;
On Linux, often if a program exits with a &amp;quot;&amp;lt;tt&amp;gt;Segmentation Fault&amp;lt;/tt&amp;gt;&amp;quot; the program will exit leaving nothing behind. It is however possible to dump the state of the program (the memory &amp;quot;core&amp;quot;) to a file. Ubuntu &amp;amp; Mac users may have seen with some crashing programs the long list of memory address computerese which it then asks if you want to report back to the authors.&lt;br /&gt;
&lt;br /&gt;
On Linux, you can check if you are set to &amp;quot;dump the core&amp;quot; to a file with the ulimit command:&lt;br /&gt;
 ulimit -c&lt;br /&gt;
&lt;br /&gt;
a response of &amp;quot;&amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt;&amp;quot; means no core file will be written. Core files can be very large (depending on how much system RAM the program was using at the time it crashed), so is usually kept off. You can temporarily change the limit in a command terminal to dump the whole thing with:&lt;br /&gt;
 ulimit -c unlimited&lt;br /&gt;
which will save a file called &amp;quot;core&amp;quot; in the present directory (if you have permission to write there). You can then analyze the core at a later time with:&lt;br /&gt;
 gdb `which g.module` /path/to/core/file&lt;br /&gt;
&lt;br /&gt;
It is important to note that you must analyze the ''core'' file against the exact version of the executable you were running at the time, and that if you send the ''core'' file to someone else they will be able to see the data you had loaded in the program at the time (if you are a consultant, you client might not like that).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Tcl/TK has been dropped years ago&lt;br /&gt;
=== Using gdb with a mixed C/TclTK application ===&lt;br /&gt;
&lt;br /&gt;
You can't invoke gdb directly on &amp;quot;nviz&amp;quot; or $GISBASE/bin/nviz, as that&lt;br /&gt;
is a shell script. But it's a trivial script which essentially just does:&lt;br /&gt;
&lt;br /&gt;
 $GISBASE/etc/nviz2.2/nviz -f $GISBASE/etc/nviz2.2/scripts/nviz2.2_script ${1+&amp;quot;$@&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
You can debug the $GISBASE/etc/nviz2.2/nviz binary as with any other&lt;br /&gt;
program, i.e.:&lt;br /&gt;
&lt;br /&gt;
 $ gdb $GISBASE/etc/nviz2.2/nviz&lt;br /&gt;
 &amp;gt; run -f $GISBASE/etc/nviz2.2/scripts/nviz2.2_script &amp;lt;any args&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, if you don't need to debug the startup, you can start NVIZ then&lt;br /&gt;
&amp;quot;attach&amp;quot; to the process, as follows:&lt;br /&gt;
&lt;br /&gt;
Once NVIZ is running, get its PID, then:&lt;br /&gt;
&lt;br /&gt;
 $ gdb $GISBASE/etc/nviz2.2/nviz&lt;br /&gt;
 &amp;gt; attach &amp;lt;pid&amp;gt;&lt;br /&gt;
 &amp;gt; break Create_OS_Ctx&lt;br /&gt;
 &amp;gt; cont&lt;br /&gt;
&lt;br /&gt;
Selecting the menu option will re-enter the debugger. Single-step&lt;br /&gt;
through the function (with &amp;quot;next&amp;quot;), printing out the values of any&lt;br /&gt;
variables as they are assigned.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Using gdb within GNU Emacs ===&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
:* 'C' is usually key 'Ctrl'&lt;br /&gt;
:* 'M' is usually key 'Alt'&lt;br /&gt;
&lt;br /&gt;
* start [https://en.wikipedia.org/wiki/Emacs GNU Emacs] within GRASS session, e.g.&lt;br /&gt;
&lt;br /&gt;
 emacs general/manage/cmd/remove.c&lt;br /&gt;
&lt;br /&gt;
[[Image:Emacs_gdb-1a.png|center|640px]]&lt;br /&gt;
&lt;br /&gt;
* create second buffer by &amp;lt;tt&amp;gt;C-x 2&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Image:Emacs_gdb-2.png|center|640px]]&lt;br /&gt;
&lt;br /&gt;
* move cursor to the second buffer by &amp;lt;tt&amp;gt;C-x o&amp;lt;/tt&amp;gt;, then &amp;lt;tt&amp;gt;M-x gdb&amp;lt;/tt&amp;gt;, Enter&lt;br /&gt;
* type module name which you would like to debug, e.g. &amp;lt;tt&amp;gt;g.remove&amp;lt;/tt&amp;gt;, Enter&lt;br /&gt;
&lt;br /&gt;
* now you can use gdb inside GNU Emacs&lt;br /&gt;
&lt;br /&gt;
[[Image:Emacs_gdb-3.png|center|640px]]&lt;br /&gt;
&lt;br /&gt;
=== Using DDD (gdb graphical frontend) ===&lt;br /&gt;
* debugging a program inside [https://en.wikipedia.org/wiki/Ddd DDD] is rather easy (installation of ddd and gdb required), (on Debian GNU/Linux: &amp;lt;tt&amp;gt;apt-get install gdb ddd&amp;lt;/tt&amp;gt;; on Fedora: &amp;lt;tt&amp;gt;dnf install ddd&amp;lt;/tt&amp;gt;). Start debugger with GRASS command (e.g., {{cmd|v.in.ogr}}):&lt;br /&gt;
&lt;br /&gt;
 ddd v.in.ogr&lt;br /&gt;
&lt;br /&gt;
[[File:Ddd_startup.png|400px|thumb|center|ddd startup]]&lt;br /&gt;
&lt;br /&gt;
* Run (from main menu PROGRAM): &amp;quot;out=test dsn=&amp;quot;PG:dbname=postgis user=me&amp;quot; olayer=postgislayer&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:Ddd_run1.png|400px|thumb|center|ddd define arguments]]&lt;br /&gt;
&lt;br /&gt;
* run with parameters&lt;br /&gt;
* when it crashes, use the ''UP'' menu item to trace back&lt;br /&gt;
* reach the line where it crashed&lt;br /&gt;
* set a breakpoint, then run again to stop before the crash&lt;br /&gt;
&lt;br /&gt;
[[File:Ddd_run2.png|400px|thumb|center|ddd going up]]&lt;br /&gt;
&lt;br /&gt;
* right mouse button on variables permits to display them etc.&lt;br /&gt;
&lt;br /&gt;
[[File:Ddd_display_vars.png|400px|thumb|center|ddd display variables]]&lt;br /&gt;
&lt;br /&gt;
* figure out why it crashed there. This requires PATIENCE. But you will nearly save the world if you identify the problem :-)&lt;br /&gt;
&lt;br /&gt;
=== Using kdbg (gdb graphical frontend) ===&lt;br /&gt;
&lt;br /&gt;
* kdbg is not unlike DDD, but it's a KDE application.&lt;br /&gt;
* Use is similar to DDD.&lt;br /&gt;
* Start with (within GRASS):&lt;br /&gt;
 kdbg `which g.module`&lt;br /&gt;
* Fill in command line arguments with menu item Execution-&amp;gt;Arguments.&lt;br /&gt;
* Open the View-&amp;gt;Locals window.&lt;br /&gt;
* Click the Run icon (or Execution-&amp;gt;Run) and see where it breaks.&lt;br /&gt;
* Set pause-points by clicking a red stop-sign to the left of the &amp;quot;+&amp;quot; on a line of the source code. From there you can step through instructions.&lt;br /&gt;
* Explore the values of variables in the locals window.&lt;br /&gt;
* You can select an individual variable to watch with &lt;br /&gt;
  View-&amp;gt;Watched expressions&lt;br /&gt;
: Type &amp;quot;data&amp;quot; in the text box at the top to view the entire structure of some variable called &amp;quot;data&amp;quot;. If it is a structure you can then expand it and click on an interior variable. Clicking on its name makes it come up in the text box. Hit enter from the text box and it will be added to the list of watched expressions. You can edit a Y to X (then enter again) to quickly add another similarly named variable. e.g.:&lt;br /&gt;
 (data-&amp;gt;header).Ycoordinate&lt;br /&gt;
&lt;br /&gt;
== Using ldd ==&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span style=&amp;quot;border-bottom: 1px solid #000;&amp;quot;&amp;gt;Linux&amp;lt;/span&amp;gt; ''ldd'' will show the shared library dependencies for a program or library. For example:&lt;br /&gt;
&lt;br /&gt;
For a module:&lt;br /&gt;
 GRASS&amp;gt; ldd `which v.in.ogr`&lt;br /&gt;
For a library:&lt;br /&gt;
 $ ldd /usr/src/grass/grass78/dist.x86_64-pc-linux-gnu/lib/libgrass_gis.so &lt;br /&gt;
&lt;br /&gt;
The output may look like this:&lt;br /&gt;
	linux-vdso.so.1 (0x00007ffe1cf03000)&lt;br /&gt;
	libgrass_datetime.7.8.so =&amp;gt; /usr/src/grass/grass78/dist.x86_64-pc-linux-gnulib/libgrass_datetime.7.8.so (0x00007fae7a6cf000)&lt;br /&gt;
	libz.so.1 =&amp;gt; /lib64/libz.so.1 (0x00007fae7a6b5000)&lt;br /&gt;
	libzstd.so.1 =&amp;gt; /lib64/libzstd.so.1 (0x00007fae7a5df000)&lt;br /&gt;
	libm.so.6 =&amp;gt; /lib64/libm.so.6 (0x00007fae7a499000)&lt;br /&gt;
	libc.so.6 =&amp;gt; /lib64/libc.so.6 (0x00007fae7a2cf000)&lt;br /&gt;
	libpthread.so.0 =&amp;gt; /lib64/libpthread.so.0 (0x00007fae7a2ad000)&lt;br /&gt;
	/lib64/ld-linux-x86-64.so.2 (0x00007fae7a769000)&lt;br /&gt;
&lt;br /&gt;
''ldd'' is good for spotting if the right libraries are used (in the correct path etc).&lt;br /&gt;
&lt;br /&gt;
* On &amp;lt;span style=&amp;quot;border-bottom: 1px solid #000;&amp;quot;&amp;gt;Mac OS&amp;lt;/span&amp;gt; &amp;quot;otool -L `which v.in.ogr`&amp;quot; almost does the same job.&lt;br /&gt;
&lt;br /&gt;
* For &amp;lt;span style=&amp;quot;border-bottom: 1px solid #000;&amp;quot;&amp;gt;MS Windows&amp;lt;/span&amp;gt; the [https://www.dependencywalker.com/ Dependency Walker] program (depends.exe) might help.&lt;br /&gt;
&lt;br /&gt;
=== Library search path ===&lt;br /&gt;
&lt;br /&gt;
If a support library like libgdal can't be found, and you are sure it is installed, make sure the library search path is set correctly.&lt;br /&gt;
For example in Linux if GDAL was installed to &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt;, add the line &amp;quot;&amp;lt;tt&amp;gt;/usr/local/lib&amp;lt;/tt&amp;gt;&amp;quot; to the /etc/ld.so.conf file, and as root run &amp;lt;tt&amp;gt;ldconfig&amp;lt;/tt&amp;gt; to rebuild the library links and cache.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can add the library path to the $LD_LIBRARY_PATH environmental variable.&lt;br /&gt;
&lt;br /&gt;
* [https://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html Read more about how shared libraries work on Linux]&lt;br /&gt;
&lt;br /&gt;
== Using nm and objdump ==&lt;br /&gt;
&lt;br /&gt;
''nm'' will show a list symbols contained in a library or a program. Use this if you want to check which functions it calls. It will not work if the binary has been stripped.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 GRASS&amp;gt; nm $GISBASE/lib/libgrass_gis.so&lt;br /&gt;
 GRASS&amp;gt; nm `which r.digit`&lt;br /&gt;
&lt;br /&gt;
If the binaries have been stripped you can still use the -D option to show dynamic symbols instead of normal symbols:&lt;br /&gt;
 $ nm -D /bin/ls&lt;br /&gt;
&lt;br /&gt;
* see also the {{src|tools/sql.sh}} script in the GRASS souce code, which will run &amp;quot;nm&amp;quot; on every object file, library and executable to find dependencies. The result is stored in a PostgreSQL database.&lt;br /&gt;
&lt;br /&gt;
''objdump'' will work even if the binaries have been stripped.&lt;br /&gt;
For example:&lt;br /&gt;
 $ objdump -T /usr/lib/libX11.so&lt;br /&gt;
 $ objdump -R /usr/lib/libX11.so&lt;br /&gt;
&lt;br /&gt;
== Using LD_DEBUG ==&lt;br /&gt;
&lt;br /&gt;
To see in which order the various libraries are called, run the command with &amp;lt;tt&amp;gt;LD_DEBUG=files&amp;lt;/tt&amp;gt;.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 LD_DEBUG=files r.info elevation&lt;br /&gt;
&lt;br /&gt;
== Using strace ==&lt;br /&gt;
&lt;br /&gt;
Running the command through strace could give you another hint what is going wrong somewhere. It shows the command execution at low level.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 strace v.in.ogr out=your_map dsn=&amp;quot;PG:dbname=postgis user=me&amp;quot; olayer=postgislayer&lt;br /&gt;
&lt;br /&gt;
== Using Valgrind ==&lt;br /&gt;
&lt;br /&gt;
* [https://valgrind.org Valgrind] is a tool to check for memory leaks and memory errors.&lt;br /&gt;
&lt;br /&gt;
;Examples&lt;br /&gt;
&lt;br /&gt;
* analysis of ''heap usage''&lt;br /&gt;
 CMD=&amp;quot;v.in.ascii -zt z=3 in=lidaratm2_250k.txt out=lidaratm2_250k fs=,&amp;quot;&lt;br /&gt;
 valgrind --tool=massif $CMD --o&lt;br /&gt;
&lt;br /&gt;
* analysis of ''memory leaks'' (include &amp;lt;code&amp;gt;--trace-children=yes&amp;lt;/code&amp;gt; to profile e.g. the DBF driver or other children)&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Quick addrcheck tool:&lt;br /&gt;
: (''note: addrcheck is removed in newer versions of Valgrind. Use the full memcheck tool instead'')&lt;br /&gt;
 valgrind -v --tool=addrcheck --leak-check=yes  $CMD&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
** Full memcheck tool, including non-orphaned, but left over, allocated memory:&lt;br /&gt;
 valgrind --tool=memcheck --leak-check=yes --show-reachable=yes  $CMD --o&lt;br /&gt;
&lt;br /&gt;
;Notes&lt;br /&gt;
&lt;br /&gt;
* The default is to send Valgrind output to stderr. Add &amp;lt;code&amp;gt;--log-file=&amp;lt;filename&amp;gt;&amp;lt;/code&amp;gt; to save output to a file, but note (if it matters) that you will lose any interleaved GRASS debug messages from the log that way. &lt;br /&gt;
&lt;br /&gt;
* Valgrind can create PostScript output charts. To convert PostScript to PNG:&lt;br /&gt;
: ('pstoimg' is part of the latex2html Debian package)&lt;br /&gt;
&lt;br /&gt;
* If you get something like this (huge value for &amp;quot;still reachable&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; ==13217== LEAK SUMMARY:&lt;br /&gt;
&amp;gt; ==13217==    definitely lost: 964 bytes in 39 blocks&lt;br /&gt;
&amp;gt; ==13217==    indirectly lost: 72 bytes in 10 blocks&lt;br /&gt;
&amp;gt; ==13217==      possibly lost: 79 bytes in 4 blocks&lt;br /&gt;
&amp;gt; ==13217==    still reachable: 9,025,026,330 bytes in 188,201,312 blocks&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
then please run valgrind again with &amp;lt;tt&amp;gt;--show-reachable=yes&amp;lt;/tt&amp;gt; as you will want to find out where these 9,025,026,330 bytes (in this example) have been allocated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 pstoimg -aaliastext -flip r90 -out massif.550.png -scale 1.3 -crop a massif.550.ps&lt;br /&gt;
&lt;br /&gt;
* '''Graphical user interfaces''': &lt;br /&gt;
** https://kcachegrind.github.io/html/Home.html&lt;br /&gt;
** https://invent.kde.org/sdk/massif-visualizer&lt;br /&gt;
** https://wiki.gnome.org/Attic/MassifG&lt;br /&gt;
&lt;br /&gt;
== Using Electric Fence ==&lt;br /&gt;
&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Electric_Fence Electric Fence] checks for bad memory writes, ie specific malloc() over-runs and under-runs.&lt;br /&gt;
&lt;br /&gt;
('''''Insert howto here''''')&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 CMD=&amp;quot;gdalwarp -tps -srcnodata 255 -dstnodata 255 \&lt;br /&gt;
        -of GTiff -rcs ${TMP}.tif ${OUTFILE}_warp&amp;quot;&lt;br /&gt;
 LD_PRELOAD=libefence.so.0.0 $CMD&lt;br /&gt;
&lt;br /&gt;
== Using a profiling tool ==&lt;br /&gt;
&lt;br /&gt;
A profiling tool may be used to identify the bottlenecks in long running processes.&lt;br /&gt;
&lt;br /&gt;
=== Kcachegrind === &lt;br /&gt;
&lt;br /&gt;
[https://kcachegrind.github.io/html/Home.html kcachegrind] is a visualization tool for [https://valgrind.org Valgrind]'s callgrind profiling tool (formerly known as the calltree skin). It is very simple to use. Install the GraphViz package as well.&lt;br /&gt;
&lt;br /&gt;
* The [https://valgrind.org/docs/manual/cl-manual.html callgrind chapter] in the Valgrind user manual&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 # Spearfish dataset&lt;br /&gt;
 g.region raster=elevation.dem&lt;br /&gt;
 v.random n=10000 out=rand10k&lt;br /&gt;
 v.db.addtable rand10k column=&amp;quot;elev INT&amp;quot;&lt;br /&gt;
 CMD=&amp;quot;v.what.rast rand10k rast=elevation.dem column=elev&amp;quot;&lt;br /&gt;
 valgrind --tool=callgrind --trace-children=yes $CMD&lt;br /&gt;
&lt;br /&gt;
This creates a file containing profiling information which kcachegrind can load. We include &amp;lt;code&amp;gt;--trace-children&amp;lt;/code&amp;gt; in the above example so we can profile the DBF driver process as well as the main {{cmd|v.what.rast}} process.&lt;br /&gt;
&lt;br /&gt;
 kcachegrind callgrind.out.12345&lt;br /&gt;
&lt;br /&gt;
In the above example from the two process costs we can see that 99.5% is taken by the dbf process and 0.5% is taken by the v.what.rast process. Within the dbf process almost 50% is taken by &amp;lt;tt&amp;gt;G_debug()&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;G_strcasecmp()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gprof ===&lt;br /&gt;
&lt;br /&gt;
* [https://sourceware.org/binutils/docs/gprof/ GNU gprof] user guide&lt;br /&gt;
* [http://linuxgazette.net/100/vinayak.html Profiling programs using gprof] - article from the Linux Gazzette, March 2004 (#100)&lt;br /&gt;
&lt;br /&gt;
Compile GRASS with &amp;lt;code&amp;gt;-pg&amp;lt;/code&amp;gt; flag. E.g.&lt;br /&gt;
&lt;br /&gt;
 CFLAGS='-pg' CXXFLAGS='-pg' LDFLAGS='-pg' ./configure --disable-shared&lt;br /&gt;
&lt;br /&gt;
; Example&lt;br /&gt;
&lt;br /&gt;
Run the module&lt;br /&gt;
&lt;br /&gt;
 v.select -tg ain=geodetic_swwake_pts bin=urbanarea out=x ope=overlap --o&lt;br /&gt;
&lt;br /&gt;
Use gprof to generate human readable output&lt;br /&gt;
&lt;br /&gt;
 gprof ../../dist.i686-pc-linux-gnu/bin/v.select gmon.out &amp;gt; profile.txt&lt;br /&gt;
&lt;br /&gt;
== Using Mudflap ==&lt;br /&gt;
&lt;br /&gt;
GCC built in feature, that &amp;quot;instruments all risky pointer/array dereferencing operations, some standard library string/heap functions, and some other associated constructs with range/validity tests. Modules so instrumented should be immune to buffer overflows, invalid heap use, and some other classes of C/C++ programming errors. The instrumentation relies on a separate runtime library (libmudflap), which will be linked into a program if -fmudflap -lmudflap is given at link time.&amp;quot; [http://gcc.gnu.org/wiki/Mudflap_Pointer_Debugging GCC Wiki]&lt;br /&gt;
&lt;br /&gt;
* Requires GCC with mudflap support (GCC 4.x with mudflap USE flag on Gentoo, separate library &amp;quot;libmudflap*&amp;quot; in other distros);&lt;br /&gt;
* Add -fmudflap and -lmudflap options ('''''Is this correct way? It works...'''''):&lt;br /&gt;
** in include/Make/Platform.make add -lmudflap to LD_SEARCH_FLAGS;&lt;br /&gt;
** in include/Make/Platform.make add -fmudflap to CFLAGS1;&lt;br /&gt;
* Disable mudflap during compilation&lt;br /&gt;
 export MUDFLAP_OPTIONS='-mode-nop -viol-nop'&lt;br /&gt;
* Compile GRASS (&amp;lt;tt&amp;gt;make clean &amp;amp;&amp;amp; make&amp;lt;/tt&amp;gt;). For best results use NO optimisations for compilation (&amp;lt;tt&amp;gt;-O0&amp;lt;/tt&amp;gt;);&lt;br /&gt;
* Use GRASS.&lt;br /&gt;
** To disable warnings&lt;br /&gt;
*:&amp;lt;pre&amp;gt;export MUDFLAP_OPTIONS='-mode-nop -viol-nop'&amp;lt;/pre&amp;gt;&lt;br /&gt;
** To enable warnings&lt;br /&gt;
*:&amp;lt;pre&amp;gt;export MUDFLAP_OPTIONS='-mode-check -viol-nop -check-initialization'&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More information about debugging with mudflap, can be found [http://gcc.fyxm.net/summit/2003/mudflap.pdf here].&lt;br /&gt;
&lt;br /&gt;
== Skimming the ChangeLog for changes ==&lt;br /&gt;
&lt;br /&gt;
* use the tool {{src|tools/gitlog2changelog.py}} for generating a local changelog-file, by simply running:&lt;br /&gt;
** make changelog&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- abandoned years ago&lt;br /&gt;
== Tcl/Tk debugging ==&lt;br /&gt;
&lt;br /&gt;
* Place the following in a script to print the value of a variable to the terminal:&lt;br /&gt;
 puts &amp;quot;the value of foo is '$foo'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Pure Tcl code:&lt;br /&gt;
: Typically you need to add &amp;quot;trace&amp;quot; commands to the code in question.&lt;br /&gt;
* To debug  TCL code which uses C (including hybrid C+Tcl code, e.g. NVIZ, v.digit, run (example):&lt;br /&gt;
&lt;br /&gt;
   GRASS:~&amp;gt; g.gisenv set=&amp;quot;DEBUG=1&amp;quot;&lt;br /&gt;
   GRASS:~&amp;gt; d.text.freetype &amp;gt; dtf_tcl.txt&lt;br /&gt;
&lt;br /&gt;
then edit 'dtf_tcl.txt'  to remove the &amp;quot;| wish &amp;amp;&amp;quot; from the end.&lt;br /&gt;
&lt;br /&gt;
then '. dtf_tcl.txt &amp;gt; dtf.tcl' to get rid of the echo-proofing chars.&lt;br /&gt;
&lt;br /&gt;
then 'wish &amp;lt; dtf.tcl'  to test it.&lt;br /&gt;
&lt;br /&gt;
* References:&lt;br /&gt;
** &amp;quot;Is white space significant in Tcl&amp;quot;  http://wiki.tcl.tk/981&lt;br /&gt;
** &amp;quot;Tcl quoting hell&amp;quot;  http://wiki.tcl.tk/1726&lt;br /&gt;
** &amp;quot;1 minute intro to tcl&amp;quot;  http://www.pconline.com/~erc/tcl.htm&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Shell script debugging ==&lt;br /&gt;
&lt;br /&gt;
Add &amp;quot;-x&amp;quot; to the first line of the shell script:&lt;br /&gt;
&lt;br /&gt;
original:&lt;br /&gt;
  #!/bin/sh&lt;br /&gt;
&lt;br /&gt;
change to:&lt;br /&gt;
  #!/bin/sh -x&lt;br /&gt;
&lt;br /&gt;
alternatively add `set -x` to somewhere near the start of the script.&lt;br /&gt;
&lt;br /&gt;
Find the script file to edit with&lt;br /&gt;
  which script&lt;br /&gt;
&lt;br /&gt;
== Python script debugging ==&lt;br /&gt;
&lt;br /&gt;
=== Python debugging with pdb ===&lt;br /&gt;
&lt;br /&gt;
See also:&lt;br /&gt;
* pdb Background: https://docs.python.org/3/library/pdb.html&lt;br /&gt;
* pdb Tutorial: https://fedoramagazine.org/getting-started-python-debugger/&lt;br /&gt;
&lt;br /&gt;
1. Edit the GRASS python script and add this line to the import section:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import pdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. Edit and add this line within the code where to debug:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
pdb.set_trace()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Run the python script normally, it will stop where pdb.set_trace() was added:&lt;br /&gt;
r.unpack x60030_2000.green.histo2000_g.pack&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
GRASS 7.8 (patUTM32):~ &amp;gt; r.unpack x60030_2000.green.histo2000_g.pack&lt;br /&gt;
&amp;gt; /home/neteler/software/grass78/dist.x86_64-unknown-linux-gnu/scripts/r.unpack(93)main()&lt;br /&gt;
-&amp;gt; diff_result_1 = diff_result_2 = None&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Now you can either (s)tep through or (n)ext or (r)run the rest (c: continue, q: quit)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
(Pdb) s&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While &amp;quot;s&amp;quot; will decend in functions, &amp;quot;n&amp;quot; will go to the next line. See the manual for [https://docs.python.org/2/library/pdb.html#debugger-commands Debugger Commands]&lt;br /&gt;
&lt;br /&gt;
4. To print the content of variables:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
(Pdb) s&lt;br /&gt;
&amp;gt; /usr/lib64/python3.8/posixpath.py(73)join()&lt;br /&gt;
-&amp;gt; path = a&lt;br /&gt;
(Pdb) a&lt;br /&gt;
a = /grassdata/patUTM32/hist_matching&lt;br /&gt;
p = ('..', 'PERMANENT', 'PROJ_INFO')&lt;br /&gt;
(Pdb)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now will likely be able to better find the issues in your Python script.&lt;br /&gt;
&lt;br /&gt;
See also: https://docs.python.org/3/library/pdb.html&lt;br /&gt;
&lt;br /&gt;
=== wxPython GUI debugging ===&lt;br /&gt;
&lt;br /&gt;
'''A) Debug messages:'''&lt;br /&gt;
&lt;br /&gt;
[[wxGUI]] prints debugging messages in five levels (1-5). To redirect these messages to the terminal, run&lt;br /&gt;
&lt;br /&gt;
* in GRASS 7.x&lt;br /&gt;
&lt;br /&gt;
 g.gisenv set=WX_DEBUG=1&lt;br /&gt;
&lt;br /&gt;
'''B) Using a debugger:'''&lt;br /&gt;
&lt;br /&gt;
For real debugging of wxgui.py ([https://github.com/OSGeo/grass/blob/master/general/g.gui/main.c source code]) with gdb or other tools, so you can use something like:&lt;br /&gt;
&lt;br /&gt;
 cd grass/src&lt;br /&gt;
 python gui/wxpython/wxgui.py&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
 python $GISBASE/gui/wxpython/wxgui.py&lt;br /&gt;
&lt;br /&gt;
or with gdb e.g.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# GRASS GIS session terminal&lt;br /&gt;
d.mon start=wx0&lt;br /&gt;
&lt;br /&gt;
# Examine running wxGUI components by htop program and get pid&lt;br /&gt;
# Run in another terminal or in terminal tab&lt;br /&gt;
gdb --pid $(pgrep -f /gui/wxpython/mapdisp/main.py)&lt;br /&gt;
continue&lt;br /&gt;
&lt;br /&gt;
# And then interact with the wxGUI component (d.mon)&lt;br /&gt;
# If wxGUI component crash then you get backtrace with gdb bt command&lt;br /&gt;
bt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Well, but that's just how to run the Python code directly.&lt;br /&gt;
&lt;br /&gt;
=== Python debugging with gdb ===&lt;br /&gt;
&lt;br /&gt;
See https://wiki.python.org/moin/DebuggingWithGdb&lt;br /&gt;
&lt;br /&gt;
===  Komodo dbgp.client.brk() ===&lt;br /&gt;
&lt;br /&gt;
* See http://docs.activestate.com/komodo/5.0/debugpython.html&lt;br /&gt;
 from dbgp.client import brk&lt;br /&gt;
&lt;br /&gt;
=== Profiling python scripts ===&lt;br /&gt;
&lt;br /&gt;
* See https://docs.python.org/library/profile.html&lt;br /&gt;
&lt;br /&gt;
== PROJ debugging ==&lt;br /&gt;
&lt;br /&gt;
See also: https://proj.org/usage/environmentvars.html?highlight=debugging&lt;br /&gt;
&lt;br /&gt;
For unix with a style shell use export:&lt;br /&gt;
 export PROJ_DEBUG=5&lt;br /&gt;
 cs2cs ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>⚠️Tmszi</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=ISO/INSPIRE_Metadata_Support&amp;diff=26354</id>
		<title>ISO/INSPIRE Metadata Support</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=ISO/INSPIRE_Metadata_Support&amp;diff=26354"/>
		<updated>2020-09-30T03:48:35Z</updated>

		<summary type="html">&lt;p&gt;⚠️Tmszi: Update Gentoo, Ubuntu GNU/Linux distribution py libs dependencies&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== ISO 19115:2003- Geographic information -- Metadata ==&lt;br /&gt;
[http://www.iso.org/iso/catalogue_detail.htm?csnumber=26020 ISO 19115:2003] defines the scheme required for description of geographic information and services. It provides information about the identification, the extent, the quality, the spatial and temporal scheme, spatial reference, and distribution of digital geographic data.&lt;br /&gt;
&lt;br /&gt;
== Catalogue Service for the Web ==&lt;br /&gt;
[http://www.opengeospatial.org/standards/cat OGC Catalogue Services] support the ability to publish and search collections of descriptive information (metadata) for data, services, and related information objects. Metadata in catalogues represent resource characteristics that can be queried and presented for evaluation and further processing by both humans and software. Catalogue services are required to support the discovery and binding to registered information resources within an information community. &lt;br /&gt;
&lt;br /&gt;
= About =&lt;br /&gt;
Wx.metadata which was developed during Google Summer of Code 2014/2015 is currently available in GRASS 7 add-ons: https://github.com/OSGeo/grass-addons/tree/master/grass7/gui/wxpython/wx.metadata&lt;br /&gt;
* The package for creating and editing metadata according to EN ISO 19115, described here, consists of few modules. The modules {{AddonCmd|r.info.iso}}, {{AddonCmd|v.info.iso}} and {{AddonCmd|t.info.iso}} are command line based and support the conversion from the current native metadata management ({{cmd|r.info}}, {{cmd|v.info}}, {{cmd|t.info}}) into ISO based metadata. The GUI based module - {{AddonCmd|g.gui.metadata}} - offers advanced tools for management of metadata. &lt;br /&gt;
&lt;br /&gt;
[[Image:Wxmetadata-editing.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
* The package also includes the module {{AddonCmd|g.gui.cswbrowser}} for searching and browsing metadata catalog (csw). For advanced users there are a few modules for establishing and handling pycsw server:&lt;br /&gt;
 * {{AddonCmd|db.csw.admin}} - module for administration of pycsw server&lt;br /&gt;
 * {{AddonCmd|db.csw.run}} - module for starting server on localhost&lt;br /&gt;
 * {{AddonCmd|db.csw.harvest}} - module for harvesting metadata between two CSW.&lt;br /&gt;
&lt;br /&gt;
= Requirements and installation =&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
'''Fedora Linux + Centos:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# install dependencies&lt;br /&gt;
pip3 install jinja2 lxml owslib pycsw pyexcel_ods3 pygments reportlab sqlalchemy validators&lt;br /&gt;
&lt;br /&gt;
# verify dependencies&lt;br /&gt;
wget https://raw.githubusercontent.com/OSGeo/grass-addons/master/grass7/gui/wxpython/wx.metadata/mdlib/dependency.py&lt;br /&gt;
python3 dependency.py&lt;br /&gt;
rm -f dependency.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Gentoo GNU/Linux:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo emerge -av dev-python/jinja dev-python/lxml dev-python/owslib dev-python/pygments dev-python/reportlab dev-python/sqlalchemy&lt;br /&gt;
pip install --user pycsw pyexcel_ods3 validators&lt;br /&gt;
&lt;br /&gt;
# verify dependencies&lt;br /&gt;
wget https://raw.githubusercontent.com/OSGeo/grass-addons/master/grass7/gui/wxpython/wx.metadata/mdlib/dependency.py&lt;br /&gt;
python3 dependency.py&lt;br /&gt;
rm -f dependency.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 20.04 LTS Focal Fossa GNU/Linux:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install python3-jinja2 python3-lxml python3-owslib python3-pycsw python3-pygments python3-reportlab python3-sqlalchemy&lt;br /&gt;
pip3 install --user pyexcel_ods3 validators&lt;br /&gt;
&lt;br /&gt;
# verify dependencies&lt;br /&gt;
wget https://raw.githubusercontent.com/OSGeo/grass-addons/master/grass7/gui/wxpython/wx.metadata/mdlib/dependency.py&lt;br /&gt;
python3 dependency.py&lt;br /&gt;
rm -f dependency.py&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Dependencies, from source code:'''&lt;br /&gt;
* Of course, have [https://grass.osgeo.org/download/ GRASS GIS 7.x]&lt;br /&gt;
&lt;br /&gt;
wx.metadata package has several dependencies on external libraries:&lt;br /&gt;
&lt;br /&gt;
* [https://pycsw.org/ pycsw] package - development version(OGC CSW server implementation written in Python):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/geopython/pycsw.git &amp;amp;&amp;amp; cd pycsw&lt;br /&gt;
sudo pip install -e . &amp;amp;&amp;amp; sudo pip install -r requirements-standalone.txt &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://geopython.github.io/OWSLib/ OWSLib] package - development version (OGC CSW client implementation written in Python):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone git://github.com/geopython/OWSLib.git&lt;br /&gt;
cd OWSLib &amp;amp;&amp;amp; sudo python setup.py install &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://jinja.pocoo.org/docs/dev/ Jinja2] (one of the most used template engines for Python)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/mitsuhiko/jinja2.git&lt;br /&gt;
cd jinja2 &amp;amp;&amp;amp; sudo python setup.py install &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://pygments.org/ Pygments] for highlighting text(for Ubuntu below)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install python-pygments&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Additionally, python-reportlab is required. The name of the package could vary for your distro.&lt;br /&gt;
&lt;br /&gt;
== Addon installation ==&lt;br /&gt;
&lt;br /&gt;
To install the addon, run in a GRASS GIS session: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.extension wx.metadata&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Creating and editing metadata =&lt;br /&gt;
== Naming of metadata files and storage ==&lt;br /&gt;
The default location for exported metadata files is ''metadata'' directory in the map's mapset. For raster maps, the prefix derived from the current nomenclature is ''cell'', for vector maps ''vector''. File ends with .xml suffix.&lt;br /&gt;
&lt;br /&gt;
For example, the default metadata file name for vector map &amp;quot;roads&amp;quot; is ''vector_roads.xml''.&lt;br /&gt;
&lt;br /&gt;
== Metadata profile ==&lt;br /&gt;
The metadata profile defines attributes, which can be edited in this editor. The editor offers the already mentioned two profiles (Basic and [https://inspire.ec.europa.eu/index.cfm INSPIRE]). The editor also supports loading of customized profiles. See Creation of custom ISO based profile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Currently there are three build-in ISO profiles available: &amp;lt;/big&amp;gt;&lt;br /&gt;
* '''The basic profile''' is substituted from intersection between items stored in GRASS native metadata format and INSPIRE profile. The intersect (subset) includes all available GRASS metadata. Metadata which cannot be assigned to ISO based attributes are stored in metadata attribute ''sabstractact''. &lt;br /&gt;
&lt;br /&gt;
* '''The INSPIRE profile''' fulfills the [https://inspire.ec.europa.eu/index.cfm/pageid/101 criteria of INSPIRE profile]. In case if is not possible to get the values from native GRASS metadata, these are filled with text string '$NULL'. This rule is applied for both profiles.&lt;br /&gt;
&lt;br /&gt;
* '''The temporal profile''' is based on the GRASS basic profile and includes additional specific attributes for Temporal framework.&lt;br /&gt;
&lt;br /&gt;
== Modules r.info.iso, v.info.iso t.info.iso ==&lt;br /&gt;
Command line based modules implements  conversion of native GRASS metadata to ISO based XML metadata files. Identical configuration applies for both modules. Products of these modules differ partly in certain metadata attributes related  to differences between  raster ({{cmd|r.info}}) and vector ({{cmd|v.info}}) maps metadata. &lt;br /&gt;
&lt;br /&gt;
'''Parameters of modules:'''&lt;br /&gt;
* map - selection of map for metadata creation&lt;br /&gt;
* profile - selection of metadata profile (basic or inspire)&lt;br /&gt;
* output - path to output XML metadata file.  Default = according to naming &amp;amp; storage rules&lt;br /&gt;
	&lt;br /&gt;
== Metadata editor: g.gui.metadata  ==&lt;br /&gt;
The metadata editor ([https://github.com/OSGeo/grass-addons/blob/master/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.html addon on GitHub]) includes a graphical interface for converting metadata from {{cmd|r.info}} and {{cmd|v.info}} to ISO based metadata, editing metadata files and creating metadata templates. In addition, the graphical module allows validating of INSPIRE and Basic profile.&lt;br /&gt;
&lt;br /&gt;
=== Information about metadata item ===&lt;br /&gt;
Tooltip function helps to fill in the form correctly.&lt;br /&gt;
[[Image:Wxmetadata-tooltip.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
=== Creation of metadata ===&lt;br /&gt;
The editor offers two editing modes. The first one allows to create metadata from selected GRASS maps from an active location. The second one allows editing of external metadata file. &lt;br /&gt;
&lt;br /&gt;
=== Fetching values from database backend ===&lt;br /&gt;
The editor automatically fetches keywords from SQLite GRASS GIS backend. Three well know dictionaries are added by default. The user can manually add dictionaries by SQL commands. &lt;br /&gt;
Dictionaries are stored in the table ''metadata_themes''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ table metadata_themes&lt;br /&gt;
! Attribute&lt;br /&gt;
| title&lt;br /&gt;
| keyword&lt;br /&gt;
| date_iso&lt;br /&gt;
| date_type&lt;br /&gt;
|-&lt;br /&gt;
! Date type&lt;br /&gt;
| TEXT || TEXT|| TEXT|| TEXT&lt;br /&gt;
|-&lt;br /&gt;
! Example&lt;br /&gt;
|Example || GEMET - Concepts, version || 2010-01-13 || publication&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Image:Keywords.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
=== Exporting metadata reports to format PDF ===&lt;br /&gt;
This function allows to export metadata of GRASS maps to report in PDF format. The report template is based on INSPIRE profile. Unknown values of metadata attributes are filled by text $UNKNOWN.&lt;br /&gt;
[[Image:Pdfexp.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
{{YouTube|V7tgOOuRyuA}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GRASS metadata map editor ===&lt;br /&gt;
[[Image:Wxmetadata-mapEdit.png|center|150px]]&lt;br /&gt;
&lt;br /&gt;
Combo box for selection of ISO profile:&lt;br /&gt;
* basic&lt;br /&gt;
* inspire&lt;br /&gt;
* load custom –  allows to load metadata profile from file. For example in case of using predefined template. The intersection of GRASS Basic profile (all available metadata for selected map) and loaded custom profile will proceed with this selection.&lt;br /&gt;
&lt;br /&gt;
{{YouTube|7V5NyVdO05o}}&lt;br /&gt;
&lt;br /&gt;
=== External metadata editor ===&lt;br /&gt;
[[Image:Wxmetadata-externalEdit.png|center|150]]&lt;br /&gt;
This editor mode allows to load own template and xml file for editing. This option does not support any connection with GRASS maps metadata.&lt;br /&gt;
&lt;br /&gt;
{{YouTube|npMAavbwfi0}}&lt;br /&gt;
&lt;br /&gt;
=== Defining templates ===&lt;br /&gt;
This function allows to create pattern of metadata profile. In other words it support defining fixed values to template. With using created template, the editor does not initialize texts inputs of defined values. These attributes is able to see only in Tree Browser in editor. Direct link on this function is multiple editing mode (see below).&lt;br /&gt;
* If check-box of metadata attribute is checked, the OWSLib object in template will be replaced by value. Unchecked attributes will not change this 'part' of the template.&lt;br /&gt;
* The yellow background of text fields indicates metadata attributes, which are not possible get from GRASS map information.&lt;br /&gt;
[[Image:Wxmetadata-template.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* If the check-box of metadata attribute is checked, the OWSLib object in template will be replaced by value. Unchecked attributes will not change this 'part' of the template.&lt;br /&gt;
&lt;br /&gt;
example: Template result of attribute which is checked &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:dateStamp&amp;gt;&lt;br /&gt;
        &amp;lt;gco:Date&amp;gt;2013-01-01&amp;lt;/gco:Date&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:dateStamp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: Template result of attribute which is unchecked &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:dateStamp&amp;gt;&lt;br /&gt;
        &amp;lt;gco:Date&amp;gt;{{ md.datestamp }}{# tag=&amp;quot;md.datestamp&amp;quot; , name=&amp;quot;Metadata date&amp;quot; ,\&lt;br /&gt;
 ref= &amp;quot;Part B 10.2&amp;quot; , desc= &amp;quot;Date that the metadata was created.&amp;quot;,type = &amp;quot;date&amp;quot; ,&lt;br /&gt;
 example = &amp;quot;2005-03-27&amp;quot; , multi= 0 , group= &amp;quot;Metadata&amp;quot; , multiline= False #}&amp;lt;/gco:Date&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:dateStamp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video shows record of simple practice of defining custom template&lt;br /&gt;
{{YouTube|Pu2sQoAJXfo}}&lt;br /&gt;
&lt;br /&gt;
=== Editing metadata of multiple map selection ===&lt;br /&gt;
The advantages of this editing mode is in work using of defined template. This option can be used by selection of multiple maps in data catalog.  &lt;br /&gt;
&lt;br /&gt;
=== Validation of metadata profile ===&lt;br /&gt;
On the right side of editor is a validator of metadata. Currently, validator is able to validate two build-in profiles. For selection of profile “Load custom” is set by default the inspire profile.&lt;br /&gt;
&lt;br /&gt;
=== Updating GRASS native metadata ===&lt;br /&gt;
The {{AddonCmd|g.gui.metadata}} module allows updating native GRASS metadata with using modules {{cmd|r.support}} and {{cmd|v.support}}. The intersection between ISO based metadata and r|v.support is limited by available parameters for these modules.&lt;br /&gt;
&lt;br /&gt;
=== Publishing to csw server ===&lt;br /&gt;
Editor allows direct publishing of edited metadata by CSW(Catalog Service for Web) standard to remote catalogue server. Note that the remote catalogue must allows transaction.&lt;br /&gt;
[[File:Csw publisher.png|650px|center|publishing of metadata directly to remote csw server]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* EPSG code must by added in url format. Information of projection is added only if EPSG code is known or if GDAL function for identifying from WKT is successful.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gmd:referenceSystemInfo&amp;gt;&lt;br /&gt;
  &amp;lt;gmd:MD_ReferenceSystem&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:referenceSystemIdentifier&amp;gt;&lt;br /&gt;
      &amp;lt;gmd:RS_Identifier&amp;gt;&lt;br /&gt;
        &amp;lt;gmd:code&amp;gt;&lt;br /&gt;
          &amp;lt;gco:CharacterString&amp;gt;http://www.opengis.net/def/crs/EPSG/0/3035&amp;lt;/gco:CharacterString&amp;gt;&lt;br /&gt;
        &amp;lt;/gmd:code&amp;gt;&lt;br /&gt;
        &amp;lt;gmd:codeSpace&amp;gt;&lt;br /&gt;
          &amp;lt;gco:CharacterString&amp;gt;INSPIRE RS registry&amp;lt;/gco:CharacterString&amp;gt;&lt;br /&gt;
        &amp;lt;/gmd:codeSpace&amp;gt;&lt;br /&gt;
      &amp;lt;/gmd:RS_Identifier&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:referenceSystemIdentifier&amp;gt;&lt;br /&gt;
  &amp;lt;/gmd:MD_ReferenceSystem&amp;gt;&lt;br /&gt;
&amp;lt;/gmd:referenceSystemInfo&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Creation of custom ISO based profile =&lt;br /&gt;
Creation of own custom ISO based profile is with using Jinja template syntax and some addition rules.&lt;br /&gt;
The main item of template is composite from two braces.&lt;br /&gt;
Both of them are fully according to syntax of Jinja template. First holds information about statements of loop or condition and also simple Python object.  Second braces according to Jinja template syntax is represented by comment {# #}. In this braces additional information for generating graphical interface of editor are stored. In addition also  information about individual metadata attributes (name, example, description, multiplicity, etc) is included.&lt;br /&gt;
&lt;br /&gt;
== The first braces ==&lt;br /&gt;
Contain object of OWSLib which holds the metadata value. This values can be object which is  describing  single variable or list of variables.  Value of some attribute can be defined￹ many times (according to ISO). This attributes must be defined in block of template with starting statements and ending mark of block. Only allowed loop statement is FOR (see jinja2 manual). The XML based text of block will by duplicated according to number of items in the list.&lt;br /&gt;
&lt;br /&gt;
== Initialize of OWSLib objects ==&lt;br /&gt;
Most object are initialized in configuration of file which is stored in wx.metadat/config/init_md.txt&lt;br /&gt;
&lt;br /&gt;
example: Default configuration file for the build-in Basic and Inspire profile:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self.md.identification = MD_DataIdentification() &lt;br /&gt;
self.md.dataquality = DQ_DataQuality() &lt;br /&gt;
self.md.distribution = MD_Distribution() &lt;br /&gt;
self.md.identification.extent = EX_Extent() &lt;br /&gt;
self.md.identification.extent.boundingBox = EX_GeographicBoundingBox()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on the left side of equation is obligatory prefix 'self.md'. Postfix (name of variable) is open. On right side is OWSLib object&lt;br /&gt;
&lt;br /&gt;
== Single element ==&lt;br /&gt;
In case if the value of metadata element is  declared only once: &lt;br /&gt;
example: Identifier&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{ md.identifier }}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: Lineage&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{ md.dataquality.lineage }}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loop or Condition statements ==&lt;br /&gt;
Loops and condition are defined in by starting braces and ending braces '{%  -%}' .&lt;br /&gt;
&lt;br /&gt;
Start of block:&lt;br /&gt;
&lt;br /&gt;
example: for statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for co in md.contact -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Editor allows to use Python 'zip' function and 'len' function. Note- in Jinja syntax is Python len(length) function defined specifically.&lt;br /&gt;
&lt;br /&gt;
example: zip&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for (u,d) in zip(md.identification.uom,md.identification.distance) -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: len&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% if md.identification.denominators|length &amp;gt; 0 -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
End of block is defined by:&lt;br /&gt;
&lt;br /&gt;
example: if statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% endif -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: for statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% endfor -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The second braces ==&lt;br /&gt;
The second braces (by Jinja syntax comment) contains these parameters:&lt;br /&gt;
* tag - just copy of string from first braces&lt;br /&gt;
* object – for reading and holding metadata in python objects is used OWSLib library.&lt;br /&gt;
&lt;br /&gt;
Most of object are initialized by configuration file wx.metadata/config/init_md.txt. Some metadata attributes are necessary initialized directly in this (object) parameter. Best example is the metadata contact object(organization,email)  which can be initialized for many times.&lt;br /&gt;
&lt;br /&gt;
example: responsible party&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for co in md.contact -%}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.organization }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.email }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.role }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{% endfor -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* name – free text string describing the name of metadata item&lt;br /&gt;
* ref – free additional information. By default should be reference of ISO attributes&lt;br /&gt;
* type – data type characteristic. Input text field validator for 'email' and 'date' is implemented. &lt;br /&gt;
* desc – free text which should describe or define the characteristic of metadata item&lt;br /&gt;
* example – free text with example of the value for metadata item&lt;br /&gt;
* group- label of the notebook list(tab) in editor.&lt;br /&gt;
* inbox- label of the box which includes attributes from the block of Jinja template. All items from one block of Jinja template must be in same box(same name).&lt;br /&gt;
* multi- 0 or 1. In case 0, the item cannot be duplicated= text field widget does not contain  button for duplicating itself. Note that only OWSLib list based variables can be used with duplication button.&lt;br /&gt;
* inboxmulti- 0 or 1. In case 0, the items in box cannot be duplicated = box with items  not dispose with button for cloning self.   &lt;br /&gt;
* multiline – True = initialize text field with multilines editing. Suitable for longer texts input&lt;br /&gt;
&lt;br /&gt;
example of second braces:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{# tag=&amp;quot;md.dataquality.lineage&amp;quot; , name=&amp;quot;Lineage&amp;quot; , ref= &amp;quot;Part B 6.1&amp;quot; ,/&lt;br /&gt;
 desc= &amp;quot;General explanation of the data producers knowledge about the lineage of a dataset.&amp;quot;/&lt;br /&gt;
 ,example = &amp;quot;Product 1 scenes correspond to the path/row of the Landsat orbit..&amp;quot; ,/&lt;br /&gt;
 type =&amp;quot;string&amp;quot; , group= &amp;quot;Quality and Validity&amp;quot; ,  multiline= True #}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Syntax of Jinja template system and editor custom parser ==&lt;br /&gt;
* both of braces of one metadata element must be on same line&lt;br /&gt;
* after '{# ','{%' must be white space. Also before '#}' '-%}'&lt;br /&gt;
&lt;br /&gt;
== Examples of template ==&lt;br /&gt;
&lt;br /&gt;
This video tutorial shows practice of creation custom ISO profile.&lt;br /&gt;
{{YouTube|ahl41mFD5w0}}&lt;br /&gt;
&lt;br /&gt;
= Tools for working with metadata catalogue (csw) =&lt;br /&gt;
== Browsing and searching- g.gui.cswbrowser ==&lt;br /&gt;
Module {{AddonCmd|g.gui.cswbrowser}} (Browser) based graphical interface allows managing csw connections, setting filter and searching, browsing results and adding services to GRASS GIS.&lt;br /&gt;
&lt;br /&gt;
=== Connection manager ===&lt;br /&gt;
Connection manager allows: &lt;br /&gt;
* adding&lt;br /&gt;
* removing&lt;br /&gt;
* loading list of connections from file.&lt;br /&gt;
&lt;br /&gt;
By default the Browser is initialized by list of few well known csw providers of csw. Button &amp;quot;Service info&amp;quot; shows metadata of the service.&lt;br /&gt;
&lt;br /&gt;
User can manage connection in two ways:&lt;br /&gt;
* First one is with using hidden storage provided by [http://wxpython.org/Phoenix/docs/html/ConfigBase.html ​wx.Config]. This case is without accessing default connection file.&lt;br /&gt;
* After prompt user also can add/remove connection from default .xml file.&lt;br /&gt;
[[File:ConnectionMgr.png|center|600px|Connection manager in g.gui.cswbrowser]] &lt;br /&gt;
&lt;br /&gt;
=== Searching ===&lt;br /&gt;
Before fetching data from selected csw server is proper to set up searching filter. Searching can be restricted by:&lt;br /&gt;
* DCMI Type (Collection , Dataset , Event , Image , InteractiveResource , MovingImage , PhysicalObject , Service , Software , Sound , StillImage , Text)&lt;br /&gt;
* Area(bounding box)&lt;br /&gt;
** current GRASS GIS computation region&lt;br /&gt;
** manually &lt;br /&gt;
* Keywords&lt;br /&gt;
** basic filter allows to use basic or advance keyword filtering. In the simple case user can define single keywords or multiple keywords with button &amp;quot;+&amp;quot;. Logic operator between keywords is AND(&amp;amp;).&lt;br /&gt;
** second, advanced is based on OGC list of expressions which means that can be set filter with logic relations between keywords or sets of keywords. Dialogue for settings keywords text string is under &amp;quot;Advanced&amp;quot; check-box. Syntax of constraints is based on python list syntax. Each keywords must be in braces&lt;br /&gt;
[[File:Find1.png|center|600px|g.gui.cswbrowser, searching page]]&lt;br /&gt;
&lt;br /&gt;
==== Advanced keywords filtering ====&lt;br /&gt;
On the left panel of Browser is placed check-box named &amp;quot;Advance&amp;quot;. The keywords advanced dialogue allows to use basic bool operations.&lt;br /&gt;
&lt;br /&gt;
*OR condition&lt;br /&gt;
     a || b || c&lt;br /&gt;
     [&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;]&lt;br /&gt;
*AND condition&lt;br /&gt;
     a &amp;amp;&amp;amp; b &amp;amp;&amp;amp; c&lt;br /&gt;
     [ [&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;] ]&lt;br /&gt;
*composition&lt;br /&gt;
     (a &amp;amp;&amp;amp; b) || c || d || e&lt;br /&gt;
     [[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;],[&amp;quot;c&amp;quot;],[&amp;quot;d&amp;quot;],[&amp;quot;e&amp;quot;]] or [[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;],&amp;quot;c&amp;quot;,&amp;quot;d&amp;quot;,&amp;quot;e&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
=== Browsing results===&lt;br /&gt;
On the bottom of Browser is a controller for browsing results. The data from server are fetched by number of items per one transaction. Default is a 20 items. After selection of item in the result table, metadata of record should be displayed. Browser automatically enables buttons on the top of Browser if WMS, WCS or WFS services are available.&lt;br /&gt;
&lt;br /&gt;
=== Setting up csw server ===&lt;br /&gt;
&lt;br /&gt;
== CSW server management ==&lt;br /&gt;
wx.metadata package includes tools for establishing and handling pycsw server. Pycsw stuff consists of:&lt;br /&gt;
* {{AddonCmd|db.csw.admin}}&lt;br /&gt;
* {{AddonCmd|db.csw.run}}&lt;br /&gt;
* {{AddonCmd|db.csw.harvest}}&lt;br /&gt;
&lt;br /&gt;
For handling pycsw server can be use standard pythons scripts from pycsw install directory or mentioned three modules.&lt;br /&gt;
&lt;br /&gt;
== Installation and configuration csw server ==&lt;br /&gt;
* Installation pycsw package - development version(OGC CSW server implementation written in Python):&lt;br /&gt;
e.g.to default path taken from configure file&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /var/www/pycsw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*deploying pycsw&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone https://github.com/geopython/pycsw.git &amp;amp;&amp;amp; cd pycsw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ pip install -e . &amp;amp;&amp;amp; pip install -r requirements-standalone.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Create and adjust a configuration file:&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cp default-sample.cfg default.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* adjust parameters in ''default.cfg''&lt;br /&gt;
** '''server.home''' - path to installation directory&lt;br /&gt;
** '''repository.database''' - path to SQLite database e.g. $GISDBASE/WGS84/PERMANENT/sqlite/sqlite.db&lt;br /&gt;
** set '''server.url''' to: http://localhost:8000/&lt;br /&gt;
&lt;br /&gt;
*Setup the database(creates tables, indexes, etc.)&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ pycsw-admin.py -c load_records -f default.cfg -p /path/to/xml/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**with module db.csw.admin from GRASS GIS. Flag -s and parameter configure with path to configure file. Path to database is automatically taken from configure file.&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.admin -s configure=/var/www/html/pycsw/default.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Load records:&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pycsw-admin.py -c load_records -f default.cfg -p /path/to/xml/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**db.csw.admin module with parameter -r for load recursively&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.admin -r configure=/var/www/html/pycsw/default.cfg load_records=path/to/xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Run the server&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python csw.wsgi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**db.csw.admin module with parameter path and port&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.run path=/var/www/html/pycsw port=8000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Harvesting csw catalogue ==&lt;br /&gt;
Module {{AddonCmd|db.csw.harvest}} allows to copy data from source csw server to destination csw server.&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[GRASS Metadata Management]]&lt;br /&gt;
* [http://trac.osgeo.org/grass/wiki/GSoC/2014/MetadataForGRASS Development page 2014]&lt;br /&gt;
* [https://trac.osgeo.org/grass/wiki/GSoC/2015/ImprovedMetadata Development page 2015]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Metadata]]&lt;br /&gt;
[[Category:INSPIRE]]&lt;/div&gt;</summary>
		<author><name>⚠️Tmszi</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=ISO/INSPIRE_Metadata_Support&amp;diff=26266</id>
		<title>ISO/INSPIRE Metadata Support</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=ISO/INSPIRE_Metadata_Support&amp;diff=26266"/>
		<updated>2020-07-12T05:39:41Z</updated>

		<summary type="html">&lt;p&gt;⚠️Tmszi: Add wx.metadata add-on dependencies installation note on Gentoo, Ubuntu GNU/Linux distribution&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== ISO 19115:2003- Geographic information -- Metadata ==&lt;br /&gt;
[http://www.iso.org/iso/catalogue_detail.htm?csnumber=26020 ISO 19115:2003] defines the scheme required for description of geographic information and services. It provides information about the identification, the extent, the quality, the spatial and temporal scheme, spatial reference, and distribution of digital geographic data.&lt;br /&gt;
&lt;br /&gt;
== Catalogue Service for the Web ==&lt;br /&gt;
[http://www.opengeospatial.org/standards/cat OGC Catalogue Services] support the ability to publish and search collections of descriptive information (metadata) for data, services, and related information objects. Metadata in catalogues represent resource characteristics that can be queried and presented for evaluation and further processing by both humans and software. Catalogue services are required to support the discovery and binding to registered information resources within an information community. &lt;br /&gt;
&lt;br /&gt;
= About =&lt;br /&gt;
Wx.metadata which was developed during Google Summer of Code 2014/2015 is currently available in GRASS 7 add-ons: https://github.com/OSGeo/grass-addons/tree/master/grass7/gui/wxpython/wx.metadata&lt;br /&gt;
* The package for creating and editing metadata according to EN ISO 19115, described here, consists of few modules. The modules r.info.iso, v.info.iso and t.info.iso are command line based and support the conversion from the current native metadata management (r.info, v.info,t.info) into ISO based metadata. The GUI based module - g.gui.metadata offers advanced tools for management of metadata. &lt;br /&gt;
&lt;br /&gt;
[[Image:Wxmetadata-editing.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
* The package also includes the module g.gui.cswbrowser for searching and browsing metadata catalog (csw). For advanced users there are a few modules for establishing and handling pycsw server:&lt;br /&gt;
 * db.csw.admin - module for administration of pycsw server&lt;br /&gt;
 * db.csw.run - module for starting server on localhost&lt;br /&gt;
 * db.csw.harvest - module for harvesting metadata between two csw.&lt;br /&gt;
&lt;br /&gt;
= Requirements and installation =&lt;br /&gt;
&lt;br /&gt;
'''Fedora Linux:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo dnf install python3-sqlalchemy&lt;br /&gt;
sudo pip3 install pycsw&lt;br /&gt;
sudo pip3 install jinja2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Gentoo GNU/Linux:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo emerge -av dev-python/owslib dev-python/reportlab dev-python/sqlalchemy dev-python/jinja dev-python/lxml dev-python/pygments&lt;br /&gt;
pip install --user pycsw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 20.04 LTS Focal Fossa GNU/Linux:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install python3-owslib python3-reportlab python3-sqlalchemy python3-jinja2 python3-lxml python3-pycsw python3-pygments&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''From source code:'''&lt;br /&gt;
* [http://grass.osgeo.org/download/software/ GRASS GIS 7.x ]&lt;br /&gt;
wx.metadata package has dependence on external libraries:&lt;br /&gt;
&lt;br /&gt;
* [http://pycsw.org/ pycsw] package - development version(OGC CSW server implementation written in Python):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/geopython/pycsw.git &amp;amp;&amp;amp; cd pycsw&lt;br /&gt;
sudo pip install -e . &amp;amp;&amp;amp; sudo pip install -r requirements-standalone.txt &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://geopython.github.io/OWSLib/ OWSLib] package - development version (OGC CSW client implementation written in Python):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone git://github.com/geopython/OWSLib.git&lt;br /&gt;
cd OWSLib &amp;amp;&amp;amp; sudo python setup.py install &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [http://jinja.pocoo.org/docs/dev/ Jinja2] (one of the most used template engines for Python)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/mitsuhiko/jinja2.git&lt;br /&gt;
cd jinja2 &amp;amp;&amp;amp; sudo python setup.py install &amp;amp;&amp;amp; cd ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [http://pygments.org/ Pygments] for highlighting text(for Ubuntu below)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install python-pygments&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Additionally, python-reportlab is required. The name of the package could vary for your distro.&lt;br /&gt;
&lt;br /&gt;
To install, when in GRASS, type &lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.extension wx.metadata&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Creating and editing metadata =&lt;br /&gt;
== Naming of metadata files and storage ==&lt;br /&gt;
The default location for exported metadata files is ''metadata'' directory in the map's mapset. For raster maps, the prefix derived from the current nomenclature is ''cell'', for vector maps ''vector''. File ends with .xml suffix.&lt;br /&gt;
&lt;br /&gt;
For example, the default metadata file name for vector map &amp;quot;roads&amp;quot; is ''vector_roads.xml''.&lt;br /&gt;
&lt;br /&gt;
== Metadata profile ==&lt;br /&gt;
The metadata profile defines attributes, which can be edited in this editor. The editor offers the already mentioned two profiles (Basic and [http://inspire.ec.europa.eu/index.cfm INSPIRE]). The editor also supports loading of customized profiles. See Creation of custom ISO based profile.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Currently there are three build-in ISO profiles available: &amp;lt;/big&amp;gt;&lt;br /&gt;
* '''The basic profile''' is substituted from intersection between items stored in GRASS native metadata format and INSPIRE profile. The intersect (subset) includes all available GRASS metadata. Metadata which cannot be assigned to ISO based attributes are stored in metadata attribute sabstractact. &lt;br /&gt;
&lt;br /&gt;
* '''The INSPIRE profile''' fulfills the [http://inspire.ec.europa.eu/index.cfm/pageid/101 criteria of INSPIRE profile]. In case if is not possible to get the values from native GRASS metadata, these are filled with text string '$NULL'. This rule is applied for both profiles.&lt;br /&gt;
&lt;br /&gt;
* '''The temporal profile''' is based on the GRASS basic profile and includes additional specific attributes for Temporal framework.&lt;br /&gt;
&lt;br /&gt;
== Modules r.info.iso, v.info.iso t.info.iso ==&lt;br /&gt;
Command line based modules implements  conversion of native GRASS metadata to ISO based XML metadata files. Identical configuration applies for both modules. Products of these modules differ partly in certain metadata attributes related  to differences between  raster (r.info) and vector (v.info) maps metadata. &lt;br /&gt;
&lt;br /&gt;
'''Parameters of modules:'''&lt;br /&gt;
* map - selection of map for metadata creation&lt;br /&gt;
* profile - selection of metadata profile (basic or inspire)&lt;br /&gt;
* output - path to output XML metadata file.  Default = according to naming&amp;amp;storage rules&lt;br /&gt;
	&lt;br /&gt;
== Metadata editor: g.gui.metadata  ==&lt;br /&gt;
The metadata editor ([https://github.com/OSGeo/grass-addons/blob/master/grass7/gui/wxpython/wx.metadata/g.gui.metadata/g.gui.metadata.html addon on GitHub]) includes a graphical interface for converting metadata from r.info and v.info to ISO based metadata, editing metadata files and creating metadata templates. In addition, the graphical module allows validating of INSPIRE and Basic profile.&lt;br /&gt;
&lt;br /&gt;
=== Information about metadata item ===&lt;br /&gt;
Tooltip function helps to fill in the form correctly.&lt;br /&gt;
[[Image:Wxmetadata-tooltip.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
=== Creation of metadata ===&lt;br /&gt;
The editor offers two editing modes. The first one allows to create metadata from selected GRASS maps from an active location. The second one allows editing of external metadata file. &lt;br /&gt;
&lt;br /&gt;
=== Fetching values from database backend ===&lt;br /&gt;
The editor automatically fetches keywords from SQLite GRASS GIS backend. Three well know dictionaries are added by default. The user can manually add dictionaries by sql commands. &lt;br /&gt;
Dictionaries are stored in the table ''metadata_themes''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ teble metadta_themes&lt;br /&gt;
! Attribut&lt;br /&gt;
| title&lt;br /&gt;
| keyword&lt;br /&gt;
| date_iso&lt;br /&gt;
| date_type&lt;br /&gt;
|-&lt;br /&gt;
! Date type&lt;br /&gt;
| TEXT || TEXT|| TEXT|| TEXT&lt;br /&gt;
|-&lt;br /&gt;
! Example&lt;br /&gt;
|Example || GEMET - Concepts, version || 2010-01-13 || publication&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Image:Keywords.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
=== Exporting metadata reports to format PDF ===&lt;br /&gt;
This function allows to export metadata of GRASS maps to report in pdf format. The report template is based on INSPIRE profile. Unknown values of metadata attributes are filled by text $UNKNOWN.&lt;br /&gt;
[[Image:Pdfexp.png|center|350]]&lt;br /&gt;
&lt;br /&gt;
{{YouTube|V7tgOOuRyuA}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GRASS metadata map editor ===&lt;br /&gt;
[[Image:Wxmetadata-mapEdit.png|center|150px]]&lt;br /&gt;
&lt;br /&gt;
Combo box for selection of ISO profile:&lt;br /&gt;
* basic&lt;br /&gt;
* inspire&lt;br /&gt;
* load custom –  allows to load metadata profile from file. For example in case of using predefined template. The intersection of GRASS Basic profile(all available metadata for selected map) and loaded custom profile will proceed with this selection.&lt;br /&gt;
&lt;br /&gt;
{{YouTube|7V5NyVdO05o}}&lt;br /&gt;
&lt;br /&gt;
=== External metadata editor ===&lt;br /&gt;
[[Image:Wxmetadata-externalEdit.png|center|150]]&lt;br /&gt;
This editor mode allows to load own template and xml file for editing. This option does not support any connection with GRASS maps metadata.&lt;br /&gt;
&lt;br /&gt;
{{YouTube|npMAavbwfi0}}&lt;br /&gt;
&lt;br /&gt;
=== Defining templates ===&lt;br /&gt;
This function allows to create pattern of metadata profile. In other words it support defining fixed values to template. With using created template, the editor does not initialize texts inputs of defined values. These attributes is able to see only in Tree Browser in editor. Direct link on this function is multiple editing mode (see below).&lt;br /&gt;
* If check-box of metadata attribute is checked, the OWSLib object in template will be replaced by value. Unchecked attributes will not change this 'part' of the template.&lt;br /&gt;
* The yellow background of text fields indicates metadata attributes, which are not possible get from GRASS map information.&lt;br /&gt;
[[Image:Wxmetadata-template.png|center|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
* If the check-box of metadata attribute is checked, the OWSLib object in template will be replaced by value. Unchecked attributes will not change this 'part' of the template.&lt;br /&gt;
&lt;br /&gt;
example: Template result of attribute which is checked &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:dateStamp&amp;gt;&lt;br /&gt;
        &amp;lt;gco:Date&amp;gt;2013-01-01&amp;lt;/gco:Date&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:dateStamp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: Template result of attribute which is unchecked &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:dateStamp&amp;gt;&lt;br /&gt;
        &amp;lt;gco:Date&amp;gt;{{ md.datestamp }}{# tag=&amp;quot;md.datestamp&amp;quot; , name=&amp;quot;Metadata date&amp;quot; ,\&lt;br /&gt;
 ref= &amp;quot;Part B 10.2&amp;quot; , desc= &amp;quot;Date that the metadata was created.&amp;quot;,type = &amp;quot;date&amp;quot; ,&lt;br /&gt;
 example = &amp;quot;2005-03-27&amp;quot; , multi= 0 , group= &amp;quot;Metadata&amp;quot; , multiline= False #}&amp;lt;/gco:Date&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:dateStamp&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Video shows record of simple practice of defining custom template&lt;br /&gt;
{{YouTube|Pu2sQoAJXfo}}&lt;br /&gt;
&lt;br /&gt;
=== Editing metadata of multiple map selection ===&lt;br /&gt;
The advantages of this editing mode is in work using of defined template. This option can be used by selection of multiple maps in data catalog.  &lt;br /&gt;
&lt;br /&gt;
=== Validation of metadata profile ===&lt;br /&gt;
On the right side of editor is a validator of metadata. Currently, validator is able to validate two build-in profiles. For selection of profile “Load custom” is set by default the inspire profile.&lt;br /&gt;
&lt;br /&gt;
=== Updating GRASS native metadata ===&lt;br /&gt;
The g.gui.metadata module allows updating native GRASS metadata with using modules r.support and v.support. The intersection between ISO based metadata and r|v.support is limited by available parameters for these modules.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Publishing to csw server ===&lt;br /&gt;
Editor allows direct publishing of edited metadata by CSW(Catalog Service for Web) standard to remote catalogue server. Note that the remote catalogue must allows transaction.&lt;br /&gt;
[[File:Csw publisher.png|650px|center|publishing of metadata directly to remote csw server]]&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
* EPSG code must by added in url format. Information of projection is added only if EPSG code is known or if GDAL function for identifying from WKT is succesful.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;gmd:referenceSystemInfo&amp;gt;&lt;br /&gt;
  &amp;lt;gmd:MD_ReferenceSystem&amp;gt;&lt;br /&gt;
    &amp;lt;gmd:referenceSystemIdentifier&amp;gt;&lt;br /&gt;
      &amp;lt;gmd:RS_Identifier&amp;gt;&lt;br /&gt;
        &amp;lt;gmd:code&amp;gt;&lt;br /&gt;
          &amp;lt;gco:CharacterString&amp;gt;http://www.opengis.net/def/crs/EPSG/0/3035&amp;lt;/gco:CharacterString&amp;gt;&lt;br /&gt;
        &amp;lt;/gmd:code&amp;gt;&lt;br /&gt;
        &amp;lt;gmd:codeSpace&amp;gt;&lt;br /&gt;
          &amp;lt;gco:CharacterString&amp;gt;INSPIRE RS registry&amp;lt;/gco:CharacterString&amp;gt;&lt;br /&gt;
        &amp;lt;/gmd:codeSpace&amp;gt;&lt;br /&gt;
      &amp;lt;/gmd:RS_Identifier&amp;gt;&lt;br /&gt;
    &amp;lt;/gmd:referenceSystemIdentifier&amp;gt;&lt;br /&gt;
  &amp;lt;/gmd:MD_ReferenceSystem&amp;gt;&lt;br /&gt;
&amp;lt;/gmd:referenceSystemInfo&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Creation of custom ISO based profile =&lt;br /&gt;
Creation of own custom ISO based profile is with using  Jinja template syntax and some addition rules.&lt;br /&gt;
The main item of template is composite from two braces.&lt;br /&gt;
Both of them are fully according to syntax of Jinja template. First holds information about statements of loop or condition and also simple Python object.  Second braces according to Jinja template syntax is represented by comment {# #}. In this braces additional information for generating graphical interface of editor are stored. In addition also  information about individual metadata attributes (name, example, description, multiplicity, etc) is included.&lt;br /&gt;
&lt;br /&gt;
== The first braces ==&lt;br /&gt;
Contain object of OWSLib which holds the metadata value. This values can be object which is  describing  single variable or list of variables.  Value of some attribute can be defined￹￹ many times(according to ISO). This attributes must be defined in block of template with starting statements and ending mark of block. Only allowed loop statement is FOR(see jinja2 manual). The XML based text of block will by duplicated according to number of items in the list.&lt;br /&gt;
&lt;br /&gt;
== Initialize of OWSLib objects ==&lt;br /&gt;
Most object are initialized in configuration of file which is stored in wx.metadat/config/init_md.txt&lt;br /&gt;
example: Default configuration file for the build-in Basic and Inspire profile:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self.md.identification = MD_DataIdentification() &lt;br /&gt;
self.md.dataquality = DQ_DataQuality() &lt;br /&gt;
self.md.distribution = MD_Distribution() &lt;br /&gt;
self.md.identification.extent = EX_Extent() &lt;br /&gt;
self.md.identification.extent.boundingBox = EX_GeographicBoundingBox()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on the left side of equation is obligatory prefix 'self.md'. Postfix(name of variable) is open. On right side is  OWSLib object&lt;br /&gt;
&lt;br /&gt;
== Single element ==&lt;br /&gt;
In case if the value of metadata element is  declared only once: &lt;br /&gt;
example: Identifier&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{ md.identifier }}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: Lineage&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{ md.dataquality.lineage }}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loop or Condition statements ==&lt;br /&gt;
Loops and condition are defined in by starting braces  and ending braces '{%  -%}' .&lt;br /&gt;
Start of block:&lt;br /&gt;
&lt;br /&gt;
example: for statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for co in md.contact -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Editor allows to use Python 'zip' function and 'len' function. Note- in Jinja syntax is Python len(length) function defined specifically.&lt;br /&gt;
&lt;br /&gt;
example: zip&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for (u,d) in zip(md.identification.uom,md.identification.distance) -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: len&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% if md.identification.denominators|length &amp;gt; 0 -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
End of block is defined by:&lt;br /&gt;
&lt;br /&gt;
example: if statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% endif -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
example: for statement&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% endfor -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
== The second braces ==&lt;br /&gt;
The second braces(by Jinja syntax comment) contains these parameters:&lt;br /&gt;
* tag - just copy of string from first braces&lt;br /&gt;
* object – for reading and holding metadata in python objects is used OWSLib library.&lt;br /&gt;
&lt;br /&gt;
Most of object are initialized by configuration file wx.metadata/config/init_md.txt. Some metadata attributes are necessary initialized directly in this(object) parameter. Best example is the metadata contact object(organization,email)  which can be initialized for many times.&lt;br /&gt;
&lt;br /&gt;
example: responsible party&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{% for co in md.contact -%}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.organization }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.email }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{{ co.role }}{# object=&amp;quot;CI_ResponsibleParty()&amp;quot; #}&lt;br /&gt;
{% endfor -%}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* name – free text string describing the name of metadata item&lt;br /&gt;
* ref – free additional information. By default should be reference of ISO attributes&lt;br /&gt;
* type – data type characteristic. Input text field validator for 'email' and 'date' is implemented. &lt;br /&gt;
* desc – free text which should describe or define the characteristic of metadata item&lt;br /&gt;
* example – free text with example of the value for metadata item&lt;br /&gt;
* group- label of the notebook list(tab) in editor.&lt;br /&gt;
* inbox- label of the box which includes attributes from the block of Jinja template. All items from one block of Jinja template must be in same box(same name).&lt;br /&gt;
* multi- 0 or 1. In case 0, the item cannot be duplicated= text field widget does not contain  button for duplicating itself. Note that only OWSLib list based variables can be used with duplication button.&lt;br /&gt;
* inboxmulti- 0 or 1. In case 0, the items in box cannot be duplicated = box with items  not dispose with button for cloning self.   &lt;br /&gt;
* multiline – True = initialize text field with multilines editing. Suitable for longer texts input&lt;br /&gt;
&lt;br /&gt;
example of second braces:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{# tag=&amp;quot;md.dataquality.lineage&amp;quot; , name=&amp;quot;Lineage&amp;quot; , ref= &amp;quot;Part B 6.1&amp;quot; ,/&lt;br /&gt;
 desc= &amp;quot;General explanation of the data producers knowledge about the lineage of a dataset.&amp;quot;/&lt;br /&gt;
 ,example = &amp;quot;Product 1 scenes correspond to the path/row of the Landsat orbit..&amp;quot; ,/&lt;br /&gt;
 type =&amp;quot;string&amp;quot; , group= &amp;quot;Quality and Validity&amp;quot; ,  multiline= True #}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Syntax of Jinja template system and editor custom parser ==&lt;br /&gt;
* both of braces of one metadata element must be on same line&lt;br /&gt;
* after '{# ','{%' must be white space. Also before '#}' '-%}'&lt;br /&gt;
&lt;br /&gt;
== Examples of template ==&lt;br /&gt;
[http://trac.osgeo.org/grass/browser/grass-addons/grass7/gui/wxpython/wx.metadata/templates?order=date&amp;amp;desc=1 INSPIRE and Basic]&lt;br /&gt;
&lt;br /&gt;
Video tutorial shows practice of creation custom ISO profile.&lt;br /&gt;
{{YouTube|ahl41mFD5w0}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Tools for working with metadata catalogue (csw) =&lt;br /&gt;
== Browsing and searching- g.gui.cswbrowser ==&lt;br /&gt;
Module g.gui.cswbrowser(Browser) based graphical interface allows managing csw connections, setting filter and searching, browsing results and adding services to GRASS GIS.&lt;br /&gt;
=== Connection manager ===&lt;br /&gt;
Connection manager allows: &lt;br /&gt;
* adding&lt;br /&gt;
* removing&lt;br /&gt;
* loading list of connections from file. &lt;br /&gt;
By default the Browser is initialized by list of few well known csw providers of csw. Button &amp;quot;Service info&amp;quot; shows metadata of the service.&lt;br /&gt;
User can manage connection in two ways:&lt;br /&gt;
* First one is with using hidden storage provided by [http://wxpython.org/Phoenix/docs/html/ConfigBase.html ​wx.Config]. This case is without accessing default connection file.&lt;br /&gt;
* After prompt user also can add/remove connection from default .xml file.&lt;br /&gt;
[[File:ConnectionMgr.png|center|600px|Connection manager in g.gui.cswbrowser]] &lt;br /&gt;
&lt;br /&gt;
=== Searching ===&lt;br /&gt;
Before fetching data from selected csw server is proper to set up searching filter. Searching can be restricted by:&lt;br /&gt;
* DCMI Type (Collection , Dataset , Event , Image , InteractiveResource , MovingImage , PhysicalObject , Service , Software , Sound , StillImage , Text)&lt;br /&gt;
* Area(bounding box)&lt;br /&gt;
** current GRASS GIS computation region&lt;br /&gt;
** manually &lt;br /&gt;
* Keywords&lt;br /&gt;
** basic filter allows to use basic or advance keyword filtering. In the simple case user can define single keywords or multiple keywords with button &amp;quot;+&amp;quot;. Logic operator between keywords is AND(&amp;amp;).&lt;br /&gt;
** second, advanced is based on OGC list of expressions which means that can be set filter with logic relations between keywords or sets of keywords. Dialogue for settings keywords text string is under &amp;quot;Advanced&amp;quot; check-box. Syntax of constraints is based on python list syntax. Each keywords must be in braces&lt;br /&gt;
[[File:Find1.png|center|600px|g.gui.cswbrowser, searching page]]&lt;br /&gt;
==== Advanced keywords filtering ====&lt;br /&gt;
On the left panel of Browser is placed check-box named &amp;quot;Advance&amp;quot;. The keywords advanced dialogue allows to use basic bool operations.&lt;br /&gt;
&lt;br /&gt;
*OR condition&lt;br /&gt;
     a || b || c&lt;br /&gt;
     [&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;]&lt;br /&gt;
*AND condition&lt;br /&gt;
     a &amp;amp;&amp;amp; b &amp;amp;&amp;amp; c&lt;br /&gt;
     [ [&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;,&amp;quot;c&amp;quot;] ]&lt;br /&gt;
*composition&lt;br /&gt;
     (a &amp;amp;&amp;amp; b) || c || d || e&lt;br /&gt;
     [[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;],[&amp;quot;c&amp;quot;],[&amp;quot;d&amp;quot;],[&amp;quot;e&amp;quot;]] or [[&amp;quot;a&amp;quot;,&amp;quot;b&amp;quot;],&amp;quot;c&amp;quot;,&amp;quot;d&amp;quot;,&amp;quot;e&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
=== Browsing results===&lt;br /&gt;
On the bottom of Browser is a controller for browsing results. The data from server are fetched by number of items per one transaction. Default is a 20 items. After selection of item in the result table, metadata of record should be displayed. Browser automatically enables buttons on the top of Browser if WMS, WCS or WFS services are available.&lt;br /&gt;
&lt;br /&gt;
=== Setting up csw server ===&lt;br /&gt;
&lt;br /&gt;
== CSW server management ==&lt;br /&gt;
wx.metadata package includes tools for establishing and handling pycsw server. Pycsw stuff consist:&lt;br /&gt;
*db.csw.admin &lt;br /&gt;
*db.csw.run&lt;br /&gt;
*db.csw.harvest&lt;br /&gt;
&lt;br /&gt;
For handling pycsw server can be use standard pythons scripts from pycsw install directory or mentioned three modules.&lt;br /&gt;
&lt;br /&gt;
== Installation and configuration csw server ==&lt;br /&gt;
* Installation pycsw package - development version(OGC CSW server implementation written in Python):&lt;br /&gt;
e.g.to default path taken from configure file&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cd /var/www/pycsw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*deploying pycsw&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ git clone https://github.com/geopython/pycsw.git &amp;amp;&amp;amp; cd pycsw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ pip install -e . &amp;amp;&amp;amp; pip install -r requirements-standalone.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Create and adjust a configuration file:&lt;br /&gt;
**&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ cp default-sample.cfg default.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* adjust parameters in ''default.cfg''&lt;br /&gt;
** '''server.home''' - path to installation directory&lt;br /&gt;
** '''repository.database''' - path to SQLite database e.g. $GISDBASE/WGS84/PERMANENT/sqlite/sqlite.db&lt;br /&gt;
** set '''server.url''' to: http://localhost:8000/&lt;br /&gt;
&lt;br /&gt;
*Setup the database(creates tables, indexes, etc.)&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
$ pycsw-admin.py -c load_records -f default.cfg -p /path/to/xml/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**with module db.csw.admin from GRASS GIS. Flag -s and parameter configure with path to configure file. Path to database is automatically taken from configure file.&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.admin -s configure=/var/www/html/pycsw/default.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Load records:&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pycsw-admin.py -c load_records -f default.cfg -p /path/to/xml/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**db.csw.admin module with parameter -r for load recursively&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.admin -r configure=/var/www/html/pycsw/default.cfg load_records=path/to/xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Run the server&lt;br /&gt;
**with unix command line(in pycsw install dir)&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python csw.wsgi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
**db.csw.admin module with parameter path and port&lt;br /&gt;
***&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
db.csw.run path=/var/www/html/pycsw port=8000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Harvesting csw catalogue ==&lt;br /&gt;
Module db.csw.harvest allows to copy data from source csw server to destination csw server&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
* [[GRASS Metadata Management]]&lt;br /&gt;
* [http://trac.osgeo.org/grass/wiki/GSoC/2014/MetadataForGRASS Development page 2014]&lt;br /&gt;
* [https://trac.osgeo.org/grass/wiki/GSoC/2015/ImprovedMetadata Development page 2015]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Metadata]]&lt;br /&gt;
[[Category:INSPIRE]]&lt;/div&gt;</summary>
		<author><name>⚠️Tmszi</name></author>
	</entry>
</feed>