How to use the cjio.cityjson.load 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_io.py View on Github external
def test_save_to_path(self, data_dir):
        p = os.path.join(data_dir, 'rotterdam', 'rotterdam_subset.json')
        cm = cityjson.load(p)
        new_cos = {}
        for co_id, co in cm.cityobjects.items():
            co.attributes['cjio_test'] = 'made by Balázs'
            new_cos[co_id] = co
        cm.cityobjects = new_cos
        p_out = os.path.join(data_dir, 'rotterdam_subset_cjio_test.json')
        cityjson.save(cm, p_out)
github cityjson / cjio / tests / test_io.py View on Github external
def test_from_path(self, data_dir):
        p = os.path.join(data_dir, 'rotterdam', 'rotterdam_subset.json')
        cm = cityjson.load(p)
        assert hasattr(cm, 'cityobjects')
        assert '{71B60053-BC28-404D-BAB9-8A642AAC0CF4}' in cm.cityobjects
github cityjson / cjio / tests / test_io.py View on Github external
def test_to_dataframe(self, data_dir):
        p = os.path.join(data_dir, 'rotterdam', 'rotterdam_subset.json')
        cm = cityjson.load(p)
        df = cm.to_dataframe()
        assert len(df) == len(cm.cityobjects)