6533f4a2123077c55d3a0c8bc04bb5e71c8b36de,label_maker/utils.py,,is_tif,#,89

Before Change



def is_tif(imagery):
    Determine if an imagery path has a valid tif extension
    return op.splitext(imagery)[1].lower() in [".tif", ".tiff", ".vrt"]

After Change



def is_tif(imagery):
    Determine if an imagery path leads to a valid tif
    try:
        with rasterio.open(imagery) as test_ds:
            if test_ds.meta["driver"] != "GTiff":
                // rasterio can open path, but it is not a tif
                is_tif = False
            else:
                is_tif = True
    except rasterio._err.CPLE_HttpResponseError:
        // rasterio cannot opent path. this is the case for a
        // tile service
        is_tif = False

    return is_tif
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: developmentseed/label-maker
Commit Name: 6533f4a2123077c55d3a0c8bc04bb5e71c8b36de
Time: 2018-05-08
Author: jreiberkyle@users.noreply.github.com
File Name: label_maker/utils.py
Class Name:
Method Name: is_tif


Project Name: matthewwithanm/django-imagekit
Commit Name: 14bac58373d87ab4d90879b1654b62bf89603bc4
Time: 2011-11-02
Author: matthew@exanimo.com
File Name: imagekit/models.py
Class Name:
Method Name: _get_suggested_extension


Project Name: KrishnaswamyLab/PHATE
Commit Name: e5a98adc53c682047bd6873c127c9c94588b28ab
Time: 2019-12-01
Author: scottgigante@gmail.com
File Name: Python/phate/mds.py
Class Name:
Method Name: embed_MDS