Polygon serialisation/deserialisation.