How to use the cjio.tiling function in cjio

To help you get started, we’ve selected a few cjio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cityjson / cjio / tests / test_tiling.py View on Github external
def test_subdivide(self, bbox, iteration):
        octree = tiling._subdivide(bbox, iteration, octree=True)
        # some random tests
        # ne_1[ne_1] top corner
        assert octree[5][5][3:] == bbox[3:]
        # ne_1[ne_0] z-value
        assert octree[5][1][5] == bbox[5] - (bbox[5] / 2**iteration)
github cityjson / cjio / tests / test_tiling.py View on Github external
def test_point_in_bbox(self, bbox, point, result):
        """Test that a point is within the bbox of a cell"""
        assert tiling._point_in_bbox(bbox, point) == result
github cityjson / cjio / tests / test_tiling.py View on Github external
def test_compute_root_obb(self, bbox_list, obb):
        res = tiling.compute_root_obb(bbox_list)
        t = [isclose(obb[i], v, rel_tol=1e-6) for i,v in enumerate(res)]
        assert all(t)
github cityjson / cjio / tests / test_tiling.py View on Github external
def test_tileset_json(self):
        tileset = tiling.generate_tileset_json()
        top_level = ['asset', 'geometricError', 'root']
        assert sorted(tileset.keys()) == sorted(top_level)