PostGISGeometry Input

ST_GeomFromMARC21

What is ST_GeomFromMARC21?

ST_GeomFromMARC21 parses a MARC21/XML record containing geographic coordinates in field 034 and returns the corresponding PostGIS geometry. Available from PostGIS 3.3.

SQL
ST_GeomFromMARC21(text marcxml)geometry

The output is always in EPSG:4326. Supports Point and Polygon (envelope) inputs depending on the MARC21 field content.

When would you use ST_GeomFromMARC21?

Use ST_GeomFromMARC21 to integrate library catalogues and bibliographic metadata into spatial workflows — for instance, mapping the coverage areas of atlases, field guides, or local-history volumes held by a library system. The MARC21 format embeds coordinates in field 034 subfields $d, $e, $f, $g.

It is a specialised constructor for the library/archive community; general spatial data ingestion should use ST_GeomFromGeoJSON or ST_GeomFromText instead.

FAQs

What MARC21 fields does it read?

Primarily field 034 (Coded cartographic mathematical data). Subfields $d-$g give westernmost, easternmost, northernmost, southernmost coordinates respectively.

Does it work with MARC21 binary?

No. Input must be MARC21/XML (the XML serialisation).

What SRID is returned?

EPSG:4326. MARC21 coordinates are assumed to be WGS84 longitude/latitude.

What version introduced it?

PostGIS 3.3.