Find a unique identifier for each feature, create it if needed.

def find_identifier(self):
        """Find a unique identifier for each feature, create it if needed."""
        features = self.data['features']
        n = len(features)
        feature = features[0]
        if 'id' in feature and len(set(feat['id'] for feat in features)) == n:
            return 'feature.id'
        for key in feature.get('properties', []):
            if len(set(feat['properties'][key] for feat in features)) == n:
                return 'feature.properties.{}'.format(key)
        if self.embed:
            for i, feature in enumerate(self.data['features']):
                feature['id'] = str(i)
            return 'feature.id'
        raise ValueError(
            'There is no unique identifier for each feature and because '
            '`embed=False` it cannot be added. Consider adding an `id` '
            'field to your geojson data or set `embed=True`. '
        )