code: def mmi_to_vrt(self, force_flag=True):
          
          # Ensure the delimited mmi file exists
          LOGGER.debug('mmi_to_vrt requested.')
  
          vrt_path = os.path.join(
              self.output_dir,
              self.output_basename + '.vrt')
  
          # short circuit if the vrt is already created.
          if os.path.exists(vrt_path) and force_flag is not True:
              return vrt_path
  
          csv_path = self.mmi_to_delimited_file(True)
  
          vrt_string = (
              '<OGRVRTDataSource>'
              '  <OGRVRTLayer name="mmi">'
              '    <SrcDataSource>%s</SrcDataSource>'
              '    <GeometryType>wkbPoint</GeometryType>'
              '    <GeometryField encoding="PointFromColumns"'
              '                      x="lon" y="lat" z="mmi"/>'
              '  </OGRVRTLayer>'
              '</OGRVRTDataSource>' % csv_path)
  
          with codecs.open(vrt_path, 'w', encoding='utf-8') as f:
              f.write(vrt_string)
  
          return vrt_path
docs: Save the mmi_data to an ogr vrt text file.
  
          :param force_flag: Whether to force the regeneration of the output
              file. Defaults to False.
          :type force_flag: bool
  
          :returns: The absolute file system path to the .vrt text file.
          :rtype: str
  
          :raises: None