getpoly now outputs json, consisting of the wkt string and the averaged lat/lon pair