Using the App Script, I need to convert text:
Input:
POLYGON ((-111.705934405 32.76300316, -111.706191897 32.748205765, -111.706191897 32.748205765, -111.706191897 32.748205765, -111.688682437 32.748566707, -111.688939929 32.733261511, -111.655036807 32.732828307, -111.655294299 32.740914437, -111.645938754 32.740842243, -111.646024585 32.748783271, -111.654607654 32.74914421, -111.654092669 32.763291866, -111.705934405 32.76300316))
Output:
[[{"lat":32.763597994888265,"lng":-111.70779863788822},{"lat":32.763670170794725,"lng":-111.65269533588626},{"lat":32.74887288656241,"lng":-111.65346781208255},{"lat":32.74880069866226,"lng":-111.64479891254642},{"lat":32.741004061134866,"lng":-111.64548555805423},{"lat":32.741004061134866,"lng":-111.65424028827884},{"lat":32.73356774344866,"lng":-111.65466944172123},{"lat":32.732990139407825,"lng":-111.70608202411869}]]
Using App script. I have converted text using formulas. Here is That sheet. Polygon can have 200+ points. It is difficult to adjust those points in the formula.
And note that the latitude and longitude is reversed in the input.