MarcEdit 7/3: Extracting MARC data into KML files

I had a question posed to me the other day asking how someone might go about moving cartographic data found in MARC records into formats that might be usable by GIS systems.  Essentially, how could you get the position data found in records and put in a format useful for other people.

MarcEdit doesn’t have a single, built in process to make this conversion.  But it has all the tools to make it work.  The process essentially involves creating an XLST to transfer MARCXML data to KML, and then a small workflow for ensuring data is in UTF8 and that the cartographic data points are formatted in a way that most GIS Software can make use of them.

In a nutshell, the process looks like this:

  1. Download/Extract your MARC records.
  2. Break your records, ensuring to convert any MARC8 data to UTF8
  3. Open the records in the MarcEditor.  You will need to prep the data.  GIS systems prefer data to be in decimal degrees, however, most coded data in MARC is coded in degrees, minutes, and seconds.  You will need to change that.  Also, in order for this process to work — the data must come out of the 034 — the coded data.  While this information is often repeated in the 255 — it is important to note that this data is for display purposes (human readable) and is rarely consistent.  It really should never be used.
  4. After you have converted the 034, compile the records back to MARC
  5. Using MARCSplit — split the files to one record per file (assuming you have more than one record)
  6. If you haven’t downloaded the MARC=>KML XSLT — you’ll find it here: https://github.com/reeset/marcedit_xslt_files/blob/master/marcxmlslim2kml.xsl
    Download this file — save it to the MarcEdit XSLT directory, and then register the XSLT with MarcEdit (you find this in the MARC Tools window, then Tools/Edit XML Function List menu option)
  7. Register the XSLT.   Options should be:
    Name/Alias: Name you want to see in MarcEdit
    XSLT/XQuery: Path to your XSLT
    Original Format: MARC
    Destination Format: Other
    Engine: I prefer Saxon
    Save
  8. Open the Batch Process tool — convert the folder with the split marc files into KML files, selecting the defined XSLT process created in Step 7.

And that’s it.  The process can be scripted via the command line or run as described above.  I recorded an example of this process at:

If you have questions — feel free to let me know.

–tr


Posted

in

by

Tags: