├── .gitignore
├── .pre-commit-config.yaml
├── .travis.yml
├── CHANGES.txt
├── LICENSE
├── MANIFEST.in
├── README.md
├── codecov.yml
├── preview.png
├── requirements.txt
├── rio_glui
├── __init__.py
├── raster.py
├── scripts
│ ├── __init__.py
│ └── cli.py
├── server.py
├── static
│ ├── jquery-3.3.1.min.js
│ └── jquery.console.js
└── templates
│ ├── index.html
│ └── playground.html
├── setup.py
├── tests
├── fixtures
│ ├── 16-21560-29773_small.tif
│ ├── 16-21560-29773_small_ycbcr.tif
│ ├── internal_nodata.tif
│ └── ndvi_cogeo.tif
├── test_cli.py
├── test_raster.py
└── test_server.py
└── tox.ini
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 |
5 | # C extensions
6 | *.so
7 |
8 | # Distribution / packaging
9 | .Python
10 | env/
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | lib/
17 | lib64/
18 | parts/
19 | sdist/
20 | var/
21 | *.egg-info/
22 | .installed.cfg
23 | *.egg
24 |
25 | # PyInstaller
26 | # Usually these files are written by a python script from a template
27 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
28 | *.manifest
29 | *.spec
30 |
31 | # Installer logs
32 | pip-log.txt
33 | pip-delete-this-directory.txt
34 |
35 | # Unit test / coverage reports
36 | htmlcov/
37 | .tox/
38 | .coverage
39 | .cache
40 | nosetests.xml
41 | coverage.xml
42 |
43 | # Translations
44 | *.mo
45 | *.pot
46 |
47 | # Django stuff:
48 | *.log
49 |
50 | # Sphinx documentation
51 | docs/_build/
52 |
53 | # PyBuilder
54 | target/
55 |
56 | # OS X
57 | .DS_Store
58 |
59 | # Pyenv
60 | .python-version
61 |
62 | .*.swp
63 |
64 | .pytest_cache/
65 | venv/
66 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 |
2 | repos:
3 | -
4 | repo: 'https://github.com/ambv/black'
5 | # 18.6b1
6 | rev: ed50737290662f6ef4016a7ea44da78ee1eff1e2
7 | hooks:
8 | - id: black
9 | args: ['--safe']
10 | language_version: python3.6
11 | -
12 | repo: 'https://github.com/pre-commit/pre-commit-hooks'
13 | # v1.3.0
14 | rev: a6209d8d4f97a09b61855ea3f1fb250f55147b8b
15 | hooks:
16 | - id: flake8
17 | language_version: python3.6
18 | args: [
19 | # E501 let black handle all line length decisions
20 | # W503 black conflicts with "line break before operator" rule
21 | # E203 black conflicts with "whitespace before ':'" rule
22 | '--ignore=E501,W503,E203']
23 | -
24 | repo: 'https://github.com/chewse/pre-commit-mirrors-pydocstyle'
25 | # 2.1.1
26 | rev: 22d3ccf6cf91ffce3b16caa946c155778f0cb20f
27 | hooks:
28 | - id: pydocstyle
29 | language_version: python3.6
30 | args: [
31 | # Check for docstring presence only
32 | '--select=D1',
33 | # Don't require docstrings for tests
34 | '--match=(?!test).*\.py']
35 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: python
2 | sudo: false
3 | cache:
4 | directories:
5 | - ~/.cache/pip
6 |
7 | matrix:
8 | include:
9 | - python: 2.7
10 | env: TOXENV=py27
11 | - python: 3.6
12 | env: TOXENV=py36
13 | #- python: 3.7
14 | # env: TOXENV=py37
15 |
16 | before_install:
17 | - python -m pip install -U pip
18 | install:
19 | - python -m pip install codecov pre-commit tox
20 | script:
21 | - if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then pre-commit run --all-files; fi
22 | - tox
23 | after_success:
24 | - if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then coverage xml; codecov; fi
25 |
--------------------------------------------------------------------------------
/CHANGES.txt:
--------------------------------------------------------------------------------
1 | 1.0.6 (2019-02-14)
2 | ------------------
3 | - update for rio-tiler >= 1.0 (#35)
4 | - Add non-integer nodata option and add better test
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Mapbox
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include rio_glui/static/*
2 | include rio_glui/templates/*
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # rio-glui
2 |
3 | [](https://badge.fury.io/py/rio-glui)
4 |
5 | [](https://travis-ci.org/mapbox/rio-glui)
6 |
7 | [](https://codecov.io/gh/mapbox/rio-glui)
8 |
9 | Explore and adjust Cloud-optimized geotiffs
10 | ([COGs](https://www.cogeo.org/)) in your browser using
11 | [rasterio](https://rasterio.readthedocs.io/en/stable/) and [Mapbox
12 | GL JS](https://docs.mapbox.com/mapbox-gl-js/guides/).
13 |
14 |
15 |
16 | ## Install
17 |
18 | You can install rio-glui using pip
19 |
20 | ```sh
21 | pip install -U pip
22 | pip install rio-glui
23 | ```
24 |
25 | or install from source:
26 |
27 | ```sh
28 | git clone https://github.com/mapbox/rio-glui.git
29 | cd rio-glui
30 | pip install -e .
31 | ```
32 |
33 | ## Usage
34 |
35 | ``` console
36 | Usage: rio glui [OPTIONS] PATH
37 |
38 | Rasterio glui cli.
39 |
40 | Options:
41 | -b, --bidx BIDX Raster band index
42 | --scale INTEGER Min Max Min and Max data bounds to rescale data from.
43 | --colormap [cfastie|schwarzwald] Rio-tiler compatible colormap name ('cfastie' or 'schwarzwald')
44 | --tiles-format [png|jpg|webp] Tile image format (default: png)
45 | --tiles-dimensions INTEGER Dimension of images being served (default: 512)
46 | --nodata INTEGER Force mask creation from a given nodata value
47 | --gl-tile-size INTEGER mapbox-gl tileSize (default is the same as `tiles-dimensions`)
48 | --port INTEGER Webserver port (default: 8080)
49 | --playground Launch playground app
50 | --mapbox-token TOKEN Pass Mapbox token
51 | --help Show this message and exit.
52 | ```
53 |
54 | Example: explore COG hosted on aws
55 |
56 | ```sh
57 | rio glui https://.s3.amazonaws.com/