-
Notifications
You must be signed in to change notification settings - Fork 25
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
6d5da29
commit ac8e143
Showing
13 changed files
with
250 additions
and
72 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
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
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
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
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
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
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
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
83 changes: 49 additions & 34 deletions
83
tests/example_stac/example-collection_version-extension.json
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 |
---|---|---|
@@ -1,36 +1,51 @@ | ||
{ | ||
"stac_version": "1.0.0", | ||
"stac_extensions": ["https://stac-extensions.github.io/version/v1.0.0/schema.json"], | ||
"id": "merraclim", | ||
"title": "MERRAclim", | ||
"description": "A high-resolution global dataset of remotely sensed bioclimatic variables for ecological modelling.", | ||
"license": "CC0-1.0", | ||
"version": "1", | ||
"deprecated": true, | ||
"extent": { | ||
"spatial": { | ||
"bbox": [[-180,-90,180,90]] | ||
}, | ||
"temporal": { | ||
"interval": [["1980-01-01T00:00:00Z","2009-12-31T23:59:59Z"]] | ||
} | ||
"type": "Collection", | ||
"stac_version": "1.0.0", | ||
"stac_extensions": [ | ||
"https://stac-extensions.github.io/version/v1.0.0/schema.json" | ||
], | ||
"id": "merraclim", | ||
"title": "MERRAclim", | ||
"description": "A high-resolution global dataset of remotely sensed bioclimatic variables for ecological modelling.", | ||
"license": "CC0-1.0", | ||
"version": "1", | ||
"deprecated": true, | ||
"extent": { | ||
"spatial": { | ||
"bbox": [ | ||
[ | ||
-180, | ||
-90, | ||
180, | ||
90 | ||
] | ||
] | ||
}, | ||
"links": [ | ||
{ | ||
"rel": "self", | ||
"href": "https://datadryad.org/resource/doi:10.5061/dryad.s2v81/v1/collection.json" | ||
}, | ||
{ | ||
"rel": "item", | ||
"href": "https://datadryad.org/resource/doi:10.5061/dryad.s2v81/v1/item.json" | ||
}, | ||
{ | ||
"rel": "root", | ||
"href": "https://datadryad.org/resource/doi:10.5061/dryad.s2v81/catalog.json" | ||
}, | ||
{ | ||
"rel": "latest-version", | ||
"href": "https://datadryad.org/resource/doi:10.5061/dryad.s2v81/v2/collection.json" | ||
} | ||
] | ||
} | ||
"temporal": { | ||
"interval": [ | ||
[ | ||
"1980-01-01T00:00:00Z", | ||
"2009-12-31T23:59:59Z" | ||
] | ||
] | ||
} | ||
}, | ||
"links": [ | ||
{ | ||
"rel": "self", | ||
"href": "https://datadryad.org/resource/doi:10.5061/dryad.s2v81/v1/collection.json" | ||
}, | ||
{ | ||
"rel": "item", | ||
"href": "https://datadryad.org/resource/doi:10.5061/dryad.s2v81/v1/item.json" | ||
}, | ||
{ | ||
"rel": "root", | ||
"href": "https://datadryad.org/resource/doi:10.5061/dryad.s2v81/catalog.json" | ||
}, | ||
{ | ||
"rel": "latest-version", | ||
"href": "https://datadryad.org/resource/doi:10.5061/dryad.s2v81/v2/collection.json" | ||
} | ||
] | ||
} |
3 changes: 2 additions & 1 deletion
3
tests/example_stac/example-landsat8_item-assets-extension.json
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
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from stac_pydantic.catalog import Catalog | ||
|
||
|
||
def test_catalog(): | ||
# Create a valid Catalog instance | ||
catalog = Catalog( | ||
type="Catalog", | ||
id="my-catalog", | ||
description="My STAC catalog", | ||
) | ||
|
||
catalog_json = catalog.model_dump(mode="json") | ||
|
||
# Make default all values are set | ||
assert catalog_json["id"] == "my-catalog" | ||
assert catalog_json["description"] == "My STAC catalog" | ||
assert catalog_json["stac_version"] == "1.0.0" | ||
assert catalog_json["links"] == [] | ||
assert catalog_json["type"] == "Catalog" | ||
|
||
assert "stac_extensions" not in catalog_json | ||
assert "title" not in catalog_json |
Oops, something went wrong.