/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{getMetersPerVerticalUnitForSR as n}from"../../core/units.js";import{isSphericalPCPF as e}from"../ellipsoidUtils.js";import{equals as o}from"./spatialReferenceUtils.js";function t(n,e,o){const t=r(e,o);if(1!==t)switch(n){case"point":case"esriGeometryPoint":return n=>i(n,t);case"polyline":case"esriGeometryPolyline":return n=>l(n,t);case"polygon":case"esriGeometryPolygon":return n=>s(n,t);case"multipoint":case"esriGeometryMultipoint":return n=>c(n,t);case"extent":case"esriGeometryEnvelope":return n=>f(n,t);default:return}}function r(t,r){if(null==t||null==r||r.vcsWkid||o(t,r)||e(t)||e(r))return 1;return n(t)/n(r)}function i(n,e){null!=n?.z&&(n.z*=e)}function s(n,e){if(n)for(const o of n.rings)for(const n of o)n.length>2&&(n[2]*=e)}function l(n,e){if(n)for(const o of n.paths)for(const n of o)n.length>2&&(n[2]*=e)}function c(n,e){if(n)for(const o of n.points)o.length>2&&(o[2]*=e)}function f(n,e){n&&null!=n.zmin&&null!=n.zmax&&(n.zmin*=e,n.zmax*=e)}export{t as getGeometryZScaler,r as zScale};
