def METHOD_NAME(resource_instance_id):
    ret = {"values": [], "tile_ct": 0}
    tiles = Tile.objects.filter(resourceinstance_id=resource_instance_id)
    ret["tile_ct"] = len(tiles)
    value_ct = 0
    for tile in tiles:
        for k, v in tile.data.items():
            if not v:
                continue
            if isinstance(v, list):
                value_ct += len(v)
                for i in v:
                    ret["values"].append(i)
            # assume that a dict value is a geojson object
            # further, each feature must be counted independently, because
            # that will match the count in the original v3 json data
            elif isinstance(v, dict):
                for feat in v["features"]:
                    ret["values"].append(feat)
            else:
                ret["values"].append(v)
    return ret