[postgis-devel] ST_GeomFromMARC21 / ST_AsMARC21

Jim Jones jim.jones at uni-muenster.de
Mon Jan 24 02:38:31 PST 2022


 > The spatial component of this standard was introduced in 1990s it seems.
 > https://www.loc.gov/marc/bibliographic/bd343.html

The MARC datafield I'm aiming is rather the 034 - Coded Cartographic 
Mathematical Data

https://www.loc.gov/marc/bibliographic/bd034.html

.. as it describes the bbox (or a point) of the catalogued map.

 > I will take Jim's word for it that it is commonly used for historical 
and modern maps and geographical locations by librarians which I think a 
small group but a very important group of users.

Here is an example (LOC) of a 1733 map of the British Empire in America:

https://lccn.loc.gov/85694110

.. and its MARCXML representation (see bbox in datafield:034):

https://lccn.loc.gov/85694110/marcxml

Side note: one can see that the document does not provide any info 
regarding the spatial reference system. The librarians I know claim that 
coordinates are always in WGS84, but this information isn't documented 
either. A few attempts to (explicitly) encode this info were made in the 
past, but without success:

https://www.loc.gov/marc/marbi/2010/2010-08.html
https://www.loc.gov/marc/marbi/minutes/an-10.html

I will try to contact LOC to make sure it is the current state of the 
standard before submitting the patch.

 > Yep, sounds good. A PR with a *lot* of bad/invalid/broken input cases 
for the GeomFrom*() case in particular. We have historically always had 
crashers on the inputs, so we need to hammer that part pretty hard.

Nice. I'll work a bit on the code (comments / docs) and write some test 
cases to see if I manage to crash the database ;)

Best,

Jim


On 24.01.22 03:41, Paul Ramsey wrote:
> Yep, sounds good. A PR with a *lot* of bad/invalid/broken input cases for the GeomFrom*() case in particular. We have historically always had crashers on the inputs, so we need to hammer that part pretty hard.
>
> P
>
>> On Jan 22, 2022, at 6:24 PM, Regina Obe <lr at pcorp.us> wrote:
>>
>> I did check this out some more.  The MARC21 format does seem to be pretty standard for Library of Congress and other libraries and some variant has been used since the 1960s.
>>
>> The spatial component of this standard was introduced in 1990s it seems.
>>
>> https://www.loc.gov/marc/bibliographic/bd343.html
>>
>> and looks like there has been work to coalesce the disparities between FGDC and Marc21
>>
>> http://www.dlib.org/dlib/january00/chandler/01chandler.html
>>
>> So my only concern is how widely used the spatial component of it is.  I will take Jim's word for it that it is commonly used for historical and modern maps and geographical locations by librarians which I think a small group but a very important group of users.
>>
>> I'm personally fine with accepting this.  If for whatever reason we find issue with it in future and not much use, and it becomes a security sore point, we can always deprecate and remove later.
>>
>> Thanks,
>> Regina
>>
>>> -----Original Message-----
>>> From: postgis-devel [mailto:postgis-devel-bounces at lists.osgeo.org] On
>>> Behalf Of Jim Jones
>>> Sent: Friday, January 21, 2022 6:26 PM
>>> To: postgis-devel at lists.osgeo.org
>>> Subject: Re: [postgis-devel] ST_GeomFromMARC21 / ST_AsMARC21
>>>
>>>> Is there any other independent users of this format?
>>> Every major library management system uses MARC in one way or another.
>>> One could see MARC as the shapefile of libraries ;) The geo data are mostly
>>> related to the cataloguing of modern / historical maps, atlases and places
>>> related to published manuscripts. But you're right, the format is rather
>>> known only among librarians.
>>>
>>> If the functions would somehow add any value to the project, I could
>>> prepare a pull request. I would, of course, be willing to maintain the
>>> functions.
>>>
>>> Jim
>>>
>>> Am 21.01.22 um 22:04 schrieb Paul Ramsey:
>>>> Having perused the files, they seem like decent enough code. My main
>>>> concern is that this format might be so niche as to be not worth
>>>> carrying the functions (flip side, the functions are so simple that
>>>> the cost of maintaining them is very low (flip flip side, input/output
>>>> functions are the most common place for DOS/crash errors to show up)).
>>>> Is there any other independent users of this format?
>>>>
>>>> P
>>>>
>>>> On Thu, Jan 20, 2022 at 7:57 AM Jim Jones <jim.jones at uni-muenster.de>
>>> wrote:
>>>>> Dear PostGIS developers,
>>>>>
>>>>> Some time ago I wrote two tiny PostGIS related C functions for the
>>>>> database of our university library. They basically create geometries
>>>>> from MARC21/XML* records (ST_GeomFromMARC21[1]) and serialize
>>>>> geometries as MARC21/XML records (ST_AsMARC1[2]), and they work
>>>>> pretty well for us :)
>>>>>
>>>>> * MARC21 is a pretty old library standard to encode bibliographic
>>>>> data, which often contain geographic information. The standard is
>>>>> maintained by the Library of Congress (US).
>>>>>
>>>>> I'm now wondering if these functions could be added to the PostGIS
>>>>> repo (I would happily create a pull request), or if I should keep
>>>>> using it locally in our cluster (or even the unpleasant alternative
>>>>> of creating my own extension). In other words, before I take the
>>>>> trouble of making the code/documentation "submission ready" I would
>>>>> like to hear your thoughts. Would the PostGIS repo be the right place for
>>> these features?
>>>>> Best,
>>>>>
>>>>> Jim
>>>>>
>>>>> 1-
>>>>>
>>> https://github.com/jimjonesbr/postgis/blob/b12eee02ac9842f4858057208e
>>>>> 1c6980087999a7/postgis/lwgeom_in_marc21.c
>>>>>
>>>>> 2-
>>>>>
>>> https://github.com/jimjonesbr/postgis/blob/b12eee02ac9842f4858057208e
>>>>> 1c6980087999a7/postgis/lwgeom_out_marc21.c
>>>>>
>>>>> _______________________________________________
>>>>> postgis-devel mailing list
>>>>> postgis-devel at lists.osgeo.org
>>>>> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>>>> _______________________________________________
>>>> postgis-devel mailing list
>>>> postgis-devel at lists.osgeo.org
>>>> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>>
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-devel
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel


More information about the postgis-devel mailing list