def test_collection_in_collection(self): geo_input = geojson.loads(''' { "type": "GeometryCollection", "geometries": [ { "type": "Point", "coordinates": [1.0, 1.0] }, { "type": "GeometryCollection", "geometries": [ { "type": "Point", "coordinates": [4.0, 6.0] }, { "type": "LineString", "coordinates": [[4.0, 6.0], [7.0, 10.0]] } ] } ] } ''') geometry = create_geometrycollection_from_geojson(geo_input) self.assertEqual(geometry.geom_type, 'GeometryCollection')
def test_collection_empty(self): geo_input = geojson.loads('''{ "type": "GeometryCollection", "geometries": [] }''') geometry = create_geometrycollection_from_geojson(geo_input) self.assertEqual(geometry.geom_type, 'GeometryCollection')