@@ -1504,12 +1504,11 @@ def _parse_iso(context, repos, exml):
15041504 _set (context , recobj , 'pycsw:DistanceValue' , md_identification .distance [0 ])
15051505 if len (md_identification .uom ) > 0 :
15061506 _set (context , recobj , 'pycsw:DistanceUOM' , md_identification .uom [0 ])
1507-
15081507 if len (md_identification .classification ) > 0 :
15091508 _set (context , recobj , 'pycsw:Classification' , md_identification .classification [0 ])
15101509 if len (md_identification .uselimitation ) > 0 :
15111510 _set (context , recobj , 'pycsw:ConditionApplyingToAccessAndUse' ,
1512- md_identification .uselimitation [0 ])
1511+ md_identification .uselimitation [0 ])
15131512
15141513 service_types = []
15151514 from owslib .iso import SV_ServiceIdentification
@@ -1527,14 +1526,13 @@ def _parse_iso(context, repos, exml):
15271526 _set (context , recobj , 'pycsw:SpecificationTitle' , md .dataquality .specificationtitle )
15281527 if hasattr (md .dataquality , 'specificationdate' ):
15291528 _set (context , recobj , 'pycsw:specificationDate' ,
1530- md .dataquality .specificationdate [0 ].date )
1529+ md .dataquality .specificationdate [0 ].date )
15311530 _set (context , recobj , 'pycsw:SpecificationDateType' ,
1532- md .dataquality .specificationdate [0 ].datetype )
1531+ md .dataquality .specificationdate [0 ].datetype )
15331532
15341533 if hasattr (md , 'contact' ) and len (md .contact ) > 0 :
15351534 _set (context , recobj , 'pycsw:ResponsiblePartyRole' , md .contact [0 ].role )
15361535
1537-
15381536 if hasattr (md , 'contentinfo' ) and len (md .contentinfo ) > 0 :
15391537 for ci in md .contentinfo :
15401538 if isinstance (ci , MD_ImageDescription ):
@@ -1545,9 +1543,9 @@ def _parse_iso(context, repos, exml):
15451543 if ci .processing_level is not None :
15461544 pl_keyword = 'eo:processingLevel:' + ci .processing_level
15471545 if keywords is None :
1548- keywords = pl_keyword
1546+ keywords = pl_keyword
15491547 else :
1550- keywords += ',' + pl_keyword
1548+ keywords += ',' + pl_keyword
15511549
15521550 _set (context , recobj , 'pycsw:Keywords' , keywords )
15531551
@@ -1573,7 +1571,7 @@ def _parse_iso(context, repos, exml):
15731571 _set (context , recobj , 'pycsw:Instrument' , instrument .identifier )
15741572 _set (context , recobj , 'pycsw:SensorType' , instrument .type )
15751573
1576- all_formats = []
1574+ all_formats = []
15771575 if hasattr (md .distribution , 'format' ) and md .distribution .format is not None :
15781576 all_formats .append (md .distribution .format )
15791577
@@ -1616,11 +1614,11 @@ def _parse_iso(context, repos, exml):
16161614 'url' : scpt .url
16171615 }
16181616 links .append (linkobj )
1619- except Exception as err : # srv: identification does not exist
1617+ except Exception : # srv: identification does not exist
16201618 LOGGER .exception ('no srv:SV_ServiceIdentification links found' )
16211619
16221620 if hasattr (md_identification , 'graphicoverview' ):
1623- for thumb in md_identification .graphicoverview :
1621+ for thumb in md_identification .graphicoverview :
16241622 links .append ({
16251623 'name' : 'preview' ,
16261624 'description' : 'Web image thumbnail (URL)' ,
@@ -1643,6 +1641,7 @@ def _parse_iso(context, repos, exml):
16431641
16441642 return recobj
16451643
1644+
16461645def _parse_dc (context , repos , exml ):
16471646
16481647 from owslib .csw import CswRecord
@@ -1830,6 +1829,15 @@ def _parse_stac_resource(context, repos, record):
18301829 stype = 'item'
18311830 title = record ['properties' ].get ('title' )
18321831 abstract = record ['properties' ].get ('description' )
1832+ _set (context , recobj , 'pycsw:CreationDate' , record ['properties' ].get ('created' ))
1833+ _set (context , recobj , 'pycsw:Modified' , record ['properties' ].get ('updated' ))
1834+ _set (context , recobj , 'pycsw:Platform' , record ['properties' ].get ('platform' ))
1835+ instruments = record ['properties' ].get ('instruments' )
1836+ if instruments is not None :
1837+ _set (context , recobj , 'pycsw:Instrument' , ',' .join (instruments ))
1838+ if record ['properties' ].get ('gsd' ) is not None :
1839+ _set (context , recobj , 'pycsw:DistanceValue' , record ['properties' ]['gsd' ])
1840+ _set (context , recobj , 'pycsw:DistanceUOM' , 'm' )
18331841 if record .get ('geometry' ) is not None :
18341842 bbox_wkt = util .bbox2wktpolygon (util .geojson_geometry2bbox (record ['geometry' ]))
18351843 elif stac_type == 'Collection' :
@@ -1840,6 +1848,15 @@ def _parse_stac_resource(context, repos, record):
18401848 stype = 'collection'
18411849 title = record .get ('title' )
18421850 abstract = record .get ('description' )
1851+ _set (context , recobj , 'pycsw:CreationDate' , record .get ('created' ))
1852+ _set (context , recobj , 'pycsw:Modified' , record .get ('updated' ))
1853+ _set (context , recobj , 'pycsw:Platform' , record .get ('platform' ))
1854+ instruments = record .get ('instruments' )
1855+ if instruments is not None :
1856+ _set (context , recobj , 'pycsw:Instrument' , ',' .join (instruments ))
1857+ if record .get ('gsd' ) is not None :
1858+ _set (context , recobj , 'pycsw:DistanceValue' , record ['gsd' ])
1859+ _set (context , recobj , 'pycsw:DistanceUOM' , 'm' )
18431860 if 'extent' in record and 'spatial' in record ['extent' ]:
18441861 bbox_csv = ',' .join (str (t ) for t in record ['extent' ]['spatial' ]['bbox' ][0 ])
18451862 bbox_wkt = util .bbox2wktpolygon (bbox_csv )
@@ -1854,6 +1871,12 @@ def _parse_stac_resource(context, repos, record):
18541871 stype = 'catalog'
18551872 title = record .get ('title' )
18561873 abstract = record .get ('description' )
1874+ _set (context , recobj , 'pycsw:CreationDate' , record .get ('created' ))
1875+ _set (context , recobj , 'pycsw:Modified' , record .get ('updated' ))
1876+ _set (context , recobj , 'pycsw:Platform' , record .get ('platform' ))
1877+ instruments = record .get ('instruments' )
1878+ if instruments is not None :
1879+ _set (context , recobj , 'pycsw:Instrument' , ',' .join (instruments ))
18571880
18581881 _set (context , recobj , 'pycsw:Identifier' , record ['id' ])
18591882 _set (context , recobj , 'pycsw:Typename' , typename )
@@ -1952,22 +1975,25 @@ def _parse_stac_resource(context, repos, record):
19521975
19531976 return recobj
19541977
1978+
19551979def fgdccontact2iso (cnt , role = 'pointOfContact' ):
19561980 """Creates a iso format contact (owslib style) from fgdc format"""
19571981
1958- return {'name' : cnt .cntper ,
1959- 'organization' : cnt .cntorg ,
1960- 'position' : cnt .cntpos ,
1961- 'phone' : cnt .voice ,
1962- 'address' : cnt .address ,
1963- 'city' : cnt .city ,
1964- 'region' : cnt .state ,
1965- 'postcode' : cnt .postal ,
1966- 'country' : cnt .country ,
1967- 'email' : cnt .email ,
1968- 'role' : role
1982+ return {
1983+ 'name' : cnt .cntper ,
1984+ 'organization' : cnt .cntorg ,
1985+ 'position' : cnt .cntpos ,
1986+ 'phone' : cnt .voice ,
1987+ 'address' : cnt .address ,
1988+ 'city' : cnt .city ,
1989+ 'region' : cnt .state ,
1990+ 'postcode' : cnt .postal ,
1991+ 'country' : cnt .country ,
1992+ 'email' : cnt .email ,
1993+ 'role' : role
19691994 }
19701995
1996+
19711997def caps2iso (record , caps , context ):
19721998 """Creates ISO metadata from Capabilities XML"""
19731999
0 commit comments