/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as e}from"../../../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as t}from"../../../../../../geometry/projection/projectVectorToVector.js";import{center as o}from"../../../../../../geometry/support/aaBoundingRect.js";function n(r){const{featureCount:e}=r;if(0===e)return new Uint32Array;const t=new Uint32Array(e);return r.getObjectIdsArray(t),t}function a(r){const{featureCount:e}=r;if(0===e)return new Float64Array;const t=new Float64Array(3*e);return r.getCoordinatesArray(t),t}function i(r,e){const{featureCount:t}=r;if(0===t)return new Float64Array;return c(a(r),e)}function c(r,t){const o=r.length/3,n=t.viewSpatialReference,a=t.renderSpatialReference,i=new Float64Array(3*o);if(!e(r,n,0,i,a,0,o))throw new Error("Failed to project coordinates");return i}function f(e,n){const a=n.viewSpatialReference,i=n.renderSpatialReference,{extent:c}=e,f=o(c),u=r();return t([f[0],f[1],0],a,u,i),u}export{i as computeRenderCoordinates,f as computeTileCenterRenderCoordinates,c as projectToRenderCoordinates,a as readMapCoordinates,n as readObjectIds};
