Controlling spin transition in one-dimensional coordination polymers through polymorphism