Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(38)  |  Call(32)  |  Derive(0)  |  Import(6)
Returns ``True`` if `one` contains `two`.

>>> bbox_contains([0, 0, 10, 10], [2, 2, 4, 4])
True
>>> bbox_contains([0, 0, 10, 10], [0, 0, 11, 10])
False

Allow tiny rounding errors:

>>> bbox_contains([0, 0, 10, 10], [0.000001, 0.0000001, 10.000001, 10.000001])(more...)

        def bbox_contains(one, two):
    """
    Returns ``True`` if `one` contains `two`.

    >>> bbox_contains([0, 0, 10, 10], [2, 2, 4, 4])
    True
    >>> bbox_contains([0, 0, 10, 10], [0, 0, 11, 10])
    False

    Allow tiny rounding errors:

    >>> bbox_contains([0, 0, 10, 10], [0.000001, 0.0000001, 10.000001, 10.000001])
    False
    >>> bbox_contains([0, 0, 10, 10], [0.0000000000001, 0.0000000000001, 10.0000000000001, 10.0000000000001])
    True
    """
    a_x0, a_y0, a_x1, a_y1 = one
    b_x0, b_y0, b_x1, b_y1 = two

    x_delta = abs(a_x1 - a_x0) / 10e12
    y_delta = abs(a_y1 - a_y0) / 10e12

    if (
        a_x0 <= b_x0 + x_delta and
        a_x1 >= b_x1 - x_delta and
        a_y0 <= b_y0 + y_delta and
        a_y1 >= b_y1 - y_delta
        ): return True

    return False
        


src/m/a/MapProxy-1.6.0/mapproxy/layer.py   MapProxy(Download)
 
from __future__ import division, with_statement
from mapproxy.grid import NoTiles, GridError, merge_resolution_range, bbox_intersects, bbox_contains
from mapproxy.image import SubImageSource, bbox_position_in_image
from mapproxy.image.opts import ImageOptions
            # DefaultMapExtent contains everything
            return True
        return bbox_contains(self.bbox, other.bbox_for(self.srs))
 
    def intersects(self, other):

src/m/a/mapproxy-HEAD/mapproxy/layer.py   mapproxy(Download)
 
from __future__ import division, with_statement
from mapproxy.grid import NoTiles, GridError, merge_resolution_range, bbox_intersects, bbox_contains
from mapproxy.image import SubImageSource, bbox_position_in_image
from mapproxy.image.opts import ImageOptions
            # DefaultMapExtent contains everything
            return True
        return bbox_contains(self.bbox, other.bbox_for(self.srs))
 
    def intersects(self, other):

src/m/a/MapProxy-1.6.0/mapproxy/util/coverage.py   MapProxy(Download)
import threading
 
from mapproxy.grid import bbox_intersects, bbox_contains
from mapproxy.util.py import cached_property
from mapproxy.util.geom import (
    def contains(self, bbox, srs):
        bbox = self._bbox_in_coverage_srs(bbox, srs)
        return bbox_contains(self.bbox, bbox)
 
    def transform_to(self, srs):

src/m/a/mapproxy-HEAD/mapproxy/util/coverage.py   mapproxy(Download)
import threading
 
from mapproxy.grid import bbox_intersects, bbox_contains
from mapproxy.util.py import cached_property
from mapproxy.util.geom import (
    def contains(self, bbox, srs):
        bbox = self._bbox_in_coverage_srs(bbox, srs)
        return bbox_contains(self.bbox, bbox)
 
    def transform_to(self, srs):

src/m/a/MapProxy-1.6.0/mapproxy/test/unit/test_grid.py   MapProxy(Download)
from __future__ import division
from nose.tools import eq_, assert_almost_equal, raises
from mapproxy.grid import (
    MetaGrid,
    TileGrid,
    def test_no_intersect(self):
        b1 = (0, 0, 10, 10)
        b2 = (20, 20, 30, 30)
        assert not bbox_contains(b1, b2)
        assert not bbox_contains(b2, b1)
 
    def test_no_intersect_only_vertical(self):
        b1 = (0, 0, 10, 10)
        b2 = (20, 0, 30, 10)
        assert not bbox_contains(b1, b2)
    def test_no_intersect_only_vertical(self):
        b1 = (0, 0, 10, 10)
        b2 = (20, 0, 30, 10)
        assert not bbox_contains(b1, b2)
        assert not bbox_contains(b2, b1)

src/m/a/mapproxy-HEAD/mapproxy/test/unit/test_grid.py   mapproxy(Download)
from __future__ import division
from nose.tools import eq_, assert_almost_equal, raises
from mapproxy.grid import (
    MetaGrid,
    TileGrid,
    def test_no_intersect(self):
        b1 = (0, 0, 10, 10)
        b2 = (20, 20, 30, 30)
        assert not bbox_contains(b1, b2)
        assert not bbox_contains(b2, b1)
 
    def test_no_intersect_only_vertical(self):
        b1 = (0, 0, 10, 10)
        b2 = (20, 0, 30, 10)
        assert not bbox_contains(b1, b2)
    def test_no_intersect_only_vertical(self):
        b1 = (0, 0, 10, 10)
        b2 = (20, 0, 30, 10)
        assert not bbox_contains(b1, b2)
        assert not bbox_contains(b2, b1)