mapbox -> rasterio (#2321)

This commit is contained in:
Vincent Sarago 2021-10-22 17:04:05 +02:00 committed by GitHub
parent f2adb89157
commit ba5e90c487
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 64 additions and 68 deletions

View File

@ -6,5 +6,5 @@ below:
organization = {Mapbox}, organization = {Mapbox},
title = {Rasterio: geospatial raster I/O for {Python} programmers}, title = {Rasterio: geospatial raster I/O for {Python} programmers},
year = {2013--}, year = {2013--},
url = "https://github.com/mapbox/rasterio" url = "https://github.com/rasterio/rasterio"
} }

View File

@ -16,13 +16,13 @@ Issue Conventions
The Rasterio issue tracker is for actionable issues. The Rasterio issue tracker is for actionable issues.
Questions about installation, distribution, and usage should be taken to Questions about installation, distribution, and usage should be taken to
the project's `general discussion group the project's `general discussion group
<https://rasterio.groups.io/g/main>`__. Opened issues which fall into one <https://rasterio.groups.io/g/main>`__. Opened issues which fall into one
of these three categories may be perfunctorily closed. of these three categories may be perfunctorily closed.
Questions about development of Rasterio, brainstorming, requests for comment, Questions about development of Rasterio, brainstorming, requests for comment,
and not-yet-actionable proposals are welcome in the project's and not-yet-actionable proposals are welcome in the project's
`developers discussion group <https://rasterio.groups.io/g/dev>`__. Issues `developers discussion group <https://rasterio.groups.io/g/dev>`__. Issues
opened in Rasterio's GitHub repo which haven't been socialized there may be opened in Rasterio's GitHub repo which haven't been socialized there may be
perfunctorily closed. perfunctorily closed.
@ -69,7 +69,7 @@ is *dataset object*. A dataset object might be an instance of `DatasetReader`
or `DatasetWriter`. The canonical way to create a dataset object is by using the or `DatasetWriter`. The canonical way to create a dataset object is by using the
`rasterio.open()` function. `rasterio.open()` function.
This is analogous to Python's use of This is analogous to Python's use of
`file object <https://docs.python.org/3/glossary.html#term-file-object>`__. `file object <https://docs.python.org/3/glossary.html#term-file-object>`__.
Git Conventions Git Conventions
@ -104,7 +104,7 @@ Tests are mandatory for new code. We use `pytest <https://pytest.org>`__. Use
pytest's parameterization feature. pytest's parameterization feature.
We aspire to 100% coverage for Python modules but coverage of the Cython code is We aspire to 100% coverage for Python modules but coverage of the Cython code is
a future aspiration (`#515 <https://github.com/mapbox/rasterio/issues/515>`__). a future aspiration (`#515 <https://github.com/rasterio/rasterio/issues/515>`__).
Use `darker <https://pypi.org/project/darker/>`_ to reformat code as you change it. Use `darker <https://pypi.org/project/darker/>`_ to reformat code as you change it.
We aren't going to run black on everything all at once. We aren't going to run black on everything all at once.
@ -132,7 +132,7 @@ First, clone Rasterio's ``git`` repo:
.. code-block:: console .. code-block:: console
$ git clone https://github.com/mapbox/rasterio $ git clone https://github.com/rasterio/rasterio
Development should occur within a `virtual environment Development should occur within a `virtual environment
<http://docs.python-guide.org/en/latest/dev/virtualenvs/>`__ to better isolate <http://docs.python-guide.org/en/latest/dev/virtualenvs/>`__ to better isolate

View File

@ -4,8 +4,8 @@ Rasterio
Rasterio reads and writes geospatial raster data. Rasterio reads and writes geospatial raster data.
.. image:: https://app.travis-ci.com/mapbox/rasterio.svg?branch=master .. image:: https://app.travis-ci.com/rasterio/rasterio.svg?branch=master
:target: https://app.travis-ci.com/mapbox/rasterio :target: https://app.travis-ci.com/rasterio/rasterio
.. image:: https://coveralls.io/repos/github/mapbox/rasterio/badge.svg?branch=master .. image:: https://coveralls.io/repos/github/mapbox/rasterio/badge.svg?branch=master
:target: https://coveralls.io/github/mapbox/rasterio?branch=master :target: https://coveralls.io/github/mapbox/rasterio?branch=master
@ -107,7 +107,7 @@ Rasterio CLI
============ ============
Rasterio's command line interface, named "rio", is documented at `cli.rst Rasterio's command line interface, named "rio", is documented at `cli.rst
<https://github.com/mapbox/rasterio/blob/master/docs/cli.rst>`__. Its ``rio <https://github.com/rasterio/rasterio/blob/master/docs/cli.rst>`__. Its ``rio
insp`` command opens the hood of any raster dataset so you can poke around insp`` command opens the hood of any raster dataset so you can poke around
using Python. using Python.
@ -151,11 +151,11 @@ Rio Plugins
----------- -----------
Rio provides the ability to create subcommands using plugins. See Rio provides the ability to create subcommands using plugins. See
`cli.rst <https://github.com/mapbox/rasterio/blob/master/docs/cli.rst#rio-plugins>`__ `cli.rst <https://github.com/rasterio/rasterio/blob/master/docs/cli.rst#rio-plugins>`__
for more information on building plugins. for more information on building plugins.
See the See the
`plugin registry <https://github.com/mapbox/rasterio/wiki/Rio-plugin-registry>`__ `plugin registry <https://github.com/rasterio/rasterio/wiki/Rio-plugin-registry>`__
for a list of available plugins. for a list of available plugins.
@ -310,7 +310,7 @@ Rasterio is a Python C extension and to build you'll need a working compiler
required to run the rasterio setup script. Numpy has to be installed (via the required to run the rasterio setup script. Numpy has to be installed (via the
indicated requirements file) before rasterio can be installed. See rasterio's indicated requirements file) before rasterio can be installed. See rasterio's
Travis `configuration Travis `configuration
<https://github.com/mapbox/rasterio/blob/master/.travis.yml>`__ for more <https://github.com/rasterio/rasterio/blob/master/.travis.yml>`__ for more
guidance. guidance.
Linux Linux
@ -392,12 +392,6 @@ the time to craft a clear question and be patient about responses.
Please do not bring these questions to Rasterio's issue tracker, which we want Please do not bring these questions to Rasterio's issue tracker, which we want
to reserve for bug reports and other actionable issues. to reserve for bug reports and other actionable issues.
While Rasterio's repo is in the Mapbox GitHub organization, Mapbox's Support
team is focused on customer support for its commercial platform and Rasterio
support requests may be perfunctorily closed with or without a link to
https://rasterio.groups.io/g/main. It's better to bring questions directly to
the main Rasterio group at groups.io.
Development and Testing Development and Testing
======================= =======================
@ -416,6 +410,8 @@ See `LICENSE.txt <LICENSE.txt>`__.
Authors Authors
======= =======
The `rasterio` project was begun at Mapbox and was transferred to the `rasterio` Github organization in October 2021.
See `AUTHORS.txt <AUTHORS.txt>`__. See `AUTHORS.txt <AUTHORS.txt>`__.
Changes Changes

View File

@ -694,7 +694,7 @@ To use these plugins with rio, add the commands to the
and in ``rasterio/rio/main.py``. and in ``rasterio/rio/main.py``.
See the See the
`plugin registry <https://github.com/mapbox/rasterio/wiki/Rio-plugin-registry>`__ `plugin registry <https://github.com/rasterio/rasterio/wiki/Rio-plugin-registry>`__
for a list of available plugins. for a list of available plugins.

View File

@ -6,10 +6,10 @@ Contributing
Additional Information Additional Information
---------------------- ----------------------
More technical information lives on the wiki. More technical information lives on the wiki.
* https://github.com/mapbox/rasterio/wiki/Development-Guide * https://github.com/rasterio/rasterio/wiki/Development-Guide
* https://github.com/mapbox/rasterio/wiki/Exposing-GDAL-Functionality * https://github.com/rasterio/rasterio/wiki/Exposing-GDAL-Functionality
* https://github.com/mapbox/rasterio/wiki/Cython-and-GDAL * https://github.com/rasterio/rasterio/wiki/Cython-and-GDAL
The long term goal is to consolidate into this document. The long term goal is to consolidate into this document.

View File

@ -20,7 +20,7 @@ OS X
**** ****
Binary wheels with the GDAL, GEOS, and PROJ4 libraries included are available Binary wheels with the GDAL, GEOS, and PROJ4 libraries included are available
for OS X versions 10.7+ starting with Rasterio version 0.17. To install, for OS X versions 10.7+ starting with Rasterio version 0.17. To install,
run ``pip install rasterio``. These binary wheels are preferred by newer run ``pip install rasterio``. These binary wheels are preferred by newer
versions of pip. If you don't want these wheels and want to install from versions of pip. If you don't want these wheels and want to install from
a source distribution, run ``pip install rasterio --no-binary`` instead. a source distribution, run ``pip install rasterio --no-binary`` instead.
@ -45,7 +45,7 @@ this from the downloads folder:
.. code-block:: console .. code-block:: console
$ pip install -U pip $ pip install -U pip
$ pip install GDAL-1.11.2-cp27-none-win32.whl $ pip install GDAL-1.11.2-cp27-none-win32.whl
$ pip install rasterio-0.24.0-cp27-none-win32.whl $ pip install rasterio-0.24.0-cp27-none-win32.whl
@ -56,7 +56,7 @@ Installing with Anaconda
To install rasterio on the Anaconda Python distribution, please visit the To install rasterio on the Anaconda Python distribution, please visit the
`rasterio conda-forge`_ page for install instructions. This build is maintained `rasterio conda-forge`_ page for install instructions. This build is maintained
separately from the rasterio distribution on PyPi and packaging issues should separately from the rasterio distribution on PyPi and packaging issues should
be addressed on the `rasterio conda-forge`_ issue tracker. be addressed on the `rasterio conda-forge`_ issue tracker.
Installing from the source distribution Installing from the source distribution
--------------------------------------- ---------------------------------------
@ -66,7 +66,7 @@ Rasterio is a Python C extension and to build you'll need a working compiler
required to run the rasterio setup script. Numpy has to be installed (via the required to run the rasterio setup script. Numpy has to be installed (via the
indicated requirements file) before rasterio can be installed. See rasterio's indicated requirements file) before rasterio can be installed. See rasterio's
Travis `configuration Travis `configuration
<https://github.com/mapbox/rasterio/blob/master/.travis.yml>`__ for more <https://github.com/rasterio/rasterio/blob/master/.travis.yml>`__ for more
guidance. guidance.
Linux Linux
@ -118,10 +118,10 @@ With pip
$ pip install --no-use-pep517 --global-option -I<path to gdal include files> -lgdal_i -L<path to gdal library> . $ pip install --no-use-pep517 --global-option -I<path to gdal include files> -lgdal_i -L<path to gdal library> .
Note: :code:`--no-use-pep517` is required as pip currently hasn't implemented a Note: :code:`--no-use-pep517` is required as pip currently hasn't implemented a
way for optional arguments to be passed to the build backend when using PEP 517. way for optional arguments to be passed to the build backend when using PEP 517.
See `here <https://github.com/pypa/pip/issues/5771>`__. for more details. See `here <https://github.com/pypa/pip/issues/5771>`__. for more details.
Alternatively environment variables (e.g. INCLUDE and LINK) used by MSVC compiler can be used to point Alternatively environment variables (e.g. INCLUDE and LINK) used by MSVC compiler can be used to point
to include directories and library files. to include directories and library files.
We have had success compiling code using the same version of Microsoft's We have had success compiling code using the same version of Microsoft's

View File

@ -43,7 +43,7 @@ Here's a history of this feature:
The original plan was to remove the ``affine`` argument + property, and assume The original plan was to remove the ``affine`` argument + property, and assume
that the object passed to ``transform`` is an ``Affine()``. that the object passed to ``transform`` is an ``Affine()``.
However, after `further discussion However, after `further discussion
<https://github.com/mapbox/rasterio/pull/763>`__ it was determined that <https://github.com/rasterio/rasterio/pull/763>`__ it was determined that
since ``Affine()`` and GDAL geotransforms are both 6 element tuples users may since ``Affine()`` and GDAL geotransforms are both 6 element tuples users may
experience unexplained errors and outputs, so an exception is raised instead to experience unexplained errors and outputs, so an exception is raised instead to
better highlight the error. better highlight the error.
@ -62,9 +62,9 @@ Before 1.0b1:
Tickets Tickets
``````` ```````
* `#86 <https://github.com/mapbox/rasterio/issues/86>`__ - Announcing the * `#86 <https://github.com/rasterio/rasterio/issues/86>`__ - Announcing the
plan to switch from GDAL geotransforms to ``Affine()``. plan to switch from GDAL geotransforms to ``Affine()``.
* `#763 <https://github.com/mapbox/rasterio/pull/763>`__ - Implementation of the * `#763 <https://github.com/rasterio/rasterio/pull/763>`__ - Implementation of the
migration and some further discussion. migration and some further discussion.
Beginning in 1.0b1: Beginning in 1.0b1:
@ -120,7 +120,7 @@ but Rasterio 1.0 contains more interactions with GDAL's environment, so
Tickets Tickets
``````` ```````
* `#665 <https://github.com/mapbox/rasterio/pull/665>`__ - Deprecation of * `#665 <https://github.com/rasterio/rasterio/pull/665>`__ - Deprecation of
``rasterio.drivers()`` and introduction of ``rasterio.Env()``. ``rasterio.drivers()`` and introduction of ``rasterio.Env()``.
Removed: ``src.read_band()`` Removed: ``src.read_band()``
@ -153,10 +153,10 @@ is now:
Tickets Tickets
``````` ```````
* `# 83 <https://github.com/mapbox/rasterio/issues/83>`__ - Introduction of * `# 83 <https://github.com/rasterio/rasterio/issues/83>`__ - Introduction of
``src.read()``. ``src.read()``.
* `#96 <https://github.com/mapbox/rasterio/issues/96>`__, * `#96 <https://github.com/rasterio/rasterio/issues/96>`__,
`#284 <https://github.com/mapbox/rasterio/pull/284>`__ - Deprecation of `#284 <https://github.com/rasterio/rasterio/pull/284>`__ - Deprecation of
``src.read_band()``. ``src.read_band()``.
@ -170,7 +170,7 @@ favor of ``src.read_masks()``, although it has no direct replacement.
Tickets Tickets
``````` ```````
* `#284 <https://github.com/mapbox/rasterio/pull/284>`__ - Deprecation of * `#284 <https://github.com/rasterio/rasterio/pull/284>`__ - Deprecation of
``src.read_mask()``. ``src.read_mask()``.
@ -188,7 +188,7 @@ dataset windows have been moved to ``rasterio.windows.*``:
Tickets Tickets
``````` ```````
* `#609 <https://github.com/mapbox/rasterio/pull/609>`__ - Introduction of * `#609 <https://github.com/rasterio/rasterio/pull/609>`__ - Introduction of
``rasterio.windows``. ``rasterio.windows``.
@ -208,7 +208,7 @@ several different locations:
Tickets Tickets
``````` ```````
* `#609 <https://github.com/mapbox/rasterio/pull/609>`__ - Deprecation of * `#609 <https://github.com/rasterio/rasterio/pull/609>`__ - Deprecation of
``rasterio.tool``. ``rasterio.tool``.
@ -226,7 +226,7 @@ several different locations:
Tickets Tickets
``````` ```````
* `#609 <https://github.com/mapbox/rasterio/pull/609>`__ - Deprecation of * `#609 <https://github.com/rasterio/rasterio/pull/609>`__ - Deprecation of
``rasterio.tools``. ``rasterio.tools``.

View File

@ -54,7 +54,7 @@ transform.
assert not destination.all() assert not destination.all()
See `examples/reproject.py <https://github.com/mapbox/rasterio/blob/master/examples/reproject.py>`__ See `examples/reproject.py <https://github.com/rasterio/rasterio/blob/master/examples/reproject.py>`__
for code that writes the destination array to a GeoTIFF file. I've uploaded the for code that writes the destination array to a GeoTIFF file. I've uploaded the
resulting file to a Mapbox map to show that the reprojection is resulting file to a Mapbox map to show that the reprojection is
correct: https://a.tiles.mapbox.com/v3/sgillies.hfek2oko/page.html?secure=1#6/0.000/0.033. correct: https://a.tiles.mapbox.com/v3/sgillies.hfek2oko/page.html?secure=1#6/0.000/0.033.
@ -167,7 +167,7 @@ the output dataset's transform matrix and, thereby, its spatial extent.
Reprojecting with other georeferencing metadata Reprojecting with other georeferencing metadata
------------------------------------------------ ------------------------------------------------
Most geospatial datasets have a geotransform which can be used to reproject a dataset Most geospatial datasets have a geotransform which can be used to reproject a dataset
from one coordinate reference system to another. Datasets may also be from one coordinate reference system to another. Datasets may also be
georeferenced by alternative metadata, namely Ground Control Points (gcps) or georeferenced by alternative metadata, namely Ground Control Points (gcps) or
Rational Polynomial Coefficients (rpcs). For details on gcps and rpcs, see Rational Polynomial Coefficients (rpcs). For details on gcps and rpcs, see
@ -184,7 +184,7 @@ reference system with a newly computed geotransform.
with rasterio.open('RGB.byte.tif') as source: with rasterio.open('RGB.byte.tif') as source:
print(source.rpcs) print(source.rpcs)
src_crs = "EPSG:4326" # This is the crs of the rpcs src_crs = "EPSG:4326" # This is the crs of the rpcs
# Optional keyword arguments to be passed to GDAL transformer # Optional keyword arguments to be passed to GDAL transformer
# https://gdal.org/api/gdal_alg.html?highlight=gdalcreategenimgprojtransformer2#_CPPv432GDALCreateGenImgProjTransformer212GDALDatasetH12GDALDatasetHPPc # https://gdal.org/api/gdal_alg.html?highlight=gdalcreategenimgprojtransformer2#_CPPv432GDALCreateGenImgProjTransformer212GDALDatasetH12GDALDatasetHPPc
kwargs = { kwargs = {

View File

@ -119,7 +119,7 @@ def driver_can_create_copy(drivername):
def _raster_driver_extensions(): def _raster_driver_extensions():
""" """
Logic based on: https://github.com/mapbox/rasterio/issues/265#issuecomment-367044836 Logic based on: https://github.com/rasterio/rasterio/issues/265#issuecomment-367044836
""" """
cdef int iii = 0 cdef int iii = 0
cdef int driver_count = GDALGetDriverCount() cdef int driver_count = GDALGetDriverCount()

View File

@ -92,7 +92,7 @@ def driver_count():
cpdef get_gdal_config(key, normalize=True): cpdef get_gdal_config(key, normalize=True):
"""Get the value of a GDAL configuration option. When requesting """Get the value of a GDAL configuration option. When requesting
``GDAL_CACHEMAX`` the value is returned unaltered. ``GDAL_CACHEMAX`` the value is returned unaltered.
Parameters Parameters
---------- ----------
@ -356,7 +356,7 @@ cdef class GDALEnv(ConfigEnv):
log.debug("GDAL data found in package: path=%r.", path) log.debug("GDAL data found in package: path=%r.", path)
self.update_config_options(GDAL_DATA=path) self.update_config_options(GDAL_DATA=path)
# See https://github.com/mapbox/rasterio/issues/1631. # See https://github.com/rasterio/rasterio/issues/1631.
elif GDALDataFinder().find_file("header.dxf"): elif GDALDataFinder().find_file("header.dxf"):
log.debug("GDAL data files are available at built-in paths.") log.debug("GDAL data files are available at built-in paths.")

View File

@ -1057,7 +1057,7 @@ cdef class DatasetReaderBase(DatasetBase):
those indexes. those indexes.
""" """
# In https://github.com/mapbox/rasterio/issues/378 a user has # In https://github.com/rasterio/rasterio/issues/378 a user has
# found what looks to be a Cython generator bug. Until that can # found what looks to be a Cython generator bug. Until that can
# be confirmed and fixed, the workaround is a pure Python # be confirmed and fixed, the workaround is a pure Python
# generator implemented in sample.py. # generator implemented in sample.py.

View File

@ -19,7 +19,7 @@ with rasterio._loading.add_gdal_dll_directories():
# Methods like `rasterio.open()` may use this blacklist to preempt # Methods like `rasterio.open()` may use this blacklist to preempt
# combinations of drivers and file modes. # combinations of drivers and file modes.
blacklist = { blacklist = {
# See https://github.com/mapbox/rasterio/issues/638 for discussion # See https://github.com/rasterio/rasterio/issues/638 for discussion
# about writing NetCDF files. # about writing NetCDF files.
'netCDF': ('r+', 'w')} 'netCDF': ('r+', 'w')}

View File

@ -633,7 +633,7 @@ if 'GDAL_DATA' not in os.environ:
log.debug("GDAL data found in package: path=%r.", path) log.debug("GDAL data found in package: path=%r.", path)
set_gdal_config("GDAL_DATA", path) set_gdal_config("GDAL_DATA", path)
# See https://github.com/mapbox/rasterio/issues/1631. # See https://github.com/rasterio/rasterio/issues/1631.
elif GDALDataFinder().find_file("header.dxf"): elif GDALDataFinder().find_file("header.dxf"):
log.debug("GDAL data files are available at built-in paths.") log.debug("GDAL data files are available at built-in paths.")
@ -653,7 +653,7 @@ elif PROJDataFinder().search_wheel():
log.debug("PROJ data found in package: path=%r.", path) log.debug("PROJ data found in package: path=%r.", path)
set_proj_data_search_path(path) set_proj_data_search_path(path)
# See https://github.com/mapbox/rasterio/issues/1631. # See https://github.com/rasterio/rasterio/issues/1631.
elif PROJDataFinder().has_data(): elif PROJDataFinder().has_data():
log.debug("PROJ data files are available at built-in paths.") log.debug("PROJ data files are available at built-in paths.")

View File

@ -301,7 +301,7 @@ def rasterize(
if geom_type == 'GeometryCollection': if geom_type == 'GeometryCollection':
# GeometryCollections need to be handled as individual parts to # GeometryCollections need to be handled as individual parts to
# avoid holes in output: # avoid holes in output:
# https://github.com/mapbox/rasterio/issues/1253. # https://github.com/rasterio/rasterio/issues/1253.
# Only 1-level deep since GeoJSON spec discourages nested # Only 1-level deep since GeoJSON spec discourages nested
# GeometryCollections # GeometryCollections
for part in geom['geometries']: for part in geom['geometries']:

View File

@ -25,7 +25,7 @@ import rasterio. But if you are using rasterio, you may profit from
Rasterio's CLI infrastructure and the network of existing commands. Rasterio's CLI infrastructure and the network of existing commands.
Please add yours to the registry Please add yours to the registry
https://github.com/mapbox/rasterio/wiki/Rio-plugin-registry https://github.com/rasterio/rasterio/wiki/Rio-plugin-registry
so that other ``rio`` users may find it. so that other ``rio`` users may find it.
""" """

View File

@ -1,7 +1,7 @@
"""Rasterio tools module """Rasterio tools module
See this RFC about Rasterio tools: See this RFC about Rasterio tools:
https://github.com/mapbox/rasterio/issues/1300. https://github.com/rasterio/rasterio/issues/1300.
""" """
import json import json

View File

@ -306,7 +306,7 @@ setup_args = dict(
keywords="raster gdal", keywords="raster gdal",
author="Sean Gillies", author="Sean Gillies",
author_email="sean@mapbox.com", author_email="sean@mapbox.com",
url="https://github.com/mapbox/rasterio", url="https://github.com/rasterio/rasterio",
license="BSD", license="BSD",
package_dir={"": "."}, package_dir={"": "."},
packages=["rasterio", "rasterio.rio"], packages=["rasterio", "rasterio.rio"],

View File

@ -16,5 +16,5 @@ key like so:
$ AWS_ACCESS_KEY_ID=ID AWS_SECRET_ACCESS_KEY=KEY python -m pytest $ AWS_ACCESS_KEY_ID=ID AWS_SECRET_ACCESS_KEY=KEY python -m pytest
The key used for Travis is generated using the Amazon CloudFormation template at The key used for Travis is generated using the Amazon CloudFormation template at
https://github.com/mapbox/rasterio/blob/master/cloudformation/travis.template. If you had to fork https://github.com/rasterio/rasterio/blob/master/cloudformation/travis.template. If you had to fork
Rasterio and run your own tests, you could `use this template <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html>`__ to create your own IAM user and get a new key from your stack's "Outputs" field. Rasterio and run your own tests, you could `use this template <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html>`__ to create your own IAM user and get a new key from your stack's "Outputs" field.

View File

@ -3,7 +3,7 @@ Testing
Rasterio's tests require several raster data files. Grab them from Rasterio's tests require several raster data files. Grab them from
https://github.com/mapbox/rasterio/tree/master/tests/data https://github.com/rasterio/rasterio/tree/master/tests/data
and copy them to this directory. and copy them to this directory.

View File

@ -89,7 +89,7 @@ def test_set_colorinterp_all(path_4band_no_colorinterp, ci):
"""Test setting with all color interpretations.""" """Test setting with all color interpretations."""
if ci.value == 1: if ci.value == 1:
pytest.xfail("Setting colorinterp to gray fails with GDAL 2.3, see https://github.com/mapbox/rasterio/issues/1234") pytest.xfail("Setting colorinterp to gray fails with GDAL 2.3, see https://github.com/rasterio/rasterio/issues/1234")
with rasterio.open(path_4band_no_colorinterp, 'r+') as src: with rasterio.open(path_4band_no_colorinterp, 'r+') as src:
all_ci = list(src.colorinterp) all_ci = list(src.colorinterp)

View File

@ -436,7 +436,7 @@ def test_ensure_defaults_teardown(gdalenv):
would quietly reinstate any ``rasterio.env.default_options`` that was would quietly reinstate any ``rasterio.env.default_options`` that was
not modified by the environment. not modified by the environment.
https://github.com/mapbox/rasterio/issues/968 https://github.com/rasterio/rasterio/issues/968
""" """
def _check_defaults(): def _check_defaults():

View File

@ -496,7 +496,7 @@ def test_rasterize_geo_interface(geojson_polygon, basic_image_2x2):
def test_rasterize_geomcollection_no_hole(): def test_rasterize_geomcollection_no_hole():
""" """
Make sure that bug reported in Make sure that bug reported in
https://github.com/mapbox/rasterio/issues/1253 https://github.com/rasterio/rasterio/issues/1253
does not recur. GeometryCollections are flattened to individual parts, does not recur. GeometryCollections are flattened to individual parts,
and should result in no holes where parts overlap. and should result in no holes where parts overlap.
""" """
@ -519,7 +519,7 @@ def test_rasterize_geomcollection_no_hole():
def test_rasterize_multipolygon_no_hole(): def test_rasterize_multipolygon_no_hole():
""" """
Make sure that bug reported in Make sure that bug reported in
https://github.com/mapbox/rasterio/issues/1253 https://github.com/rasterio/rasterio/issues/1253
does not recur. MultiPolygons are flattened to individual parts, does not recur. MultiPolygons are flattened to individual parts,
and should result in no holes where parts overlap. and should result in no holes where parts overlap.
""" """

View File

@ -14,7 +14,7 @@ def test_copy_meta(tmpdir):
def test_blacklisted_keys(tmpdir): def test_blacklisted_keys(tmpdir):
# Some keys were removed from .meta when they were found to clash with # Some keys were removed from .meta when they were found to clash with
# creation options. # creation options.
# https://github.com/mapbox/rasterio/issues/402 # https://github.com/rasterio/rasterio/issues/402
with rasterio.open('tests/data/RGB.byte.tif') as src: with rasterio.open('tests/data/RGB.byte.tif') as src:
kwds = src.meta kwds = src.meta
with rasterio.open( with rasterio.open(

View File

@ -173,7 +173,7 @@ def test_read_vfs_none():
def test_parse_path_accept_get_params(): def test_parse_path_accept_get_params():
# See https://github.com/mapbox/rasterio/issues/1121 # See https://github.com/rasterio/rasterio/issues/1121
parsed = parse_path('http://example.com/index?a=1') parsed = parse_path('http://example.com/index?a=1')
assert isinstance(parsed, ParsedPath) assert isinstance(parsed, ParsedPath)
assert parsed.path == 'example.com/index?a=1' assert parsed.path == 'example.com/index?a=1'

View File

@ -148,7 +148,7 @@ def test_sieve_read(tmpdir, runner):
def test_positional_calculation_byindex(tmpdir, runner): def test_positional_calculation_byindex(tmpdir, runner):
# See Issue 947: https://github.com/mapbox/rasterio/issues/947 # See Issue 947: https://github.com/rasterio/rasterio/issues/947
# Prior to fix, 'shade.tif' reliably is read as 2nd input and # Prior to fix, 'shade.tif' reliably is read as 2nd input and
# we should expect this to fail due to array shape error # we should expect this to fail due to array shape error
# ("operands could not be broadcast together") # ("operands could not be broadcast together")

View File

@ -516,7 +516,7 @@ def test_merge_tiny_intres(tiffs):
) )
@pytest.mark.parametrize("precision", [[], ["--precision", "9"]]) @pytest.mark.parametrize("precision", [[], ["--precision", "9"]])
def test_merge_precision(tmpdir, precision): def test_merge_precision(tmpdir, precision):
"""See https://github.com/mapbox/rasterio/issues/1837""" """See https://github.com/rasterio/rasterio/issues/1837"""
# TDOD move ascii grids to a fixture? # TDOD move ascii grids to a fixture?
expected = """\ expected = """\

View File

@ -46,7 +46,7 @@ def test_sampling_single_index():
def test_sampling_type(): def test_sampling_type():
"""See https://github.com/mapbox/rasterio/issues/378.""" """See https://github.com/rasterio/rasterio/issues/378."""
with rasterio.open('tests/data/RGB.byte.tif') as src: with rasterio.open('tests/data/RGB.byte.tif') as src:
sampler = src.sample([(220650.0, 2719200.0)], indexes=[2]) sampler = src.sample([(220650.0, 2719200.0)], indexes=[2])
assert type(sampler) assert type(sampler)

View File

@ -1446,7 +1446,7 @@ def test_resample_no_invert_proj(method):
): ):
pytest.xfail( pytest.xfail(
reason="Some resampling methods succeed but produce blank images. " reason="Some resampling methods succeed but produce blank images. "
"See https://github.com/mapbox/rasterio/issues/614" "See https://github.com/rasterio/rasterio/issues/614"
) )
with rasterio.Env(CHECK_WITH_INVERT_PROJ=False): with rasterio.Env(CHECK_WITH_INVERT_PROJ=False):

View File

@ -285,7 +285,7 @@ def test_crs_should_be_set(path_rgb_byte_tif, tmpdir, complex):
Permalink to ``GDALCreateWarpedVRT()`` call: Permalink to ``GDALCreateWarpedVRT()`` call:
https://github.com/mapbox/rasterio/blob/1f759e5f67628f163ea2550d8926b91545245712/rasterio/_warp.pyx#L753 https://github.com/rasterio/rasterio/blob/1f759e5f67628f163ea2550d8926b91545245712/rasterio/_warp.pyx#L753
""" """
@ -536,7 +536,7 @@ def test_out_dtype(red_green):
def test_sample(red_green): def test_sample(red_green):
"""See https://github.com/mapbox/rasterio/issues/1833.""" """See https://github.com/rasterio/rasterio/issues/1833."""
with rasterio.Env(): with rasterio.Env():
with rasterio.open(str(red_green.join("red.tif"))) as src, WarpedVRT( with rasterio.open(str(red_green.join("red.tif"))) as src, WarpedVRT(
src, src,