Skip to content

Commit b3d967c

Browse files
committed
Add geo box
1 parent 2f61d6f commit b3d967c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

caltechdata_write/customize_schema.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ def customize_schema(json_record):
1616
substr = substr + ', '
1717
substr = substr+s['subject']
1818
json_record['subjects']=substr
19-
del json_record['subjects']
19+
#print(substr)
20+
#del json_record['subjects']
2021

2122
#Extract identifier and label as DOI
2223
if "identifier" in json_record:
@@ -145,6 +146,12 @@ def customize_schema(json_record):
145146
g['geoLocationPoint']['pointLatitude'] = str(g['geoLocationPoint']['pointLatitude'])
146147
g['geoLocationPoint']['pointLongitude'] = str(g['geoLocationPoint']['pointLongitude'])
147148
g['geoLocationPoint'] = [g['geoLocationPoint']]
149+
if 'geoLocationBox' in g:
150+
g['geoLocationBox']['northBoundLatitude']=str(g['geoLocationBox']['northBoundLatitude'])
151+
g['geoLocationBox']['southBoundLatitude']=str(g['geoLocationBox']['southBoundLatitude'])
152+
g['geoLocationBox']['eastBoundLongitude']=str(g['geoLocationBox']['eastBoundLongitude'])
153+
g['geoLocationBox']['westBoundLongitude']=str(g['geoLocationBox']['westBoundLongitude'])
154+
g['geoLocationBox'] = [g['geoLocationBox']]
148155
json_record['geographicCoverage'] = json_record.pop('geoLocations')
149156

150157
#Publisher

0 commit comments

Comments
 (0)