/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import n from"../../../geometry/Point.js";import t from"../../../geometry/SpatialReference.js";function e(n,t){const e=r(t);return[n[0].toFixed(e),n[1].toFixed(e)]}function r(n){return n>=500?6:n<500&&n>=50?7:n<50&&n>=5?8:9}function i(e,r){const i=e.includes(",")?",":" ",[u,c,s]=e.split(i).map(n=>{const t=n.trim();return t?Number(t):null});if(!o(u)||!o(c))return null;const f=new n({x:u,y:c,spatialReference:r||t.WGS84});return s&&(f.z=s,f.hasZ=!0),f}function o(n){return"number"==typeof n&&isFinite(n)}function u(n){return!!n&&o(n.x)&&o(n.y)}function c(n,t){if(n.spatialReference.isGeographic&&t){const[r,i]=e([n.x,n.y],t);return`${r}, ${i}`}return`${n.x.toFixed(3)}, ${n.y.toFixed(3)}`}const s=["dd","dms","ddm","mgrs","usng","utm"];function f(n){return s.includes(n)}export{e as clipLonLat,i as fromXY,r as getDegreePrecision,f as isSupportedNotation,u as isValidPoint,c as pointToCoordinate};
