[GIS] QGIS does not show the Geometry Collection Polygons from JSON file

jsonqgis

I'm trying to import a JSON file I got from a customer and convert it to a shapefile. The JSON file appears to have two Geometry types (Polygon and GeometryCollection). I can get the Polygons to import properly, however I cannot seem to get the GeometryCollection to import the Polygons they have in them. I am running QGIS 2.18.7 which I believe can handle multiple types.

I've stored the file I am trying to import here:
Sample File

Is the file corrrupt or am I missing something?

Best Answer

The file is not corrupt. QGIS does not support GeometryCollection as a valid geometry type. You will have to parse it. Here is a related answer. Something like this will get you to the data:

with open(json_file, 'r') as data_file:
    data = json.load(data_file)
    for feature in data['features']:
        for geometry in feature['geometry']['geometries']:
            if geometry['type'] == "Polygon":
                polygon = geometry['coordinates']
Related Question