[#19] Extract thumbnail from ISO documents
This commit is contained in:
parent
2d557022f4
commit
692f04568f
|
@ -259,6 +259,17 @@ class SpatialHarvester(HarvesterBase):
|
|||
|
||||
extras['access_constraints'] = iso_values.get('limitations-on-public-access', '')
|
||||
|
||||
# Grpahic preview
|
||||
browse_graphic = iso_values.get('browse-graphic')
|
||||
if browse_graphic:
|
||||
browse_graphic = browse_graphic[0]
|
||||
extras['graphic-preview-file'] = browse_graphic.get('file')
|
||||
if browse_graphic.get('description'):
|
||||
extras['graphic-preview-description'] = browse_graphic.get('description')
|
||||
if browse_graphic.get('type'):
|
||||
extras['graphic-preview-type'] = browse_graphic.get('type')
|
||||
|
||||
|
||||
for key in ['temporal-extent-begin', 'temporal-extent-end']:
|
||||
if len(iso_values[key]) > 0:
|
||||
extras[key] = iso_values[key][0]
|
||||
|
|
|
@ -344,6 +344,33 @@ class ISOBoundingBox(ISOElement):
|
|||
),
|
||||
]
|
||||
|
||||
class ISOBrowseGraphic(ISOElement):
|
||||
|
||||
elements = [
|
||||
ISOElement(
|
||||
name="file",
|
||||
search_paths=[
|
||||
"gmd:fileName/gco:CharacterString/text()",
|
||||
],
|
||||
multiplicity="1",
|
||||
),
|
||||
ISOElement(
|
||||
name="description",
|
||||
search_paths=[
|
||||
"gmd:fileDescription/gco:CharacterString/text()",
|
||||
],
|
||||
multiplicity="0..1",
|
||||
),
|
||||
ISOElement(
|
||||
name="type",
|
||||
search_paths=[
|
||||
"gmd:fileType/gco:CharacterString/text()",
|
||||
],
|
||||
multiplicity="0..1",
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class ISODocument(MappedXmlDocument):
|
||||
|
||||
# Attribute specifications from "XPaths for GEMINI" by Peter Parslow.
|
||||
|
@ -651,7 +678,16 @@ class ISODocument(MappedXmlDocument):
|
|||
"gmd:dataQualityInfo/gmd:DQ_DataQuality/gmd:lineage/gmd:LI_Lineage/gmd:statement/gco:CharacterString/text()",
|
||||
],
|
||||
multiplicity="0..1",
|
||||
)
|
||||
),
|
||||
ISOBrowseGraphic(
|
||||
name="browse-graphic",
|
||||
search_paths=[
|
||||
"gmd:identificationInfo/gmd:MD_DataIdentification/gmd:graphicOverview/gmd:MD_BrowseGraphic",
|
||||
"gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:graphicOverview/gmd:MD_BrowseGraphic",
|
||||
],
|
||||
multiplicity="*",
|
||||
),
|
||||
|
||||
]
|
||||
|
||||
def infer_values(self, values):
|
||||
|
|
Loading…
Reference in New Issue