An optical lattice is a platform that is used in studies in multiple branches of physics, e.g., ultracold atoms and microfluidic sorting. Unlike traditional complex optical systems, surface plasmon polaritons enable the generation of optical lattices on a chip. Here, we propose an on-chip scheme to transform five topological optical lattices using tunable polarization and a phase vortex. Using the dipolar approximation and numerical simulations, we demonstrate that the spin density force is the main force for sorting chiral particles in the out-of-plane direction when their radius is more than 100 nm. A microflow system is proposed to trap particles with electric optical lattices and sort chiral particles with spin optical lattices. Our findings offer possible routes toward realization of on-chip optical lattices and enable their potential application in both biology and chemistry, e.g., in simultaneous trapping or excitation of multiple objects and identification and sorting of chiral objects.