code: def xy2geom(x, y, t_srs=None):
      
      geom_wkt = 'POINT({0} {1})'.format(x, y)
      geom = ogr.CreateGeometryFromWkt(geom_wkt)
      if t_srs is not None and not wgs_srs.IsSame(t_srs):
          ct = osr.CoordinateTransformation(t_srs, wgs_srs)
          geom.Transform(ct)
          geom.AssignSpatialReference(t_srs)
      return geom
docs: Convert x and y point coordinates to geom