geopython / pygeometa

pygeometa is a Python package to generate metadata for geospatial datasets
https://geopython.github.io/pygeometa
Other
104 stars 44 forks source link

Add support for importing QGIS qmd files #222

Open PascalLike opened 1 year ago

PascalLike commented 1 year ago

As mentioned in this issue https://github.com/geopython/pygeometa/issues/150, it would be very useful to have pygemeta able to export to qmd files.

Ad @doublebyte suggested, it would also be useful to import qmd files.

qmd is an XML format and follows this schema. Importing it to mcf could enable the export to all current and future supported formats, including OGC API Records metadata.

If I understand correctly, the things to do should be:

tomkralidis commented 1 year ago

Makes sense @PascalLike. Looking forward to this new feature!

PascalLike commented 1 year ago

Small update: I just realized that the metadata produced from QGIS is not precisely aligned to what is indicated in the examples here. For the parsing, I will consider the real format produced by QGIS, which is something like this:

<!DOCTYPE qgis PUBLIC 'http://mrcc.com/qgis.dtd' 'SYSTEM'>
<qgis version="3.26.1-Buenos Aires">
  <identifier>222</identifier>
  <parentidentifier>111</parentidentifier>
  <language>en</language>
  <type>feature</type>
  <title>Example</title>
  <abstract>Test</abstract>
  <keywords vocabulary="gmd:topicCategory">
    <keyword>Society</keyword>
  </keywords>
  <contact>
    <contactAddress>
      <type>postal</type>
      <address>some</address>
      <city>some</city>
      <administrativearea>some</administrativearea>
      <postalcode>123</postalcode>
      <country>some</country>
    </contactAddress>
    <name>you</name>
    <organization>yourcompany</organization>
    <position>standing</position>
    <voice>345</voice>
    <fax>567</fax>
    <email>some@email.net</email>
    <role>distributor</role>
  </contact>
  <links>
    <link url="urllink" format="formatlink" size="" mimeType="mimelink" description="descriptionlink" name="namelink" type="typelink"/>
  </links>
  <history>Created</history>
  <fees>No</fees>
  <constraints type="access">N</constraints>
  <constraints type="use">N</constraints>
  <constraints type="other">N</constraints>
  <rights>1 right</rights>
  <rights>2 right</rights>
  <license>Creative Commons CC Zero</license>
  <encoding>utf-8</encoding>
  <crs>
    <spatialrefsys nativeFormat="Wkt">
      <wkt>PROJCRS["WGS 84 / Pseudo-Mercator",BASEGEOGCRS["WGS 84",ENSEMBLE["World Geodetic System 1984 ensemble",MEMBER["World Geodetic System 1984 (Transit)"],MEMBER["World Geodetic System 1984 (G730)"],MEMBER["World Geodetic System 1984 (G873)"],MEMBER["World Geodetic System 1984 (G1150)"],MEMBER["World Geodetic System 1984 (G1674)"],MEMBER["World Geodetic System 1984 (G1762)"],MEMBER["World Geodetic System 1984 (G2139)"],ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1]],ENSEMBLEACCURACY[2.0]],PRIMEM["Greenwich",0,ANGLEUNIT["degree",0.0174532925199433]],ID["EPSG",4326]],CONVERSION["Popular Visualisation Pseudo-Mercator",METHOD["Popular Visualisation Pseudo Mercator",ID["EPSG",1024]],PARAMETER["Latitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8801]],PARAMETER["Longitude of natural origin",0,ANGLEUNIT["degree",0.0174532925199433],ID["EPSG",8802]],PARAMETER["False easting",0,LENGTHUNIT["metre",1],ID["EPSG",8806]],PARAMETER["False northing",0,LENGTHUNIT["metre",1],ID["EPSG",8807]]],CS[Cartesian,2],AXIS["easting (X)",east,ORDER[1],LENGTHUNIT["metre",1]],AXIS["northing (Y)",north,ORDER[2],LENGTHUNIT["metre",1]],USAGE[SCOPE["Web mapping and visualisation."],AREA["World between 85.06°S and 85.06°N."],BBOX[-85.06,-180,85.06,180]],ID["EPSG",3857]]</wkt>
      <proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs</proj4>
      <srsid>3857</srsid>
      <srid>3857</srid>
      <authid>EPSG:3857</authid>
      <description>WGS 84 / Pseudo-Mercator</description>
      <projectionacronym>merc</projectionacronym>
      <ellipsoidacronym>EPSG:7030</ellipsoidacronym>
      <geographicflag>false</geographicflag>
    </spatialrefsys>
  </crs>
  <extent>
    <spatial dimensions="2" minx="-97648932.15680000185966492" miny="-32549644.05229999870061874" minz="0" crs="EPSG:3857" maxz="0" maxy="32549644.05229999870061874" maxx="97648932.15680000185966492"/>
    <temporal>
      <period>
        <start>2023-03-31T22:00:00Z</start>
        <end>2023-04-14T22:00:00Z</end>
      </period>
    </temporal>
  </extent>
</qgis>