UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 3.97 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{ensureClass as n}from"../core/accessorSupport/ensureType.js";import{assertNotMesh as e}from"./asserts.js";import{G as r}from"../chunks/geometryEngineBase.js";import t from"./SpatialReference.js";import{hydratedAdapter as u}from"./geometryAdapters/hydrated.js";function i(e){const r=Array.isArray(e)?e[0].spatialReference:e.spatialReference;return r?n(t,r):t.WGS84}function o(n){return r.extendedSpatialReferenceInfo(n)}function c(n,t){return e(n),r.clip(u,i(n),n,t)}function f(n,t){return e(n),r.cut(u,i(n),n,t)}function s(n,t){return e(n),e(t),r.contains(u,i(n),n,t)}function a(n,t){return e(n),e(t),r.crosses(u,i(n),n,t)}function l(n,t,o){return e(n),e(t),r.distance(u,i(n),n,t,o)}function p(n,t){return e(n),e(t),r.equals(u,i(n),n,t)}function m(n,t){return e(n),e(t),r.intersects(u,i(n),n,t)}function d(n,t){return e(n),e(t),r.touches(u,i(n),n,t)}function g(n,t){return e(n),e(t),r.within(u,i(n),n,t)}function h(n,t){return e(n),e(t),r.disjoint(u,i(n),n,t)}function w(n,t){return e(n),e(t),r.overlaps(u,i(n),n,t)}function R(n,t,o){return e(n),e(t),r.relate(u,i(n),n,t,o)}function x(n){return e(n),r.isSimple(u,i(n),n)}function y(n){return e(n),r.simplify(u,i(n),n)}function S(n,e=!1){return r.convexHull(u,i(n),n,e)}function j(n,t){return e(t),r.difference(u,i(n),n,t)}function A(n,t){return e(t),r.symmetricDifference(u,i(n),n,t)}function D(n,t){return e(t),r.intersect(u,i(n),n,t)}function T(n){return r.union(u,i(n),n)}function E(n,e,t,o,c,f){return r.offset(u,i(n),n,e,t,o,c,f)}function J(n,e,t,o=!1){return r.buffer(u,i(n),n,e,t,o)}function L(n,e,t,o,c,f){return r.geodesicBuffer(u,i(n),n,e,t,o,c,f)}function N(n,t,o=!0){return e(n),r.nearestCoordinate(u,i(n),n,t,o)}function O(n,t){return e(n),r.nearestVertex(u,i(n),n,t)}function V(n,t,o,c){return e(n),r.nearestVertices(u,i(n),n,t,o,c)}function v(n){return"xmin"in n?"center"in n?n.center:null:"x"in n?n:"extent"in n?n.extent?.center??null:null}function z(n,e,t){if(null==n)throw new M;const u=n.spatialReference;if(null==(t=t??v(n)))throw new M;const i=n.constructor.fromJSON(r.rotate(n,e,t));return i.spatialReference=u,i}function B(n,e){if(null==n)throw new M;const t=n.spatialReference;if(null==(e=e??v(n)))throw new M;const u=n.constructor.fromJSON(r.flipHorizontal(n,e));return u.spatialReference=t,u}function G(n,e){if(null==n)throw new M;const t=n.spatialReference;if(null==(e=e??v(n)))throw new M;const u=n.constructor.fromJSON(r.flipVertical(n,e));return u.spatialReference=t,u}function H(n,t,o,c){return e(n),r.generalize(u,i(n),n,t,o,c)}function I(n,t,o){return e(n),r.densify(u,i(n),n,t,o)}function b(n,t,o,c=0){return e(n),r.geodesicDensify(u,i(n),n,t,o,c)}function k(n,t){return e(n),r.planarArea(u,i(n),n,t)}function q(n,t){return e(n),r.planarLength(u,i(n),n,t)}function C(n,t,o){return e(n),r.geodesicArea(u,i(n),n,t,o)}function P(n,t,o){return e(n),r.geodesicLength(u,i(n),n,t,o)}function W(n,e){return r.intersectLinesToPoints(u,i(n),n,e)}function F(n,e){r.changeDefaultSpatialReferenceTolerance(n,e)}function K(n){r.clearDefaultSpatialReferenceTolerance(n)}class M extends Error{constructor(){super("Illegal Argument Exception")}}export{J as buffer,F as changeDefaultSpatialReferenceTolerance,K as clearDefaultSpatialReferenceTolerance,c as clip,s as contains,S as convexHull,a as crosses,f as cut,I as densify,j as difference,h as disjoint,l as distance,p as equals,o as extendedSpatialReferenceInfo,B as flipHorizontal,G as flipVertical,H as generalize,C as geodesicArea,L as geodesicBuffer,b as geodesicDensify,P as geodesicLength,D as intersect,W as intersectLinesToPoints,m as intersects,x as isSimple,N as nearestCoordinate,O as nearestVertex,V as nearestVertices,E as offset,w as overlaps,k as planarArea,q as planarLength,R as relate,z as rotate,y as simplify,A as symmetricDifference,d as touches,T as union,g as within};