Mark tests that call GDAL binaries (#1555) (#1557)

* add webp to the available compression enum (#1515)

* Add webp to enums.Compression and increment version

* Add link to dev discussion group

* fix year specified in version 1.0.9 date (#1530)

Year specified in version 1.0.9 date is 2019, which is in the future at this time. Set to 2018, which is in the past.

* Update docstring for plotting_extent (#1516)

* added support for ESRI wkt strings - resolves issue #1537 (#1538)

* updated _handle_crswkt to use CRS.from_wkt; resolved issue #1540 (#1541)

* updated _handle_crswkt to use CRS.from_wkt; resolved issue #1540

* added test for datasetreader opening dataset with ESRI projection wkt string

* Fix a typo (probably) (#1526)

* Fix a typo (probably)

* Update url for manylinux

* Update README.rst

Co-Authored-By: ismailsunni <imajimatika@gmail.com>

* Update README.rst

Co-Authored-By: ismailsunni <imajimatika@gmail.com>

* Remove unused string

* modified _osr_from_crs to use CRS.from_user_input (#1546)

* modified _osr_from_crs to use CRS.from_user_input

* update to use tmpdir fixture for pytest

* update comparison for error output for rio warp

* updated to always attempt to MorphFromESRI to prevent exception from being raised

* added test to test warping with ESRI wkt

* updated data_dir to be used as fixture

* removed duplicate import of CRSError

* reordered initialization of spatial reference to prevent memory leaks

* updated to raise CRSError of auth != EPSG

* Revert "modified _osr_from_crs to use CRS.from_user_input (#1546)" (#1548)

This reverts commit b120a00a05e4f6174c02e855cc016fde9b54c4e0.

* Mark tests using gdal binaries

* Add pytest import
This commit is contained in:
Robert Sare 2018-11-21 08:58:28 -08:00 committed by Sean Gillies
parent 67fb3990af
commit 4b0d3dd69e
9 changed files with 29 additions and 7 deletions

View File

@ -11,10 +11,14 @@ often omit.
The primary forum for questions about installation and usage of Rasterio is
https://rasterio.groups.io/g/main. The authors and other users will answer
questions when they have expertise to share and time to explain. Please take the
time to craft a clear question and be patient about responses.
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 to reserve for
bug reports and other actionable issues.
Please do not bring these questions to Rasterio's issue tracker, which we want
to reserve for bug reports and other actionable issues.
Questions about development of Rasterio, brainstorming, requests for comment,
and not-yet-actionable proposals are welcome in the project's developers
discussion group https://rasterio.groups.io/g/dev. Issues opened in Rasterio's
GitHub repo which haven't been socialized there may be perfunctorily closed.
Please note: Rasterio contains extension modules and is thus susceptible to
C library compatibility issues. If you are reporting an installation or module

View File

@ -195,8 +195,7 @@ Linux
Rasterio distributions are available from UbuntuGIS and Anaconda's conda-forge
channel.
`Manylinux1 <https://github.com/pypa/manylinux>`__ distributions may be
available in the future.
`Manylinux1 <https://github.com/pypa/manylinux>`__ wheels are available on PyPI.```
OS X
++++

View File

@ -155,7 +155,8 @@ def plotting_extent(source, transform=None):
Parameters
----------
source : array or dataset object opened in 'r' mode
input data
If array, data in the order rows, columns and optionally bands. If array
is band order (bands in the first dimension), use arr[0]
transform: Affine, required if source is array
Defines the affine transform if source is an array

View File

@ -112,6 +112,7 @@ class WindowWriteTest(unittest.TestCase):
def tearDown(self):
shutil.rmtree(self.tempdir)
@pytest.mark.gdalbin
def test_write_window(self):
name = os.path.join(self.tempdir, "test_write_window.tif")
a = np.ones((50, 50), dtype=rasterio.ubyte) * 127

View File

@ -50,6 +50,7 @@ def test_read_epsg3857(tmpdir):
# Ensure that CRS sticks when we write a file.
@pytest.mark.gdalbin
def test_write_3857(tmpdir):
src_path = str(tmpdir.join('lol.tif'))
subprocess.call([

View File

@ -8,6 +8,7 @@ import rasterio
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
@pytest.mark.gdalbin
def test_nodata(tmpdir):
dst_path = str(tmpdir.join('lol.tif'))
with rasterio.open('tests/data/RGB.byte.tif') as src:
@ -24,6 +25,7 @@ def test_nodata(tmpdir):
pattern = b'Band 2.*?NoData Value=0'
assert re.search(pattern, info, re.DOTALL) is not None
@pytest.mark.gdalbin
def test_set_nodata(tmpdir):
dst_path = str(tmpdir.join('lol.tif'))
with rasterio.open('tests/data/RGB.byte.tif') as src:

View File

@ -1,4 +1,5 @@
import logging
import pytest
import subprocess
import sys
import numpy as np
@ -7,6 +8,7 @@ import rasterio
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
@pytest.mark.gdalbin
def test_write_ubyte(tmpdir):
name = str(tmpdir.mkdir("sub").join("test_write_ubyte.png"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127

View File

@ -11,6 +11,7 @@ from rasterio.env import GDALVersion
from .conftest import requires_gdal21
@pytest.mark.gdalbin
def test_update_tags(data):
tiffname = str(data.join('RGB.byte.tif'))
with rasterio.open(tiffname, 'r+') as f:

View File

@ -60,6 +60,7 @@ def test_no_crs(tmpdir):
dst.write(np.ones((100, 100), dtype=rasterio.uint8), indexes=1)
@pytest.mark.gdalbin
def test_context(tmpdir):
name = str(tmpdir.join("test_context.tif"))
with rasterio.open(
@ -87,6 +88,7 @@ def test_context(tmpdir):
assert "Band 1 Block=100x81 Type=Byte, ColorInterp=Gray" in info
@pytest.mark.gdalbin
def test_write_ubyte(tmpdir):
name = str(tmpdir.mkdir("sub").join("test_write_ubyte.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
@ -99,6 +101,7 @@ def test_write_ubyte(tmpdir):
assert "Minimum=127.000, Maximum=127.000, Mean=127.000, StdDev=0.000" in info
@pytest.mark.gdalbin
def test_write_ubyte_multi(tmpdir):
name = str(tmpdir.mkdir("sub").join("test_write_ubyte_multi.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
@ -111,6 +114,7 @@ def test_write_ubyte_multi(tmpdir):
assert "Minimum=127.000, Maximum=127.000, Mean=127.000, StdDev=0.000" in info
@pytest.mark.gdalbin
def test_write_ubyte_multi_list(tmpdir):
name = str(tmpdir.mkdir("sub").join("test_write_ubyte_multi_list.tif"))
a = np.array([np.ones((100, 100), dtype=rasterio.ubyte) * 127])
@ -123,6 +127,7 @@ def test_write_ubyte_multi_list(tmpdir):
assert "Minimum=127.000, Maximum=127.000, Mean=127.000, StdDev=0.000" in info
@pytest.mark.gdalbin
def test_write_ubyte_multi_3(tmpdir):
name = str(tmpdir.mkdir("sub").join("test_write_ubyte_multi_list.tif"))
arr = np.array(3 * [np.ones((100, 100), dtype=rasterio.ubyte) * 127])
@ -135,6 +140,7 @@ def test_write_ubyte_multi_3(tmpdir):
assert "Minimum=127.000, Maximum=127.000, Mean=127.000, StdDev=0.000" in info
@pytest.mark.gdalbin
def test_write_float(tmpdir):
name = str(tmpdir.join("test_write_float.tif"))
a = np.ones((100, 100), dtype=rasterio.float32) * 42.0
@ -149,6 +155,7 @@ def test_write_float(tmpdir):
assert "Minimum=42.000, Maximum=42.000, Mean=42.000, StdDev=0.000" in info
@pytest.mark.gdalbin
def test_write_crs_transform(tmpdir):
name = str(tmpdir.join("test_write_crs_transform.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
@ -170,7 +177,7 @@ def test_write_crs_transform(tmpdir):
# (precision varies slightly by platform)
assert re.search(r'Pixel Size = \(300.03792\d+,-300.04178\d+\)', info)
@pytest.mark.gdalbin
def test_write_crs_transform_affine(tmpdir):
name = str(tmpdir.join("test_write_crs_transform.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
@ -192,6 +199,7 @@ def test_write_crs_transform_affine(tmpdir):
assert re.search(r'Pixel Size = \(300.03792\d+,-300.04178\d+\)', info)
@pytest.mark.gdalbin
def test_write_crs_transform_2(tmpdir):
"""Using 'EPSG:32618' as CRS."""
name = str(tmpdir.join("test_write_crs_transform.tif"))
@ -213,6 +221,7 @@ def test_write_crs_transform_2(tmpdir):
assert re.search(r'Pixel Size = \(300.03792\d+,-300.04178\d+\)', info)
@pytest.mark.gdalbin
def test_write_crs_transform_3(tmpdir):
"""Using WKT as CRS."""
name = str(tmpdir.join("test_write_crs_transform.tif"))
@ -235,6 +244,7 @@ def test_write_crs_transform_3(tmpdir):
assert re.search(r'Pixel Size = \(300.03792\d+,-300.04178\d+\)', info)
@pytest.mark.gdalbin
def test_write_meta(tmpdir):
name = str(tmpdir.join("test_write_meta.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127
@ -245,6 +255,7 @@ def test_write_meta(tmpdir):
assert "Minimum=127.000, Maximum=127.000, Mean=127.000, StdDev=0.000" in info
@pytest.mark.gdalbin
def test_write_nodata(tmpdir):
name = str(tmpdir.join("test_write_nodata.tif"))
a = np.ones((100, 100), dtype=rasterio.ubyte) * 127