Skip to content

Commit 8101782

Browse files
Merge pull request #41 from sat-utils/develop
Release 0.1.3
2 parents 1a8a55b + 4211b66 commit 8101782

File tree

7 files changed

+30
-9
lines changed

7 files changed

+30
-9
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [v0.1.3] - 2019-05-04
10+
11+
### Added
12+
- Items.search_geometry() function added to return search geometry
13+
- Extension of `Item` files can now be specified in `Item.get_filename()`. Defaults to `item.json`.
14+
- Specify STAC version by setting SATUTILS_STAC_VERSION environment variable. Currently defaults to '0.6.2'.
15+
16+
### Changed
17+
- Items objects no longer require a Collection for every Item
18+
919
## [v0.1.2] - 2019-02-14
1020

1121
### Added
@@ -30,6 +40,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3040
Initial Release
3141

3242
[Unreleased]: https://github.com/sat-utils/sat-stac/compare/master...develop
43+
[v0.1.3]: https://github.com/sat-utils/sat-stac/compare/0.1.2...v0.1.3
3344
[v0.1.2]: https://github.com/sat-utils/sat-stac/compare/0.1.1...v0.1.2
3445
[v0.1.1]: https://github.com/sat-utils/sat-stac/compare/0.1.0...v0.1.1
3546
[v0.1.0]: https://github.com/sat-utils/sat-stac/tree/0.1.0

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $ pip install .
3030

3131

3232
#### Versions
33-
The latest version of sat-stac is 0.1.1, which uses the STAC spec v0.6.0. To install other versions of sat-stac, install the matching version of sat-stac.
33+
To install a specific versions of sat-stac, install the matching version of sat-stac.
3434

3535
```bash
3636
pip install sat-stac==0.1.0
@@ -40,7 +40,7 @@ The table below shows the corresponding versions between sat-stac and STAC:
4040

4141
| sat-stac | STAC |
4242
| -------- | ---- |
43-
| 0.1.x | 0.6.0 |
43+
| 0.1.x | 0.6.x |
4444

4545
## Tutorials
4646

satstac/catalog.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
from .version import __version__
55
from .thing import Thing, STACError
6-
7-
8-
STAC_VERSION='0.6.0'
6+
from .config import STAC_VERSION
97

108

119
class Catalog(Thing):

satstac/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import os
2+
3+
STAC_VERSION = os.getenv('SATUTILS_STAC_VERSION', '0.6.2')
4+

satstac/item.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ def asset(self, key):
102102
logging.warning('No such asset (%s)' % key)
103103
return None
104104

105-
def get_filename(self, path='', filename='${id}'):
105+
def get_filename(self, path='', filename='${id}', extension='.json'):
106106
""" Get complete path with filename to this item """
107107
return os.path.join(
108108
self.substitute(path),
109-
self.substitute(filename) + '.json'
109+
self.substitute(filename) + extension
110110
)
111111

112112
def substitute(self, string):

satstac/items.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def __init__(self, items, collections=[], search={}):
1616
# link Items to their Collections
1717
cols = {c.id: c for c in self._collections}
1818
for i in self._items:
19-
i._collection = cols[i['collection']]
19+
if 'collection' in i.properties:
20+
if i['collection'] in cols:
21+
i._collection = cols[i['collection']]
2022

2123
@classmethod
2224
def load(cls, filename):
@@ -65,6 +67,12 @@ def center(self):
6567
else:
6668
return None
6769

70+
def search_geometry(self):
71+
if 'intersects' in self._search:
72+
return self._search['intersects']
73+
else:
74+
return None
75+
6876
def properties(self, key, date=None):
6977
""" Set of values for 'key' property in Items, for specific date if provided """
7078
if date is None:

satstac/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.1.2'
1+
__version__ = '0.1.3'

0 commit comments

Comments
 (0)