-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
755be2c
commit e9cc853
Showing
37 changed files
with
26,876 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# Authors: Tom Kralidis <[email protected]> | ||
# Ricardo Garcia Silva <[email protected]> | ||
# | ||
# Copyright (c) 2023 Tom Kralidis | ||
# Copyright (c) 2025 Tom Kralidis | ||
# Copyright (c) 2016 James F. Dickens | ||
# Copyright (c) 2017 Ricardo Garcia Silva | ||
# | ||
|
@@ -1760,7 +1760,7 @@ def _parse_oarec_record(context, repos, record): | |
_set(context, recobj, 'pycsw:InsertDate', util.get_today_and_now()) | ||
_set(context, recobj, 'pycsw:XML', '') # FIXME: transform into XML? or not, to validate | ||
_set(context, recobj, 'pycsw:Metadata', json.dumps(record)) | ||
_set(context, recobj, 'pycsw:MetadataType', 'application/json') | ||
_set(context, recobj, 'pycsw:MetadataType', 'application/geo+json') | ||
|
||
_set(context, recobj, 'pycsw:AnyText', ' '.join([str(t) for t in util.get_anytext_from_obj(record)])) | ||
|
||
|
@@ -1820,6 +1820,7 @@ def _parse_stac_resource(context, repos, record): | |
LOGGER.debug('Parsing STAC Item') | ||
conformance = 'https://github.com/radiantearth/stac-spec/tree/master/item-spec/item-spec.md' | ||
typename = 'stac:Item' | ||
metadata_type = 'application/geo+json' | ||
stype = 'item' | ||
title = record['properties'].get('title') | ||
abstract = record['properties'].get('description') | ||
|
@@ -1829,6 +1830,7 @@ def _parse_stac_resource(context, repos, record): | |
LOGGER.debug('Parsing STAC Collection') | ||
conformance = 'https://github.com/radiantearth/stac-spec/tree/master/collection-spec/collection-spec.md' | ||
typename = 'stac:Collection' | ||
metadata_type = 'application/json' | ||
stype = 'collection' | ||
title = record.get('title') | ||
abstract = record.get('description') | ||
|
@@ -1842,6 +1844,7 @@ def _parse_stac_resource(context, repos, record): | |
LOGGER.debug('Parsing STAC Catalog') | ||
conformance = 'https://github.com/radiantearth/stac-spec/tree/master/catalog-spec/catalog-spec.md' | ||
typename = 'stac:Catalog' | ||
metadata_type = 'application/json' | ||
stype = 'catalog' | ||
title = record.get('title') | ||
abstract = record.get('description') | ||
|
@@ -1853,7 +1856,7 @@ def _parse_stac_resource(context, repos, record): | |
_set(context, recobj, 'pycsw:InsertDate', util.get_today_and_now()) | ||
_set(context, recobj, 'pycsw:XML', '') # FIXME: transform into XML? or not, to validate | ||
_set(context, recobj, 'pycsw:Metadata', json.dumps(record)) | ||
_set(context, recobj, 'pycsw:MetadataType', 'application/json') | ||
_set(context, recobj, 'pycsw:MetadataType', metadata_type) | ||
_set(context, recobj, 'pycsw:AnyText', ' '.join([str(t) for t in util.get_anytext_from_obj(record)])) | ||
_set(context, recobj, 'pycsw:Type', stype) | ||
_set(context, recobj, 'pycsw:Title', title) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# Authors: Tom Kralidis <[email protected]> | ||
# Angelos Tzotsos <[email protected]> | ||
# | ||
# Copyright (c) 2024 Tom Kralidis | ||
# Copyright (c) 2025 Tom Kralidis | ||
# Copyright (c) 2021 Angelos Tzotsos | ||
# | ||
# Permission is hereby granted, free of charge, to any person | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# Authors: Tom Kralidis <[email protected]> | ||
# Angelos Tzotsos <[email protected]> | ||
# | ||
# Copyright (c) 2024 Tom Kralidis | ||
# Copyright (c) 2025 Tom Kralidis | ||
# Copyright (c) 2021 Angelos Tzotsos | ||
# | ||
# Permission is hereby granted, free of charge, to any person | ||
|
@@ -91,10 +91,10 @@ def json_serial(obj): | |
""" | ||
|
||
if isinstance(obj, (datetime, date, time)): | ||
if isinstance(obj, date): | ||
if isinstance(obj, (datetime, time)): | ||
return obj.strftime('%Y-%m-%dT%H:%M:%SZ') | ||
else: # date | ||
return obj.strftime('%Y-%m-%d') | ||
else: | ||
return obj.isoformat() + 'Z' | ||
elif isinstance(obj, bytes): | ||
try: | ||
LOGGER.debug('Returning as UTF-8 decoded bytes') | ||
|
@@ -248,5 +248,6 @@ def to_rfc3339(value: str) -> Union[tuple, None]: | |
dt_type = 'date' | ||
else: | ||
dt_type = 'date-time' | ||
dt_type = 'date-time' | ||
|
||
return dt, dt_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# | ||
# Authors: Tom Kralidis <[email protected]> | ||
# | ||
# Copyright (c) 2024 Tom Kralidis | ||
# Copyright (c) 2025 Tom Kralidis | ||
# | ||
# Permission is hereby granted, free of charge, to any person | ||
# obtaining a copy of this software and associated documentation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.