Skip to content

Commit

Permalink
fix tests, checking availability of the property on owslib with hasat…
Browse files Browse the repository at this point in the history
…tr()
  • Loading branch information
pvgenuchten committed Nov 9, 2023
1 parent 6b52617 commit 54d5788
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions pygeometa/schemas/iso19139/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,28 +157,24 @@ def import_(self, metadata: str) -> dict:
if identification.temporalextent_end:
temp_extent['end'] = identification.temporalextent_end


mcf['identification']['extents']['temporal'].append(temp_extent)

if m.identification.denominators:
mcf['spatial']['denominators'] = m.identification.denominators
if hasattr(identification, 'denominators'):
mcf['spatial']['denominators'] = identification.denominators

if m.identification.distance:
if hasattr(identification, 'distance'):
mcf['spatial']['resolution'] = []
for k, v in enumerate(m.identification.distance):
for k, v in enumerate(identification.distance):
uom = ''
if m.identification.uom and len(m.identification.uom) > k:
uom = m.identification.uom[k]
if hasattr(identification, 'uom') and len(identification.uom) > k: # noqa
uom = identification.uom[k]
mcf['spatial']['resolution'].append({'distance': v,
'uom': uom})

if m.identification.spatialrepresentationtype and len(m.identification.spatialrepresentationtype) > 0: # noqa
mcf['spatial']['datatype'] = m.identification.spatialrepresentationtype[0] # noqa

if m.identification.accessconstraints:
mcf['identification']['accessconstraints'] = m.identification.accessconstraints[0] # noqa
if hasattr(identification, 'spatialrepresentationtype') and len(identification.spatialrepresentationtype) > 0: # noqa
mcf['spatial']['datatype'] = identification.spatialrepresentationtype[0] # noqa

if identification.accessconstraints:
if hasattr(identification, 'accessconstraints'):
mcf['identification']['accessconstraints'] = identification.accessconstraints[0] # noqa

mcf['identification']['status'] = identification.status
Expand Down

0 comments on commit 54d5788

Please sign in to comment.