def decode(self, filename, **kwargs): content = self.read_file(filename) geojson = GeoJSON(**kwargs) return geojson.decode(content)
def test_bbox(self): content = self.read_file('collection.json') geojson = GeoJSON() features = geojson.decode(content) data = GeoJSON.encode(geojson, features, to_string=False, bbox=True) self.assertEqual(data['bbox'], [100.0, 0.0, 105.0, 1.0])
def test_encode(self): content = self.read_file('collection.json') geojson = GeoJSON() features = geojson.decode(content) data = GeoJSON.encode(geojson, features, to_string=False, bbox=True) self.assertEqual(data['type'], 'FeatureCollection')