isawnyu / pleiades-gazetteer

This repository provides a home for tickets and other planning documents for the Pleiades gazetteer of ancient places. Code is kept in multiple other repositories.
https://pleiades.stoa.org
11 stars 0 forks source link

RDF export error: capgrids TypeError #476

Open jessesnyder opened 2 years ago

jessesnyder commented 2 years ago

Exception thrown while running weekly RDF export:

2022-03-24 12:59:40 ERROR pleiades.rdf Exception caught computing grid extent for <Location at /plone/places/442580/batlas-locati
on>
Traceback (most recent call last):
  File "/srv/python27-apps/pleiades4/src/pleiades.rdf/pleiades/rdf/common.py", line 589, in place
    shape = box(*bounds)
TypeError: box() takes at least 4 arguments (2 given)
2022-03-24 12:59:42 ERROR pleiades.rdf Exception caught computing grid extent for <Location at /plone/places/442602/batlas-locati
on>
Traceback (most recent call last):
  File "/srv/python27-apps/pleiades4/src/pleiades.rdf/pleiades/rdf/common.py", line 589, in place
    shape = box(*bounds)
TypeError: box() takes at least 4 arguments (2 given)
...
...
etc. (there are a bunch of these)

Same error, different call site (line 538):

2022-03-24 12:59:54 ERROR pleiades.rdf Exception caught computing grid extent for <Location at /plone/places/442848/batlas-locati
on>
Traceback (most recent call last):
  File "/srv/python27-apps/pleiades4/src/pleiades.rdf/pleiades/rdf/common.py", line 538, in place
    shape = box(*bounds)
TypeError: box() takes at least 4 arguments (2 given)
jessesnyder commented 2 years ago

Traced this error to inconsistent return values from pleiades.capgrids.box() depending on the input values. Currently 3 of the "inset" maps defined in pleiades.capgrids.maps.csv have more than one set of bounding-box coordinates. For example, number 45: 45,"Tarentum",500,14.50,19.00,40.00,42.00,"a","I",1,4,"[[15,41.5,16,42.5], [17.5, 39.5, 40.5, 19]]","45 inset"

Compare this with number 30, which has a single bounding box: 30,"Iol Caesarea",500,0.50,4.50,36.00,38.00,"a","h",1,4,"[0,36,1.5,37]","30 inset"

This results in return a tuple of 2 tuples of 4, instead of the single tuple of 4 expected by shapely.box().

Current problematic maps are 45, 47, and 80.