Skip to content

Commit

Permalink
Merge pull request #41 from sat-utils/develop
Browse files Browse the repository at this point in the history
Release 0.1.3
  • Loading branch information
matthewhanson authored May 5, 2019
2 parents 1a8a55b + 4211b66 commit 8101782
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 9 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [v0.1.3] - 2019-05-04

### Added
- Items.search_geometry() function added to return search geometry
- Extension of `Item` files can now be specified in `Item.get_filename()`. Defaults to `item.json`.
- Specify STAC version by setting SATUTILS_STAC_VERSION environment variable. Currently defaults to '0.6.2'.

### Changed
- Items objects no longer require a Collection for every Item

## [v0.1.2] - 2019-02-14

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

[Unreleased]: https://github.com/sat-utils/sat-stac/compare/master...develop
[v0.1.3]: https://github.com/sat-utils/sat-stac/compare/0.1.2...v0.1.3
[v0.1.2]: https://github.com/sat-utils/sat-stac/compare/0.1.1...v0.1.2
[v0.1.1]: https://github.com/sat-utils/sat-stac/compare/0.1.0...v0.1.1
[v0.1.0]: https://github.com/sat-utils/sat-stac/tree/0.1.0
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $ pip install .


#### Versions
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.
To install a specific versions of sat-stac, install the matching version of sat-stac.

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

| sat-stac | STAC |
| -------- | ---- |
| 0.1.x | 0.6.0 |
| 0.1.x | 0.6.x |

## Tutorials

Expand Down
4 changes: 1 addition & 3 deletions satstac/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

from .version import __version__
from .thing import Thing, STACError


STAC_VERSION='0.6.0'
from .config import STAC_VERSION


class Catalog(Thing):
Expand Down
4 changes: 4 additions & 0 deletions satstac/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import os

STAC_VERSION = os.getenv('SATUTILS_STAC_VERSION', '0.6.2')

4 changes: 2 additions & 2 deletions satstac/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ def asset(self, key):
logging.warning('No such asset (%s)' % key)
return None

def get_filename(self, path='', filename='${id}'):
def get_filename(self, path='', filename='${id}', extension='.json'):
""" Get complete path with filename to this item """
return os.path.join(
self.substitute(path),
self.substitute(filename) + '.json'
self.substitute(filename) + extension
)

def substitute(self, string):
Expand Down
10 changes: 9 additions & 1 deletion satstac/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def __init__(self, items, collections=[], search={}):
# link Items to their Collections
cols = {c.id: c for c in self._collections}
for i in self._items:
i._collection = cols[i['collection']]
if 'collection' in i.properties:
if i['collection'] in cols:
i._collection = cols[i['collection']]

@classmethod
def load(cls, filename):
Expand Down Expand Up @@ -65,6 +67,12 @@ def center(self):
else:
return None

def search_geometry(self):
if 'intersects' in self._search:
return self._search['intersects']
else:
return None

def properties(self, key, date=None):
""" Set of values for 'key' property in Items, for specific date if provided """
if date is None:
Expand Down
2 changes: 1 addition & 1 deletion satstac/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.2'
__version__ = '0.1.3'

0 comments on commit 8101782

Please sign in to comment.