def _create_mapping(self, func, switch):
mapping = {}<EOL>for feature in self.data['<STR_LIT>']:<EOL><INDENT>content = func(feature)<EOL>if switch == '<STR_LIT>':<EOL><INDENT>for key, value in content.items():<EOL><INDENT>if isinstance(value, MacroElement):<EOL><INDENT>if value._parent is None:<EOL><INDENT>value._parent = self.geojson_obj<EOL>value.render()<EOL><DEDENT>content[key] = "<STR_LIT>" + value.get_name() + "<STR_LIT>"<EOL><DEDENT><DEDENT><DEDENT>key = self._to_key(content)<EOL>mapping.setdefault(key, []).append(self.get_feature_id(feature))<EOL><DEDENT>self._set_default_key(mapping)<EOL>return mapping<EOL>
Internal function to create the mapping.