/usr/lib/python3/dist-packages/rasterio/coords.py is in python3-rasterio 0.36.0-2build5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | """Bounding box tuple, and disjoint operator."""
from collections import namedtuple
_BoundingBox = namedtuple('BoundingBox', ('left', 'bottom', 'right', 'top'))
class BoundingBox(_BoundingBox):
"""Bounding box named tuple, defining extent in cartesian coordinates.
.. code::
BoundingBox(left, bottom, right, top)
Attributes
----------
left :
Left coordinate
bottom :
Bottom coordinate
right :
Right coordinate
top :
Top coordinate
"""
pass
def disjoint_bounds(bounds1, bounds2):
"""Compare two bounds and determine if they are disjoint.
Parameters
----------
bounds1: 4-tuple
rasterio bounds tuple (xmin, ymin, xmax, ymax)
bounds2: 4-tuple
rasterio bounds tuple
Returns
-------
boolean
``True`` if bounds are disjoint,
``False`` if bounds overlap
"""
return (bounds1[0] > bounds2[2] or bounds1[2] < bounds2[0] or
bounds1[1] > bounds2[3] or bounds1[3] < bounds2[1])
|