Document driver options.

This commit is contained in:
Sean Gillies 2014-03-14 21:25:30 -06:00
parent fc296b5456
commit 4e428c13d6
3 changed files with 25 additions and 1 deletions

22
docs/options.rst Normal file
View File

@ -0,0 +1,22 @@
Options
=======
GDAL's format drivers have many [configuration
options](https://trac.osgeo.org/gdal/wiki/ConfigOptions) The way to set options
for rasterio is via ``rasterio.drivers()``. Options set on entering are deleted
on exit.
.. code-block:: python
import rasterio
with rasterio.drivers(GDAL_TIFF_INTERNAL_MASK=True):
# GeoTIFFs written here will have internal masks, not the
# .msk sidecars.
...
# Option is gone and the default (False) returns.
Use native Python forms (``True`` and ``False``) for boolean options. Rasterio
will convert them GDAL's internal forms.

View File

@ -48,7 +48,7 @@ def driver_count():
cdef class GDALEnv(object):
cdef object is_chef
cdef object options
cdef public object options
def __init__(self, is_chef=True, **options):
self.is_chef = is_chef

View File

@ -4,6 +4,8 @@ import sys
if sys.version_info[0] >= 3:
string_types = str,
text_type = str
integer_types = int,
else:
string_types = basestring,
text_type = unicode
integer_types = int, long