rio-tiler


Namerio-tiler JSON
Version 1.0a6 PyPI version JSON
download
home_pagehttps://github.com/mapbox/rio-tiler
SummaryGet mercator tile from landsat, sentinel or other AWS hosted raster
upload_time2018-03-29 20:11:30
maintainer
docs_urlNone
authorVincent Sarago
requires_python
licenseBSD
keywords raster aws tiler gdal rasterio
VCS
bugtrack_url
requirements numpy numexpr Pillow mercantile boto3 rasterio rio-toa rio-pansharpen
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =========
Rio-tiler
=========

Rasterio plugin to create mercator tiles from raster sources.

.. image:: https://circleci.com/gh/mapbox/rio-tiler.svg?style=svg&circle-token=b78bc1a238c21046a855a9c80b441a8f2f9a4478
   :target: https://circleci.com/gh/mapbox/rio-tiler

.. image:: https://codecov.io/gh/mapbox/rio-tiler/branch/master/graph/badge.svg?token=zuHupC20cG
   :target: https://codecov.io/gh/mapbox/rio-tiler

Additional support is provided for the following satellite missions:

* Sentinel 2
* Landsat 8
* CBERS

Rio-tiler supports Python 2.7 and 3.3-3.6.


Install
=======

You can install rio-tiler using pip

.. code-block:: console

    $ pip install -U pip
    $ pip install rio-tiler

or install from source:

.. code-block:: console

    $ git clone https://github.com/mapbox/rio-tiler.git
    $ cd rio-tiler
    $ pip install -U pip
    $ pip install -e .

here is how to create an AWS Lambda package on most UNIX machines:

.. code-block:: console

    # On a centos machine
    $ pip install rio-tiler --no-binary numpy -t /tmp/vendored -U
    $ zip -r9q package.zip vendored/*

Overview
========

Create tiles using one of these rio_tiler modules: :code:`main`, :code:`sentinel2`, :code:`landsat8`, :code:`cbers`.

The :code:`main` module can create mercator tiles from any raster source supported by Rasterio (i.e. local files, http, etc.). The mission specific modules make it easier to extract tiles from AWS S3 buckets (i.e. only a scene ID is required); They can also be used to return metadata.

All of the tiling modules can return the original image bounds.

Usage
=====

Get a Sentinel2 tile and its mask (if any).

.. code-block:: python

   from rio_tiler import sentinel2
   tile, mask = sentinel2.tile('S2A_tile_20170729_19UDP_0', 77, 89, 8)
   tile.shape
   # (3, 256, 256)

Create image from tile

.. code-block:: python

   from rio_tiler.utils import array_to_img
   img = array_to_img(tile, mask=mask) # this returns a pillow image

Convert image into base64 encoded string (PNG or JPEG)

.. code-block:: python

   from rio_tiler.utils import b64_encode_img
   str_img = b64_encode_img(img, 'jpeg')

Get bounds for a Landsat scene (WGS84).

.. code-block:: python

   from rio_tiler import landsat8
   landsat8.bounds('LC08_L1TP_016037_20170813_20170814_01_RT')
   # {'bounds': [-81.30836, 32.10539, -78.82045, 34.22818], 
   #  'sceneid': 'LC08_L1TP_016037_20170813_20170814_01_RT'}

Get metadata of a Landsat scene (i.e. percentinle min and max values, and bounds in WGS84) .

.. code-block:: python

   from rio_tiler import landsat8
   landsat8.metadata('LC08_L1TP_016037_20170813_20170814_01_RT', pmin=5, pmax=95)
   #  {'bounds': [-81.30836, 32.10539, -78.82045, 34.22818],
   #   'rgbMinMax': {'1': [1245, 5396],
   #    '2': [983, 5384],
   #    '3': [718, 5162],
   #    '4': [470, 5273],
   #    '5': [403, 6440],
   #    '6': [258, 4257],
   #    '7': [151, 2984]},
   #   'sceneid': 'LC08_L1TP_016037_20170813_20170814_01_RT'}

The primary purpose for calculating minimum and maximum values of an image is to rescale pixel values from their original range (e.g. 0 to 65,535) to the range used by computer screens (i.e. 0 and 255) through a linear transformation. This will make images look good on display.

The Datasets
------------

* Sentinel2_
* Landsat8_
* CBERS_

.. _Sentinel2: http://sentinel-pds.s3-website.eu-central-1.amazonaws.com
.. _Landsat8: https://aws.amazon.com/fr/public-datasets/landsat
.. _CBERS: https://aws.amazon.com/blogs/publicsector/the-china-brazil-earth-resources-satellite-mission/

License
-------

See `LICENSE.txt <LICENSE.txt>`__.

Authors
-------

See `AUTHORS.txt <AUTHORS.txt>`__.

Changes
-------

See `CHANGES.txt <CHANGES.txt>`__.
            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "cheesecake_code_kwalitee_id": null, 
    "keywords": "raster aws tiler gdal rasterio", 
    "upload_time": "2018-03-29 20:11:30", 
    "requirements": [
        {
            "name": "numpy", 
            "specs": []
        }, 
        {
            "name": "numexpr", 
            "specs": []
        }, 
        {
            "name": "Pillow", 
            "specs": []
        }, 
        {
            "name": "mercantile", 
            "specs": []
        }, 
        {
            "name": "boto3", 
            "specs": []
        }, 
        {
            "name": "rasterio", 
            "specs": [
                [
                    ">=", 
                    "1.0a12"
                ]
            ]
        }, 
        {
            "name": "rio-toa", 
            "specs": []
        }, 
        {
            "name": "rio-pansharpen", 
            "specs": []
        }
    ], 
    "author": "Vincent Sarago", 
    "home_page": "https://github.com/mapbox/rio-tiler", 
    "github_user": "mapbox", 
    "download_url": "https://pypi.python.org/packages/42/be/919b35182b719e238e25befacc2ca52fbea936d2419f5a02e59c0584d052/rio_tiler-1.0a6.tar.gz", 
    "platform": "", 
    "version": "1.0a6", 
    "cheesecake_documentation_id": null, 
    "description": "=========\nRio-tiler\n=========\n\nRasterio plugin to create mercator tiles from raster sources.\n\n.. image:: https://circleci.com/gh/mapbox/rio-tiler.svg?style=svg&circle-token=b78bc1a238c21046a855a9c80b441a8f2f9a4478\n   :target: https://circleci.com/gh/mapbox/rio-tiler\n\n.. image:: https://codecov.io/gh/mapbox/rio-tiler/branch/master/graph/badge.svg?token=zuHupC20cG\n   :target: https://codecov.io/gh/mapbox/rio-tiler\n\nAdditional support is provided for the following satellite missions:\n\n* Sentinel 2\n* Landsat 8\n* CBERS\n\nRio-tiler supports Python 2.7 and 3.3-3.6.\n\n\nInstall\n=======\n\nYou can install rio-tiler using pip\n\n.. code-block:: console\n\n    $ pip install -U pip\n    $ pip install rio-tiler\n\nor install from source:\n\n.. code-block:: console\n\n    $ git clone https://github.com/mapbox/rio-tiler.git\n    $ cd rio-tiler\n    $ pip install -U pip\n    $ pip install -e .\n\nhere is how to create an AWS Lambda package on most UNIX machines:\n\n.. code-block:: console\n\n    # On a centos machine\n    $ pip install rio-tiler --no-binary numpy -t /tmp/vendored -U\n    $ zip -r9q package.zip vendored/*\n\nOverview\n========\n\nCreate tiles using one of these rio_tiler modules: :code:`main`, :code:`sentinel2`, :code:`landsat8`, :code:`cbers`.\n\nThe :code:`main` module can create mercator tiles from any raster source supported by Rasterio (i.e. local files, http, etc.). The mission specific modules make it easier to extract tiles from AWS S3 buckets (i.e. only a scene ID is required); They can also be used to return metadata.\n\nAll of the tiling modules can return the original image bounds.\n\nUsage\n=====\n\nGet a Sentinel2 tile and its mask (if any).\n\n.. code-block:: python\n\n   from rio_tiler import sentinel2\n   tile, mask = sentinel2.tile('S2A_tile_20170729_19UDP_0', 77, 89, 8)\n   tile.shape\n   # (3, 256, 256)\n\nCreate image from tile\n\n.. code-block:: python\n\n   from rio_tiler.utils import array_to_img\n   img = array_to_img(tile, mask=mask) # this returns a pillow image\n\nConvert image into base64 encoded string (PNG or JPEG)\n\n.. code-block:: python\n\n   from rio_tiler.utils import b64_encode_img\n   str_img = b64_encode_img(img, 'jpeg')\n\nGet bounds for a Landsat scene (WGS84).\n\n.. code-block:: python\n\n   from rio_tiler import landsat8\n   landsat8.bounds('LC08_L1TP_016037_20170813_20170814_01_RT')\n   # {'bounds': [-81.30836, 32.10539, -78.82045, 34.22818], \n   #  'sceneid': 'LC08_L1TP_016037_20170813_20170814_01_RT'}\n\nGet metadata of a Landsat scene (i.e. percentinle min and max values, and bounds in WGS84) .\n\n.. code-block:: python\n\n   from rio_tiler import landsat8\n   landsat8.metadata('LC08_L1TP_016037_20170813_20170814_01_RT', pmin=5, pmax=95)\n   #  {'bounds': [-81.30836, 32.10539, -78.82045, 34.22818],\n   #   'rgbMinMax': {'1': [1245, 5396],\n   #    '2': [983, 5384],\n   #    '3': [718, 5162],\n   #    '4': [470, 5273],\n   #    '5': [403, 6440],\n   #    '6': [258, 4257],\n   #    '7': [151, 2984]},\n   #   'sceneid': 'LC08_L1TP_016037_20170813_20170814_01_RT'}\n\nThe primary purpose for calculating minimum and maximum values of an image is to rescale pixel values from their original range (e.g. 0 to 65,535) to the range used by computer screens (i.e. 0 and 255) through a linear transformation. This will make images look good on display.\n\nThe Datasets\n------------\n\n* Sentinel2_\n* Landsat8_\n* CBERS_\n\n.. _Sentinel2: http://sentinel-pds.s3-website.eu-central-1.amazonaws.com\n.. _Landsat8: https://aws.amazon.com/fr/public-datasets/landsat\n.. _CBERS: https://aws.amazon.com/blogs/publicsector/the-china-brazil-earth-resources-satellite-mission/\n\nLicense\n-------\n\nSee `LICENSE.txt <LICENSE.txt>`__.\n\nAuthors\n-------\n\nSee `AUTHORS.txt <AUTHORS.txt>`__.\n\nChanges\n-------\n\nSee `CHANGES.txt <CHANGES.txt>`__.", 
    "lcname": "rio-tiler", 
    "bugtrack_url": null, 
    "github": true, 
    "coveralls": false, 
    "name": "rio-tiler", 
    "license": "BSD", 
    "travis_ci": false, 
    "github_project": "rio-tiler", 
    "summary": "Get mercator tile from landsat, sentinel or other AWS hosted raster", 
    "split_keywords": [
        "raster", 
        "aws", 
        "tiler", 
        "gdal", 
        "rasterio"
    ], 
    "author_email": "vincent.sarago@mapbox.com", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2018-03-29T20:11:30", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/42/be/919b35182b719e238e25befacc2ca52fbea936d2419f5a02e59c0584d052/rio_tiler-1.0a6.tar.gz", 
            "md5_digest": "e8ff2f7a6d5bfa7c39035f5085c5becb", 
            "downloads": 0, 
            "filename": "rio_tiler-1.0a6.tar.gz", 
            "packagetype": "sdist", 
            "path": "42/be/919b35182b719e238e25befacc2ca52fbea936d2419f5a02e59c0584d052/rio_tiler-1.0a6.tar.gz", 
            "digests": {
                "sha256": "77653142fea490e3419ec99a27ea79f80d7b3c5be4274a059823d840501c5102", 
                "md5": "e8ff2f7a6d5bfa7c39035f5085c5becb"
            }, 
            "sha256_digest": "77653142fea490e3419ec99a27ea79f80d7b3c5be4274a059823d840501c5102", 
            "size": 13247
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}