polygon to and from json