colormaps

This commit is contained in:
Matthew Perry 2016-03-21 11:48:10 -04:00
parent 98bedb7086
commit 8bc39de2a0
3 changed files with 53 additions and 11 deletions

View File

@ -1,11 +1,47 @@
Color
*****
color interpretation
--------------------
Color interpretation
^^^^^^^^^^^^^^^^^^^^^
Color interpretation of raster bands can be read from the dataset
.. code-block:: python
>>> src.colorinterp(1)
<ColorInterp.red: 3>
GDAL builds the color interpretation based on the driver and creation options.
With the ``GTiff`` driver, rasters with exactly 3 bands of uint8 type will be RGB,
4 bands of uint8 will be RGBA by default.
You cannot set the color interpretation on existing data but you can
specify a ``photometric`` string when writing a new raster.
.. code:: python
>>> src.profile['dtype']
'uint16'
>>> src.colorinterp(2)
<ColorInterp.undefined: 0>
>>> profile = src.profile
>>> profile['photometric'] = "RGB"
>>> with rasterio.open("test.tif", 'w', **profile) as dst:
dst.write(src.read())
And the resulting raster will be interpretted as RGB despite having uint16 bands
.. code:: python
>>> src.profile['dtype']
'uint16'
>>> src.colorinterp(2)
<ColorInterp.green: 4>
Colormaps
---------
^^^^^^^^^
Writing colormaps
-----------------

View File

@ -10,29 +10,34 @@ Community
Who is using rasterio?
----------------------
This study compares map algebra tools of the proprietary ESRI ArcPy library and the open source Rasterio library.
https://github.com/alfalimajuliett/masters-thesis
* `Mapbox`_ uses rasterio to process satellite imagery for it's global satellite base maps.
* Mary Marek-Spartz's masters thesis compares the map algebra tools of the proprietary ESRI ArcPy library and the open source Rasterio library. https://github.com/alfalimajuliett/masters-thesis
Software built on rasterio
--------------------------
The following software projects use rasterio
* pyimpute
* rasterstats
Rio plugins
------------
In addition to the core ``rio`` commands, visit the `Rio plugin registry`_ for a list of external plugins.
Code of conduct
---------------
.. include:: ../CODE_OF_CONDUCT.md
Developers guide
-----------------------
.. todo::
Who are the rasterio developers?
--------------------------------
Everything developers need to know to get a dev environment running,
run tests, modify code and submit a successful PR.
.. include:: ../AUTHORS.txt
Does this belong here? or a separate docs?
.. _Mapbox: https://mapbox.com
.. _Rio plugin registry: https://github.com/mapbox/rasterio/wiki/Rio-plugin-registry

View File

@ -22,4 +22,5 @@ This user's manual is for Python developers who want a clean API for accessing r
writing
topics
osgeo_gdal_migration
developers
cookbook