import r from"@babel/runtime/helpers/toConsumableArray";import e from"@babel/runtime/helpers/slicedToArray";var t=function(r){return r.map((function(r){var t=e(r,2),n=t[0];return{latitude:t[1],longitude:n}}))},n=function(r){return r.map((function(r){var e=r.latitude;return[r.longitude,e]}))},o=function(e){if(!e||e.length<3)return null;var t=n(e),o=t[0],u=t[t.length-1];return{type:"Feature",geometry:{type:"Polygon",coordinates:[o[0]===u[0]&&o[1]===u[1]?t:[].concat(r(t),[o])]},properties:{}}};export{n as convertApiCoordsToGeoJSON,t as convertDrawCoordsToApi,o as createPolygonGeoJSON};
//# sourceMappingURL=polygonCoords.js.map
