geopython/pygeometa

Feature Request: Import of CSV + New metadata profiles

Opened this issue · 2 comments

We're considering the potential to merge the functionality of a couple of other projects into pygeometa

Namely the ability to submit CSV files as - https://github.com/AstunTechnology/gemini_csv_import

We'd also need to add profiles for two further metadata standards (based on ISO 19139) to allow validation / creation of XML/JSON:

The ability of pygeometa to use the existing .sch files instead of writing .j2 might be worth investigating?

What are the groups thoughts?

@KoalaGeo

  • adding Gemini and MEDIN would entail putting forth the Jinja2 templates as desired
  • for working off CSV as input, the easiest approach would be to parse the CSV into a pygeometa MCF object in memory and generate the resulting metadata in your format of choice, as supported by pygeometa. We could consider a mapping of CSV columns to MCF fields, but that may be lossy given the nested nature of MCF/YAML. In addition, before long this may lead to leaky abstractions, at which point it may be just easier with a Python script that uses pygeometa as a library/package

cc @pvgenuchten @kalxas for any additional comments/suggestions

Interesting @KoalaGeo, thanx for sharing. I happened to work on a similar workflow last week at https://github.com/pvgenuchten/pyGeoDataCrawler. I use a jinja2 template approach to populate mcf with csv fields, before using pygeometa to transform it to iso19139, see https://github.com/pvgenuchten/pyGeoDataCrawler/blob/main/geodatacrawler/templates/csv.j2

Sure would be interesting to have some of this functionality as part of pygeometa, i hadn't considered it yet.
I'll give a look to your approach.