Skip to content

Commit 87b16fc

Browse files
author
Scisco
committed
Merge pull request #48 from developmentseed/v0.5
Version 0.5 release
2 parents 74fd0fa + 41bcfd7 commit 87b16fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+2652
-12089
lines changed

Diff for: .coveragerc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[report]
2+
omit = *third_party*

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ MANIFEST
1212
.coverage
1313
*flymake.py
1414
.settings
15+
.vagrant
16+
.pypirc
1517
metadata.csv
1618
txt.txt
19+
eva.py
20+
test.sh
21+
_build
22+
htmlcov
1723

Diff for: .travis.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
language: python
2+
3+
branches:
4+
only:
5+
- /^v0\.5.*$/
6+
7+
python:
8+
- '2.7'
9+
10+
# Setup anaconda
11+
before_install:
12+
- sudo add-apt-repository -y ppa:ubuntugis/ppa
13+
- sudo apt-get update -qq
14+
- sudo apt-get install libgdal1h gdal-bin libgdal-dev libcurl4-gnutls-dev
15+
- wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh
16+
- chmod +x miniconda.sh
17+
- ./miniconda.sh -b
18+
- export PATH=/home/travis/miniconda/bin:$PATH
19+
- conda update --yes conda
20+
# The next couple lines fix a crash with multiprocessing on Travis and are not specific to using Miniconda
21+
- sudo rm -rf /dev/shm
22+
- sudo ln -s /run/shm /dev/shm
23+
24+
# Install packages
25+
install:
26+
- conda install --yes python=$TRAVIS_PYTHON_VERSION numpy scipy matplotlib gdal scikit-image requests six nose dateutil
27+
- pip install --install-option="--no-cython-compile" cython
28+
- pip install -r requirements/travis.txt
29+
30+
script:
31+
- nosetests
32+
33+
after_success:
34+
- coveralls

Diff for: AUTHORS.txt

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Authors
2+
=======
3+
4+
Scisco https://github.com/scisco
5+
Marc Farra https://github.com/kamicut
6+
Drew Bollinger https://github.com/drewbo
7+
Alex Kappel https://twitter.com/alex_kappel
8+
Eric Miller https://github.com/millerEric
9+
Yuriy Czoli https://github.com/YKCzoli
10+
11+
See also https://github.com/developmentseed/landsat-util/graphs/contributors.

Diff for: Formula/landsat-util.rb

-22
This file was deleted.

Diff for: MANIFEST.in

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
include README.md
2-
include .gitignore
1+
include AUTHORS.txt
32
include LICENSE
4-
recursive-include landsat/assests *.prj *.sbn *.sbx
5-
recursive-include landsat/assests *.shp *.xml *.shx *.html *.txt *.dbf
6-
recursive-include doc *.html
3+
include README.md
4+
5+
recursive-include tests *
6+
recursive-exclude * __pycache__
7+
recursive-exclude * *.py[co]
8+
9+
recursive-include docs *.rst conf.py Makefile make.bat
10+
recursive-include landsat/tests/samples *.tar.bz2

Diff for: Makefile

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
.PHONY: clean-pyc clean-build docs clean
2+
3+
help:
4+
@echo "clean - remove all build, test, coverage and Python artifacts"
5+
@echo "clean-build - remove build artifacts"
6+
@echo "clean-pyc - remove Python file artifacts"
7+
@echo "clean-test - remove test and coverage artifacts"
8+
@echo "lint - check style with flake8"
9+
@echo "test - run tests quickly with the default Python"
10+
@echo "test-all - run tests on every Python version with tox"
11+
@echo "coverage - check code coverage quickly with the default Python"
12+
@echo "docs - generate Sphinx HTML documentation, including API docs"
13+
@echo "release - package and upload a release"
14+
@echo "dist - package"
15+
@echo "install - install the package to the active Python's site-packages"
16+
17+
clean: clean-build clean-pyc clean-test
18+
19+
clean-build:
20+
rm -fr build/
21+
rm -fr dist/
22+
rm -fr .eggs/
23+
find . -name '*.egg-info' -exec rm -fr {} +
24+
find . -name '*.egg' -exec rm -f {} +
25+
26+
clean-pyc:
27+
find . -name '*.pyc' -exec rm -f {} +
28+
find . -name '*.pyo' -exec rm -f {} +
29+
find . -name '*~' -exec rm -f {} +
30+
find . -name '__pycache__' -exec rm -fr {} +
31+
32+
clean-test:
33+
rm -fr .tox/
34+
rm -f .coverage
35+
rm -fr htmlcov/
36+
37+
test:
38+
nosetests
39+
40+
test-all:
41+
tox
42+
43+
coverage:
44+
coverage run --source landsat setup.py test
45+
coverage report -m
46+
coverage html
47+
open htmlcov/index.html
48+
49+
docs:
50+
rm -f docs/landsat.rst
51+
rm -f docs/modules.rst
52+
sphinx-apidoc -o docs/ landsat
53+
$(MAKE) -C docs clean
54+
$(MAKE) -C docs html
55+
open docs/_build/html/index.html
56+
57+
test-release: clean
58+
python setup.py sdist upload -r pypitest
59+
python setup.py bdist_wheel upload -r pypitest
60+
61+
vagrant:
62+
vagrant up
63+
vagrant destroy
64+
65+
release: clean
66+
python setup.py sdist upload
67+
python setup.py bdist_wheel upload
68+
69+
dist: clean
70+
python setup.py sdist
71+
python setup.py bdist_wheel
72+
ls -l dist
73+
74+
install: clean
75+
python setup.py install

Diff for: README.rst

+49-45
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
Landsat-util
22
===============
33

4+
.. image:: https://travis-ci.org/developmentseed/landsat-util.svg?branch=v0.5
5+
:target: https://travis-ci.org/developmentseed/landsat-util
6+
47
Landsat-util is a command line utility that makes it easy to search, download, and process Landsat imagery.
58

69
This tool uses Development Seed's `API for Landsat Metadata <https://github.com/developmentseed/landsat-api>`_.
710

8-
This API is accessible here: http://api.developmentseed.com:8000/landsat
11+
This API is accessible here: https://api.developmentseed.org/landsat
912

1013
You can also run your own API and connect it to this tool.
1114

@@ -14,48 +17,38 @@ Installation
1417

1518
**On Mac**
1619

17-
Use brew to install landsat-util:
18-
1920
.. code-block:: console
2021
21-
$: brew install https://raw.githubusercontent.com/developmentseed/landsat-util/master/Formula/landsat-util.rb
22+
$: pip install landsat-util
2223
23-
For the dev version try:
24-
25-
.. code-block:: console
24+
**On Ubuntu 14.04**
2625

27-
$: brew install https://raw.githubusercontent.com/developmentseed/landsat-util/master/Formula/landsat-util.rb --HEAD
28-
29-
**On Ubuntu**
30-
31-
Use pip to install landsat-util:
26+
Use pip to install landsat-util. If you are not using virtualenv, you might have to run ``pip`` as ``sudo``.
3227

3328
.. code-block:: console
3429
35-
$: sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
3630
$: sudo apt-get update
37-
$: sudo apt-get install git python-pip build-essential libssl-dev libffi-dev python-dev python-gdal libgdal1-dev gdal-bin imagemagick geotiff-bin -y
38-
$: sudo pip install -U git+git://github.com/developmentseed/landsat-util.git
31+
$: sudo apt-get install python-pip python-numpy python-scipy libgdal-dev libatlas-base-dev gfortran
32+
$: pip install landsat-util
3933
4034
**On Other systems**
4135

42-
Make sure you have these dependencies:
36+
.. code-block:: console
37+
38+
$: python setup.py install
4339
44-
- GDAL
45-
- ImageMagick
46-
- Orfeo-40
4740
48-
Then Run:
41+
**To Upgrade**
4942

5043
.. code-block:: console
5144
52-
$: pip install -U git+git://github.com/developmentseed/landsat-util.git
45+
$: pip install -U landsat-util
5346
54-
Alternatively, you can also download the package and run:
47+
If you have installed previous version of landsat using brew, first run:
5548

5649
.. code-block:: console
5750
58-
$: python setup.py install
51+
$: brew uninstall landsat-util
5952
6053
Overview: What can landsat-util do?
6154
============
@@ -65,7 +58,7 @@ Landsat-util has three main functions:
6558
- **Download** landsat images.
6659
- **Image processing** and pan sharpening on landsat images.
6760

68-
These three functions can be performed separately or all at once.
61+
These three functions have to be performed separately.
6962

7063
**Help**: Type ``landsat -h`` for detailed usage parameters.
7164

@@ -77,8 +70,7 @@ Search returns information about all landsat tiles that match your criteria. Th
7770
Search for landsat tiles in a given geographical region, using any of the following:
7871

7972
- **Paths and rows**: If you know the paths and rows you want to search for.
80-
- **Country name**: If you know what country you want imagery for.
81-
- **Custom shapefile**: Use a tool such as http://geojson.io/ to generate custom shapefiles bounding your geographical region of interest. Landsat-util will download tiles within this shapefile.
73+
- **Latidue and Longitude**: If you need the latitude and longitude of the point you want to search for.
8274

8375
Additionally filter your search using the following parameters:
8476

@@ -89,69 +81,81 @@ Additionally filter your search using the following parameters:
8981

9082
Search by path and row:
9183

92-
``$: landsat search --cloud 4 --start "january 1 2014" --end "january 10 2014" pr 009 045``
84+
``$: landsat search --cloud 4 --start "january 1 2014" --end "january 10 2014" -p 009,045``
9385

94-
Search by country (The full list of countries is http://goo.gl/8H9wuq):
86+
Search by latitude and longitude:
9587

96-
``$: landsat search --cloud 4 --start "january 1 2014" --end "August 25 2014" country 'Isle of Man'``
88+
``$: landsat search --lat 38.9004204 --lon -77.0237117``
9789

98-
Search by custom shapefile:
99-
100-
``$: landsat search --cloud 6 --start "july 01 2014" --end "august 1 2014" shapefile path/to/shapefile.shp``
10190

10291
Step 2: Download
10392
============
10493

10594
You can download tiles using their unique sceneID, which you get from landsat search.
10695

96+
Landsat-util will download a zip file that includes all the bands. You have the option of specifying the bands you want to down. In this case, landsat-util only downloads those bands if they are available online.
97+
10798
**Examples of download**:
10899

109100
Download images by their custom sceneID, which you get from landsat search:
110101

111102
``$: landsat download LC80090452014008LGN00``
112103

113-
Search and download tiles all at once with the --download flag:
104+
Download only band 4, 3 and 2 for a particular sceneID:
105+
106+
``$: landsat download LC80090452014008LGN00 --bands 432``
114107

115-
``$: landsat search --download --cloud 4 --start "january 01 2014" --end "january 10 2014" pr 009 045``
108+
Download multiple sceneIDs:
109+
110+
``$: landsat download LC80090452014008LGN00 LC80090452015008LGN00 LC80090452013008LGN00``
116111

117112
Step 3: Image processing
118113
============
119114

120-
You can process your downloaded tiles with our custom image processing algorithms. In addition, you can choose to pansharpen your images.
115+
You can process your downloaded tiles with our custom image processing algorithms. In addition, you can choose to pansharpen your images and specify which bands to process.
121116

122117
**Examples of image processing**:
123118

124-
Process images that are already downloaded. Remember, the program only accepts zip files:
119+
Process images that are already downloaded. Remember, the program accepts both zip files and unzipped folders:
125120

126121
``$: landsat process path/to/LC80090452014008LGN00.tar.bz``
127122

128-
Process *and* pansharpen a downloaded image:
123+
If unzipped:
129124

130-
``$: landsat process --pansharpen path/to/LC80090452014008LGN00.tar.bz``
125+
``$: landsat process path/to/LC80090452014008LGN00``
131126

132-
Search, download, and process images all at once using the --imageprocess flag:
127+
Specify bands 3, 5 and 1:
133128

134-
``$: landsat search --imageprocess --cloud 6 --start "january 01 2014" --end "january 10 2014" shapefile path/to/shapefile.shp``
129+
``$: landsat process path/to/LC80090452014008LGN00 --bands 351``
130+
131+
Process *and* pansharpen a downloaded image:
132+
133+
``$: landsat process path/to/LC80090452014008LGN00.tar.bz --pansharpen``
135134

136135

137136
Important Notes
138137
===============
139138

140139
- All downloaded and processed images are stored at your home directory in landsat forlder: ``~/landsat``
141140

142-
- If you are not sure what images you are looking for, make sure to use ``--onlysearch`` flag to view the results first. The image thumbnail web address that is included in the results can be used to make sure that clouds are not obscuring the subject of interest. Run the search again if you need to narrow down your result and then start downloading images. Each image is usually more than 700mb and it might takes a very long time if there are too many images to download
141+
- The image thumbnail web address that is included in the results can be used to make sure that clouds are not obscuring the subject of interest. Run the search again if you need to narrow down your result and then start downloading images. Each image is usually more than 700mb and it might takes a very long time if there are too many images to download
143142

144-
- Image processing is a very heavy and resource consuming task. Each process takes about 20-30 mins. We recommend that you run the processes in smaller badges. Pansharpening, while increasing image resolution 2x, substantially increases processing time.
143+
- Image processing is a very heavy and resource consuming task. Each process takes about 5-10 mins. We recommend that you run the processes in smaller badges. Pansharpening, while increasing image resolution 2x, substantially increases processing time.
145144

146-
- Country based search queries can return a large number of images; for countries that return large search results we recommend selecting best imagery based on thumbnails and then using the download tool to install specific imagery based on Landsat scene ID.
145+
- Landsat-util requires at least 2GB of Memory (RAM).
147146

148-
To Do List
147+
Recently Added
149148
++++++++++
150149

151150
- Add longitude latitude search
152-
- Add Sphinx Documentation
153151
- Improve console output
154152
- Add more color options such as false color, true color, etc.
153+
154+
155+
To Do List
156+
++++++++++
157+
158+
- Add Sphinx Documentation
155159
- Add capacity for NDVI output
156160
- Add alternative projections (currently only option is default web-mercator; EPSG: 3857)
157161
- Connect search to Google Address API

0 commit comments

Comments
 (0)