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
0 parents
commit 783376b
Showing
9 changed files
with
94 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.pyc | ||
*~ |
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,24 @@ | ||
language: python | ||
|
||
python: | ||
- '2.7' | ||
- '3.5' | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- libgdal1h | ||
- gdal-bin | ||
- libgdal-dev | ||
|
||
before_install: | ||
- pip install -r requirements.txt | ||
- pip install -r requirements-dev.txt | ||
|
||
install: | ||
- pip install -e . | ||
|
||
script: | ||
- nosetests -v -s |
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,8 @@ | ||
# sat-stats | ||
|
||
This utility library calculates zonal statistics on images being stored remotely on S3. Currently it uses the rasterstats package. | ||
|
||
This requires GDAL2, which allows direct GDAL reading in S3 buckets. | ||
|
||
For now, this is just calculating stats given an S3 key. However, the intention is that this could be a higher level library that uses sat-api and sat-search for calculating zonal stats on imagery stored on S3 file without downloading any data. | ||
|
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 @@ | ||
rasterstats==0.10.3 |
Empty file.
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,5 @@ | ||
import rasterstats | ||
|
||
def get_stats(s3key, vectors): | ||
""" Retrieve stats from image for vectors """ | ||
pass |
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 @@ | ||
__version__ = '0.0.1' |
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,41 @@ | ||
#!/usr/bin/env python | ||
import os | ||
from codecs import open | ||
from setuptools import setup, find_packages | ||
import imp | ||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
__version__ = imp.load_source('satstats.version', 'satstats/version.py').__version__ | ||
|
||
# get the dependencies and installs | ||
with open(os.path.join(here, 'requirements.txt'), encoding='utf-8') as f: | ||
all_reqs = f.read().split('\n') | ||
|
||
install_requires = [x.strip() for x in all_reqs if 'git+' not in x] | ||
dependency_links = [x.strip().replace('git+', '') for x in all_reqs if 'git+' not in x] | ||
|
||
setup( | ||
name='sat-stats', | ||
version=__version__, | ||
author='Matthew Hanson (matthewhanson)', | ||
description='Get zonal summary stats from images that are stored remotely, without downloading entire image' | ||
url='https://github.com/sat-utils/sat-stats', | ||
license='MIT', | ||
classifiers=[ | ||
'Framework :: Pytest', | ||
'Topic :: Scientific/Engineering :: GIS', | ||
'Topic :: Scientific/Engineering', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: Science/Research', | ||
'License :: Freeware', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3.3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
], | ||
packages=find_packages(exclude=['docs', 'tests*']), | ||
include_package_data=True, | ||
install_requires=install_requires, | ||
dependency_links=dependency_links, | ||
tests_require=['nose'], | ||
) |
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,12 @@ | ||
import unittest | ||
from satstats import utils | ||
|
||
def TestUtils(unittest.TestCase): | ||
|
||
s3key = '' | ||
vectors = None | ||
|
||
def test_get_stats(self): | ||
""" Get statistics for vector """ | ||
stats = utils.get_stats(self.s3key, vectors) | ||
self.assertTrue(stats is not None) |